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

Add a dont_dlopen flag to build_tarballs. #1239

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

maleadt
Copy link
Contributor

@maleadt maleadt commented Oct 19, 2022

This prevents BinaryBuilder from dlopen'ing library products during build, while still having the JLL doing so at run time. This matters for (surprise surprise) CUDA libraries, which commonly depend on libcuda, a library that will only be available at run time on a system with the CUDA driver installed. That means we don't want to load this library during the build on Yggdrasil, but we also don't want to set dont_dlopen on the LibraryProduct because we expect libcuda.so to be available while loading the JLL. If it isn't, that's detected by augment_platform!, which sets the platform tag so that no artifact will be loaded and no wrapper will be selected (and thus no library will be dlopened).

Ref JuliaPackaging/Yggdrasil#5701

This prevents BinaryBuilder from dlopen'ing library products,
while still having the JLL doing so at run time.
@maleadt
Copy link
Contributor Author

maleadt commented Oct 19, 2022

Coincidentally this is related to @giordano's recent work on not dlopening in case of ISA mismatches. Since we don't want to add CUDA-specific stuff to BinaryBuilder(Base), I guess the dont_dlopen keyword is still needed though.

@maleadt maleadt requested a review from giordano October 19, 2022 15:28
@vchuravy
Copy link
Member

Also helpful Flor libclang/LLvM and libclangex

Where we currently do this delightful nonsense https://github.com/Gnimuc/ClangCompiler.jl/blob/master/src/jllshim.jl

@maleadt
Copy link
Contributor Author

maleadt commented Oct 19, 2022

Yeah I considered doing that, but JLLWrappers also does some LIB_PATH and dlopen_flag handling, and I didn't want to replicate all that.

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

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

Disentangling dont_dlopen in the generated JLL from the audit pass looks good to me, I'm however not happy about just adding extra random keyword arguments to build_tarballs(), but that's probably for another issue: #670

src/AutoBuild.jl Show resolved Hide resolved
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