Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pkgs/development/cuda-modules/generic-builders/manifest.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ backendStdenv.mkDerivation (
''
# Handle the existence of libPath, which requires us to re-arrange the lib directory
+ strings.optionalString (libPath != null) ''
if [[ ! -d "${libPath}" ]] ; then
echo "${finalAttrs.pname}: ${libPath} does not exist, only found:" >&2
find "$(dirname ${libPath})"/ -maxdepth 1 >&2
full_lib_path="lib/${libPath}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I've also been wondering lately if it's better to pass this kind of values as environment variables instead of rendering them in the bash script, but that's not relevant rn I guess

if [[ ! -d "$full_lib_path" ]] ; then
echo "${finalAttrs.pname}: '$full_lib_path' does not exist, only found:" >&2
find lib/ -mindepth 1 -maxdepth 1 >&2
echo "This release might not support your CUDA version" >&2
exit 1
fi
mv "lib/${libPath}" lib_new
echo "Making libPath '$full_lib_path' the root of lib" >&2
mv "$full_lib_path" lib_new
rm -r lib
mv lib_new lib
''
Expand Down