PurpleI2P / i2pd

🛡 I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website
BSD 3-Clause "New" or "Revised" License
3.29k stars 424 forks source link

Test results re: "Removed dependency from boost::date_time and boost::filesystem" #2106

Closed diva-exchange closed 1 month ago

diva-exchange commented 1 month ago

Release notes for 2.54.0 (https://github.com/PurpleI2P/i2pd/releases/tag/2.54.0) say: "Removed dependency from boost::date_time and boost::filesystem"

Creating the binary by using this build process (executed on alpine 3/latest) :

cd /tmp && git clone --depth 1 --branch 2.54.0 https://github.com/PurpleI2P/i2pd.git

cd /tmp/i2pd/build && cmake -DWITH_AESNI=ON -DWITH_UPNP=ON . \
  && make -j $(nproc) \
  && strip i2pd

Lead to this error, if the library libboost_filesystem is not available within the environment of the executable: Error loading shared library libboost_filesystem.so.1.84.0: No such file or directory (needed by /i2pd/bin/i2pd)

Hence, the dependency to boost::filesystem is not removed in 2.54.0.

Possible fix: adapt release notes to "Removed dependency from boost::date_time"

Vort commented 1 month ago

Can you try building with filesystem removed from this line? https://github.com/PurpleI2P/i2pd/blob/88a5f8b125f9404fb73c7b0d1a37007101d9e6b0/build/CMakeLists.txt#L277

diva-exchange commented 1 month ago

Thanks, BUT: cmake/make is not the problem. The build works fine - just the execution of i2pd fails. This error here: Error loading shared library libboost_filesystem.so.1.84.0: No such file or directory (needed by /i2pd/bin/i2pd) is an error showing up in the i2pd log on systems which do NOT have the library "libboost_filesystem.so" available during runtime of i2pd.

Vort commented 1 month ago

is an error showing up in the i2pd log on systems which do NOT have the library

Will this error appear with binary built with filesystem removed from CMakeLists.txt?

diva-exchange commented 1 month ago

Tested and works! Thanks a lot. It was irritating for me that a build config instruction like "find_package" (which sounds like a "read" operation in my theoretical understanding) has an impact on the compiled binary. Do you do the PR?

BTW - just for documentation: this is the dockerfile patch within the build container:

cd /tmp \
  && git clone --depth 1 --branch 2.54.0 https://github.com/PurpleI2P/i2pd.git

#patch to remove boost-filesystem dependency
sed -i 's/find_package(Boost REQUIRED COMPONENTS system filesystem program_options)/find_package(Boost REQUIRED COMPONENTS system program_options)/g' /tmp/i2pd/build/CMakeLists.txt

cd /tmp/i2pd/build \
  && cmake -DWITH_AESNI=ON -DWITH_UPNP=ON . \
  && make -j $(nproc) \
  && strip i2pd
Vort commented 1 month ago

Tested and works!

Nice.

Do you do the PR?

boost::filesystem is not completely removed from i2pd. It is still needed for some old operating systems and compilers. So required modifications to CMakeLists.txt are not trivial and I don't know how to do them properly.

diva-exchange commented 1 month ago

OK, conclusion of this issue: tested on linux/amd64 and works without boost::filesystem only with above patch.

Untested on other architectures, like linux/arm/v7 or linux/arm64