Skip to content

Commit

Permalink
build: fix cargo-vendor-dir handling
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Apr 16, 2024
1 parent 831da56 commit 3ef8116
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pre_fetch_cargo_deps() {

local outLink="--no-out-link"
local cargoVendorMsg=""
local cargoVendorDir=""
if [ -n "$CARGO_VENDOR_DIR" ]; then
if [ "$(realpath -s "$CARGO_VENDOR_DIR")" = "$(realpath -s "$SCRIPTDIR/..")" ]; then
cargoVendorDir="$CARGO_VENDOR_DIR/$GIT_BRANCH"
Expand All @@ -45,11 +46,11 @@ pre_fetch_cargo_deps() {
fi

outLink="--out-link "$cargoVendorDir""
cargoVendorMsg="into $(realpath -s "$cargoVendorDir") "
fi

for (( attempt=1; attempt<=maxAttempt; attempt++ )); do
if $NIX_BUILD $outLink -A "$nixAttrPath"; then
[ -n "$cargoVendorDir" ] && cargoVendorMsg="into $(realpath -s "$cargoVendorDir") "
echo "Cargo vendored dependencies pre-fetched "$cargoVendorMsg"after $attempt attempt(s)"
return 0
fi
Expand Down

0 comments on commit 3ef8116

Please sign in to comment.