-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boost configs broken by cross-prefix symlinks #14
Comments
Should be fixed on develop using Brad King's suggestion. |
Theis solution actually breaks things. For distributions, Boost is installed to a prefix other than root. For example, I use ./b2 -d+2 -q --user-config=./user-config-py3.jam \
--build-type=minimal --build-dir=./python3-build \
--python-buildid=py3 \
--prefix=%{buildroot}%{package_prefix} --exec-prefix=%{buildroot}%{package_bindir} \
--libdir=%{buildroot}%{package_libdir} --includedir=%{buildroot}%{package_includedir} \
--stagedir=./python3-stage %{?_smp_mflags} \
$PY_LIBRARIES_FLAGS \
link=shared runtime-link=shared install So now the installed cmake files contain the %{buildroot} part of the prefix (it's normally something like |
It shouldn't break things in this configuration. The logic checks whether the realpath of the computed CMake directory is equivalent to the one used when building ( |
Maybe I'm reading this wrong, but it's also comparing apples to tires. The bug was about |
Yes, it will fail. The fix can only kick in if the package is built in the same directory it's later installed into. |
If you find a DESTDIR-like workflow for |
There is no DESTDIR equivalent in b2, or if there is, I don't know about it. This never came up before I implemented CMake config file generation because the directories were never embedded anywhere. |
I suspect the same, all files installed by Boost just happened to be relocatable before it seems. I checked several packages (Arch, Fedora and Debian) and they all do the same as @AdamMajer - basically setting |
Instead of using Then, packagers could do
and then include |
The fact that Arch (that prompted this issue) packages by installing into a temporary dir basically means that the fix doesn't really fix anything though. For a proper fix we may need to introduce |
Instead of adding additional things, like --final-prefix, add DESTDIR environmental support during By "break things", I just meant that the temporary install directory during built is not suppose to be embedded in the produced binary. So it's only broken by policy. It's ineffective by function. |
@dennisklein I've added DESTDIR support to Boost.Build install, but unfortunately, it's magic (like most of Boost.Build) how to actually find the install directory, not the staging. But once we have the real install directory in the generated cmake files, it should not be difficult to get DESTDIR prefix removed from there. https://gist.github.com/AdamMajer/277de44eeec11e5c1ecc0011b2c67cc5 In this gist, the first patched file is the DESTDIR in the main Boost install. The other patched files I'm just experimenting. Maybe someone has a better idea how to fix this? Currently, there is an error because during stage, cmakedir is actually staging, not install directory... The alternative here is to use something like |
It's not good b2 practice to change behavior based on environment variables. Better to use a Also, I don't think there's any need to touch Boost.Build proper (the parts in As I said, staging as in |
|
@swatanabe do you have any comments on the suggested |
I think that the Arch issue is fixed by #36. |
Yes, I've tried out a local modification to my cmake files that mimics #36 on my arch system and can confirm it fixes builds (I had trouble with pulseview in the past) Edit: to clarify, I modified all |
A mention of this issue: https://lists.boost.org/boost-users/2020/04/90372.php |
On Arch /lib64 and /usr/lib64 are symlinks to /usr/lib, so a Boost installed into /usr but found via /lib64 will fail to set the correct paths for e.g. the include dir as reported in https://gitlab.kitware.com/cmake/cmake/issues/19841 (It will try to use
/include
instead of/usr/include
where the former does not exist)A solution would look similar to https://gitlab.kitware.com/cmake/cmake/blob/v3.15.4/Source/cmExportInstallFileGenerator.cxx#L201-219 as mentioned by Brad King at https://gitlab.kitware.com/cmake/cmake/issues/19841#note_640123
The text was updated successfully, but these errors were encountered: