cudaPackages.setupCudaHook: fix error when reading empty marker

This commit is contained in:
Connor Baker 2024-04-03 21:20:51 +00:00
parent 02966afc54
commit 5ee7bfc443
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,10 @@ extendcudaHostPathsSeen() {
# E.g. cuda_cudart-lib
local cudaOutputName
read -r cudaOutputName < "$markerPath"
# Fail gracefully if the file is empty.
# One reason the file may be empty: the package was built with strictDeps set, but the current build does not have
# strictDeps set.
read -r cudaOutputName < "$markerPath" || return 0
[[ -z "$cudaOutputName" ]] && return 0