From 476de5c070f47b7733d948bf74fa5bfe304e2570 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Sun, 19 Feb 2023 21:10:04 -0500 Subject: [PATCH] cudatoolkit: prune broken symlinks in `postFixup` As cudatoolkit is currently written, 11.8 introduces a broken symlink in `include` (also named `include`) and in `lib` (named `lib64`). This trips up some consumers, like `tensorflow-gpu`. --- pkgs/development/compilers/cudatoolkit/common.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index a98e188271cb..e986ae2dc14d 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -229,6 +229,13 @@ stdenv.mkDerivation rec { addOpenGLRunpath $out/cuda_sanitizer_api/compute-sanitizer/* addOpenGLRunpath $out/cuda_sanitizer_api/compute-sanitizer/x86/* addOpenGLRunpath $out/target-linux-x64/* + '' + + # Prune broken symlinks which can cause problems with consumers of this package. + '' + while read -r -d "" file; do + echo "Found and removing broken symlink $file" + rm "$file" + done < <(find "$out" "$lib" "$doc" -xtype l -print0) ''; # cuda-gdb doesn't run correctly when not using sandboxing, so