Skip to content
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

prevent the LLVM libraries bundled with clang binary from being discovered in pinned builds #834

Closed
wants to merge 1 commit into from

Conversation

spoonincode
Copy link
Member

@spoonincode spoonincode commented Mar 17, 2023

This fixes a failure of the pinned builds on ubuntu 22.04 that was bubbled up due to changes in #799

cmake has a well defined order in which it searches for packages when doing a find_package(). Critically, CMAKE_PREFIX_PATH locations are searched before searching something like PATH. This meant, previously, when searching for LLVM without a specific version we'd find the LLVM we built in the specified CMAKE_PREFIX_PATH early on during the search (except.. for see below). However the new version searching logic has the side effect of searching only for, say, LLVM 11.0 before it falls back to searching for LLVM 7.0. This means it ends up finding the incompatible LLVM 11.0 shipped in the clang binary via PATH and uses that instead.

Just remove the LLVM cmake files shipped with the compiler binary so cmake doesn't end up finding them. This compiler is intended for pinned leap builds only, so "damaging" it seems okay.

But wait! There's more!

The script was originally doing -DCMAKE_PREFIX_PATH=${LLVM_DIR}/lib/cmake -DCMAKE_PREFIX_PATH=${BOOST_DIR}/bin but these do not compound in to a list: the second parameter overwrites the first. This meant ${LLVM_DIR}/lib/cmake was actually not in the CMAKE_PREFIX_PATH search path! So how did this work before? 🤷‍♀️ 🤷 🤷‍♂️ I didn't dig more on that.

@ScottBailey ScottBailey self-requested a review March 17, 2023 14:27
Copy link
Contributor

@ScottBailey ScottBailey left a comment

Choose a reason for hiding this comment

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

lgtm

@spoonincode
Copy link
Member Author

actually.. I guess this doesn't work if someone is using an existing dependency directory

@spoonincode spoonincode marked this pull request as draft March 17, 2023 16:08
@spoonincode
Copy link
Member Author

updated PR description with reasoning

@spoonincode
Copy link
Member Author

This is no longer an issue with the new pinned build via reproducible.Dockerfile, so closing

@spoonincode spoonincode deleted the pinned_build_llvm_fix branch October 23, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants