File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 152152 makeClauses = lib . strings . concatStringsSep "\n "
153153 ( lib . mapAttrsToList makeClause deps ) ;
154154 in ''
155- manifest=$('' ${base}/bin/cargo locate-project --message-format plain --workspace)
155+ base_cargo() {
156+ PATH="$base/bin:$PATH" "$base/bin/cargo" "$@"
157+ }
158+
159+ manifest=$(base_cargo locate-project --message-format plain --workspace)
156160 case "$manifest" in
157161 ${ matchClauses }
158162 esac
159163 if [ -f '' ${root}/flake.nix ]; then
160164 sed -i '/# vendor dependency configuration generated by nix/{N;d;}' $root/.git/info/exclude
161165 ${ makeClauses }
162166 fi
167+
168+ # libgit2-sys copies a vendored git2 into the target/
169+ # directory somewhere. In certain, rare, cases,
170+ # libgit2-sys is rebuilt in the same incremental dep
171+ # directory as it was before, and then this copy fails,
172+ # because the files, copied from the nix store, already
173+ # exist and do not have w permission. Hack around this
174+ # issue by making any existing libgit2-sys vendored git2
175+ # files writable before a build can be run
176+ find "$(base_cargo metadata --format-version 1 | jq -r '.target_directory')" -path '*/build/libgit2-sys-*/out/include' -print0 | xargs -r -0 chmod u+w -R
163177 '' ;
164178
165179 # Hyperlight scripts use cargo in a bunch of ways that don't
You can’t perform that action at this time.
0 commit comments