arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation
http://libtorrent.org
Other
5.23k stars 992 forks source link

boost 1.80.0.beta1 - ERROR: rule "version.boost-build" unknown in module" - linux #6972

Closed userdocs closed 2 years ago

userdocs commented 2 years ago

Please provide the following information

libtorrent version (or branch): 2.0.7 / 1.2.17

platform/architecture: Ubuntu Jammy amd64

compiler and compiler version: gcc 11

please describe what symptom you see, what you would expect to see instead and how to reproduce it.

Following on from the discussion as I made a reproduceable docker + bash method to show it you error.

Do this with docker.

docker run -it -w /root -e "build_dir=$HOME/lt-build" -v "$HOME/lt-build":/root ubuntu:jammy

apt update -y && apt install curl git build-essential -y
boost_version="1_80_0"
boost_beta_url="https://boostorg.jfrog.io/artifactory/main/beta/${boost_version//_/\.}.beta1/source/boost_${boost_version}_b1.tar.gz"
# you need this format for non beta urls
# boost_url="https://boostorg.jfrog.io/artifactory/main/release/${boost_version//_/\.}/source/boost_${boost_version}.tar.gz"

curl -NLk "${boost_beta_url}" --create-dirs -o "${build_dir}/boost_${boost_version}.tar.gz"
tar xf "${build_dir}/boost_${boost_version}.tar.gz" -C "${build_dir}"
pushd "${build_dir}/boost_${boost_version}/"
"${build_dir}/boost_${boost_version}/bootstrap.sh"
export BOOST_BUILD_PATH="${build_dir}/boost_${boost_version}"
echo "using gcc : $(gcc -dumpversion) : g++-$(g++ -dumpversion) ;" > "$HOME/user-config.jam"

git clone --single-branch --branch v2.0.7 --shallow-submodules --recurse-submodules --depth 1 https://github.com/arvidn/libtorrent "${build_dir}/libtorrent"
pushd "${build_dir}/libtorrent"
"${build_dir}/boost_${boost_version}/b2" -j"$(nproc)" optimization=speed crypto=openssl cxxstd=17 variant=release threading=multi link=static boost-link=static

And you will see this error

/home/username/lt-build/libtorrent /home/username/lt-build/boost_1_80_0 ~
CXXFLAGS =
LDFLAGS =
OS = LINUX
building boost from source directory:  /home/username/lt-build/boost_1_80_0
Jamfile:944: in install-paths
ERROR: rule "version.boost-build" unknown in module "Jamfile</home/username/lt-build/libtorrent>".
Jamfile:1063: in install-pkg-config
Jamfile:1094: in load-aux
/home/username/lt-build/boost_1_80_0/tools/build/src/build/project.jam:378: in load-jamfile
/home/username/lt-build/boost_1_80_0/tools/build/src/build/project.jam:64: in load
/home/username/lt-build/boost_1_80_0/tools/build/src/build/project.jam:142: in project.find
/home/username/lt-build/boost_1_80_0/tools/build/src/build-system.jam:618: in load
/home/username/lt-build/boost_1_80_0/tools/build/src/kernel/modules.jam:294: in import
/home/username/lt-build/boost_1_80_0/tools/build/src/kernel/bootstrap.jam:135: in module scope
root@709b7ca557b2:/home/username/lt-build/libtorrent#

I think i have some understanding of the issue based on this pull

https://github.com/userdocs/libtorrent/commit/22adfb33e76dc820dec78b07e7221358e6e246f3

But it has one problem, this will be true when it should be false when JAM_VERSION = 4 0 0 i guess since 4 is less that 2018?

if [ version.version-less $(JAM_VERSION) : 2018 03 ]
# which is basically
if [ version.version-less 4 0 0 : 2018 03 ]

I could not find a method to get the boost version itself though I do know it is in the /boost/version.hpp / include/version.hpp which would make for a more consistent check?

#define BOOST_VERSION 107100
#define BOOST_LIB_VERSION "1_71"
#define BOOST_LIB_VERSION "1_69"

So any version prior or 1.72.0 (4.0.0) will uses the format 2018 02 whereas the BOOST_LIB_VERSION formant is consistent,

userdocs commented 2 years ago

@arvidn So i tested this patch and there was no error. Build was a normal successful build.

https://patch-diff.githubusercontent.com/raw/arvidn/libtorrent/pull/6973.patch

userdocs commented 2 years ago

closed with https://github.com/arvidn/libtorrent/pull/6973

Needs to be in branch 1_2 as well though.

arvidn commented 2 years ago

https://github.com/arvidn/libtorrent/pull/6977

userdocs commented 2 years ago

Thanks!