Inclusion of <nlohmann/json.hpp> imprints header path to binary, destroying path-independent reproductive builds · nlohmann/json · Discussion #4494 (original) (raw)

I made a self-contained test case:

https://github.com/usvi/nlohmannjsontest

See the output:

janne@shell:/tmp$ git clone git@github.com:usvi/nlohmannjsontest.git
Cloning into 'nlohmannjsontest'...
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 18 (delta 2), reused 18 (delta 2), pack-reused 0 (from 0)
Receiving objects: 100% (18/18), 204.74 KiB | 605.00 KiB/s, done.
Resolving deltas: 100% (2/2), done.
janne@shell:/tmp$ cd nlohmannjsontest/
janne@shell:/tmp/nlohmannjsontest$ make
g++ -I inc -Wno-deprecated -c -o main_3.11.3.o src/main_3.11.3.cpp
g++ main_3.11.3.o -o main_3.11.3
g++ -I inc -Wno-deprecated -c -o main_2.1.1.o src/main_2.1.1.cpp
g++ main_2.1.1.o -o main_2.1.1
strip main_3.11.3
strip main_2.1.1
strings main_3.11.3 | grep "json.hpp"
inc/nlohmann3.11.3/json.hpp
strings main_2.1.1 | grep "json.hpp"
inc/nlohmann2.1.1/json.hpp

So, the strings are inside the binaries. What can I do?