Skip to content

Comments

🔧 avoid the installation of boost cmake config.#140

Merged
rbsheth merged 6 commits intocpp-pm:masterfrom
nxxm:feature/fix-boost-1.72-cmake-package-configs
Feb 14, 2020
Merged

🔧 avoid the installation of boost cmake config.#140
rbsheth merged 6 commits intocpp-pm:masterfrom
nxxm:feature/fix-boost-1.72-cmake-package-configs

Conversation

@daminetreg
Copy link

@daminetreg daminetreg commented Jan 17, 2020

Dear @ruslo, @dan-42, @rbsheth,

This fixes the issues discovered in #133 : when linking to a Boost library, the Boost::boost INTERFACE lib gets to link to the /Source directory that hunters generate during the build.

This is due of the BoostConfig-*.cmake files generated by Boost, because they aren't cleaned up anymore by your script : @HUNTER_SELF@/scripts/clean-boost-configs.cmake. But we don't need it anymore as we can pass b2 --no-cmake-config.

The cleanup didn't work anymore is due to a change in the names, at least on macOS I could check that, that the boost b2 generated cmake package configs were named lowercase like boost_headers-1.72.0/boost_headers-config.cmake, and I think at least in some case takes precedence over the cmake module for finding boost.

Presumably that's the reason why tests didn't fail when @dan-42 updated the boost version, or there is some cmakecache thing or ci cache thing involved.

Little question should I update the Boost revision to avoid any successful build because of a cache that doesn't notice the changes ?

@daminetreg
Copy link
Author

All tests passed for pkg.boost. ✔️

@daminetreg daminetreg changed the title 🔧 avoid the installation of boost cmake config. 🔧 avoid the installation of boost cmake config. Jan 18, 2020
@daminetreg daminetreg requested review from dan-42 and rbsheth January 18, 2020 10:10
Copy link

@dan-42 dan-42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@BenWhetton
Copy link

Does the ID value on the last line of cmake/projects/Boost/hunter.cmake need to be incremented before this is merged in?
See https://github.com/cpp-pm/hunter/blob/master/docs/reference/user-modules/hunter_download.rst#hunter_download

@daminetreg
Copy link
Author

daminetreg commented Jan 20, 2020

Does the ID value on the last line of cmake/projects/Boost/hunter.cmake need to be incremented before this is merged in?
See https://github.com/cpp-pm/hunter/blob/master/docs/reference/user-modules/hunter_download.rst#hunter_download

Yes thanks for pointing the specific id out, that was the bit I was asking. I’ll push that change to PACKAGE_INTERNAL_DEPS_ID.

@Bjoe
Copy link

Bjoe commented Jan 21, 2020

Read also my #133 (comment) about Boost::boost ....

@daminetreg
Copy link
Author

daminetreg commented Jan 21, 2020

I upgraded Boost PACKAGE_INTERNAL_DEPS_ID as pointed out by @BenWhetton. And relaunched tests on the test.boost branch.

See builds in progress :

Read also my #133 (comment) about Boost::boost ....

I've replied there, I think you are right on the long term, but as of Boost 1.72.0 I don't see another option as this one for now.

@daminetreg
Copy link
Author

Again, with the PACKAGE_INTERNAL_DEPS_ID updated all tests passed for test.boost. ✔️

@dan-42
Copy link

dan-42 commented Jan 21, 2020

PING: @bkotzz @rbsheth 👋

@Bjoe
Copy link

Bjoe commented Jan 23, 2020

@BenWhetton
Copy link

