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

llvm_gtest: Only install once #96959

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

tstellar
Copy link
Collaborator

llvm_gtest and its dependencies were being installed twice (and into two different locations depending on the cmake options).

llvm_gtest and its dependencies were being installed twice (and
into two different locations depending on the cmake options).
@tstellar tstellar requested review from nikic and dtzSiFive June 27, 2024 20:04
@dtzSiFive
Copy link
Contributor

dtzSiFive commented Jun 28, 2024

Hmm, what installs the libraries after this change?

I do see them installed twice presently, this isn't latest but build log I had on hand:

-- Installing: /nix/store/2fpxb3k6n60bn4w1rqrn6dny1h3pi9ir-llvm-20240508_b52160d-lib/lib/libllvm_gtest.a
-- Installing: /nix/store/2fpxb3k6n60bn4w1rqrn6dny1h3pi9ir-llvm-20240508_b52160d-lib/lib/libllvm_gtest_main.a
-- Up-to-date: /nix/store/2fpxb3k6n60bn4w1rqrn6dny1h3pi9ir-llvm-20240508_b52160d-lib/lib/libllvm_gtest.a
-- Up-to-date: /nix/store/2fpxb3k6n60bn4w1rqrn6dny1h3pi9ir-llvm-20240508_b52160d-lib/lib/libllvm_gtest_main.a

Is that what this addresses? Thanks!

@tstellar
Copy link
Collaborator Author

tstellar commented Jun 28, 2024

Hmm, what installs the libraries after this change?

The add_llvm_library calls are generating the install targets.

Is that what this addresses? Thanks!

Yes, and there was also a bug where if you configure with -DCMAKE_INSTALL_PREFIX and without -DLLVM_LIBDIR_SUFFIX then you end up with the libraries installed into two locations, because add_llvm_library installs to lib${LLVM_LIBDIR_SUFFIX} and the custom insall targets removed in this patch install to CMAKE_INSTALL_LIBDIR which is different in this scenario.

Copy link
Contributor

@dtzSiFive dtzSiFive left a comment

Choose a reason for hiding this comment

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

Thank you for the explanation, this makes sense to me and thanks for fixing this!

@tstellar tstellar merged commit 9ed4b17 into llvm:main Jul 2, 2024
6 checks passed
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
llvm_gtest and its dependencies were being installed twice (and into two
different locations depending on the cmake options).
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
llvm_gtest and its dependencies were being installed twice (and into two
different locations depending on the cmake options).
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.

3 participants