File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,19 +289,20 @@ let
289289 cp --remove-destination "$(realpath -e $target)" $target
290290 fi
291291
292- # The SYSROOT is determined by using the librustc_driver-*.so .
292+ # The SYSROOT is determined by using the librustc_driver-*.{so,dylib} .
293293 # So, we need to point to the *.so files in our derivation.
294- chmod u+w $target
295- patchelf --set-rpath "$out/lib" $target || true
294+ shopt -u nullglob
295+ if ls $out/lib/*.so &>/dev/null; then
296+ chmod u+w $target
297+ patchelf --set-rpath "$out/lib" $target || true
298+ fi
296299 done
297300
298- # Here we copy the librustc_driver-*.so to our derivation.
301+ # Here we copy the librustc_driver-*.{so,dylib} to our derivation.
299302 # The SYSROOT is determined based on the path of this library.
300- if ls $out/lib/librustc_driver-*.so &> /dev/null; then
301- RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.so)
302- rm $out/lib/librustc_driver-*.so
303- cp $RUSTC_DRIVER_PATH $out/lib/
304- fi
303+ shopt -s nullglob
304+ RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.{so,dylib})
305+ cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/
305306 '' ;
306307
307308 # Export the manifest file as part of the nix-support files such
You can’t perform that action at this time.
0 commit comments