@rbsheth: Will you be able to review this soon? We are waiting for this fix to land but if it is going to take much longer we'll have to implement a local workaround for the issues we're encountering (see #141).

Copy link
Member

@rbsheth rbsheth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daminetreg Thanks for the detailed investigation and fix!

@BenWhetton Yes. 😄

I think the PACKAGE_INTERNAL_DEPS_ID needs to be updated here and the generate.sh script run.
https://github.com/cpp-pm/hunter/blob/master/cmake/projects/Boost/hunter.cmake.in#L21

As @Bjoe said, the iOS build may need to be updated with the --no-cmake-config also. See https://github.com/cpp-pm/hunter/blob/master/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in

Will adding the flag --no-cmake-config break older Boost versions that don't support the flag?

@Bjoe
Copy link

Bjoe commented Feb 4, 2020

@rbsheth We should update PACKAGE_INTERNAL_DEPS_ID also in all boost components.

If we not do this, then every hunter user they already build boost 1.72.0 from hunter version 0.23.245 must nuked ~/.hunter directory, because for hunter the boost version is not changed so they will not build new boost package .... see also the comment/post in issue #141

@BenWhetton
Copy link

@daminetreg do you think you'll have time to update this soon?


As @Bjoe said, the iOS build may need to be updated with the --no-cmake-config also. See https://github.com/cpp-pm/hunter/blob/master/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in
Will adding the flag --no-cmake-config break older Boost versions that don't support the flag?

Are there any regression tests which cover this?

@daminetreg
Copy link
Author

@daminetreg do you think you'll have time to update this soon?

Yes I'll do that this Friday morning. I have a little bit of time.

As @Bjoe said, the iOS build may need to be updated with the --no-cmake-config also. See https://github.com/cpp-pm/hunter/blob/master/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in
Will adding the flag --no-cmake-config break older Boost versions that don't support the flag?

Are there any regression tests which cover this?

Well if you want previous version to continue to work without this I need to restore the files responsible of deleting BoostConfig.cmake. I'll do something based on the version of boost if it's greater or equal 1.72 I'll do what I have here and otherwise go back.

@rbsheth
Copy link
Member

rbsheth commented Feb 12, 2020

@daminetreg Did you have an opportunity to fix this?

@madmongo1
Copy link

@rbsheth looks like @daminetreg is busy. This PR is pretty important. Boost is central to many c++ projects.
If you can offer guidance as to what remains to be done, I'd be happy to open a new PR which incorportates these changes and the final fix.

@daminetreg
Copy link
Author

I did lag a bit, but it is almost done, this evening pr will be updated with the little bits missing to prevent hunter cache issues.

Damien Buhl added 2 commits February 13, 2020 23:21
…d see previous commit) and unneeded clean-boost-configs as we can avoid that boost generates them.
@daminetreg daminetreg force-pushed the feature/fix-boost-1.72-cmake-package-configs branch from 27532ea to e7a71de Compare February 14, 2020 08:36
…e the appropriate bjam switch as file name changed and will work better.
@daminetreg daminetreg force-pushed the feature/fix-boost-1.72-cmake-package-configs branch from e7a71de to b776b48 Compare February 14, 2020 10:05
@daminetreg
Copy link
Author

@daminetreg
Copy link
Author

For a summary:

  • Rebased on master to integrate the changes made in between
  • Updated the ios build
  • Implemented the use of bjam --no-cmake-configs only if version is >= 1.72.0.
  • Updated all PACKAGE_INTERNAL_DEPS_ID

@madmongo1
Copy link

Thank you for taking the time to do this. I bow before your CMake expertise!

…ependent cmake generation and on cmake documented behaviour.
@daminetreg
Copy link
Author

Thank you for taking the time to do this. I bow before your CMake expertise!

Thank you very much 😄

However the CI saw I did oversee the fact that the generator expression didn't work on all platform the same, and before all I used them in a context where they are not officially allowed by the documentation. So I removed them in favor of a bit more traditional approach.

This has the downside to try to clean always the boost config cmakes even when we don't install them, but it's safer as it is not allowed by the cmake documentation (even though this part worked everywhere due to the fact the file is generated by file(GENERATE OUTPUT ...).)

And to that while they came quite handy in this situations they are not thought for the kind of use I did, so better less clever but more solid.

@daminetreg daminetreg requested review from dan-42 and rbsheth February 14, 2020 17:50
Copy link
Member

@rbsheth rbsheth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @daminetreg! Will merge when green

@daminetreg
Copy link
Author

Thank you very much for the review. Tests are all green and passed.

By the way where is @ruslo ?

@rbsheth
Copy link
Member

rbsheth commented Feb 14, 2020

@daminetreg Great! @ruslo has passed this project onto myself and @bkotzz - he is focusing on other things.

@rbsheth rbsheth merged commit 67c40b9 into cpp-pm:master Feb 14, 2020
@daminetreg
Copy link
Author

Thanks for merging ^^ Hope it will work for the users as CI confirmed.

@ruslo is a terribly great expert in Cmake, hope he can comeback someday ^^.

@rbsheth keep up with the super good work !

@madmongo1
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants