diff --git a/.gitattributes b/.gitattributes index 54b0ed57a..582e8a79e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,9 +18,6 @@ /.github/* export-ignore /.builds export-ignore /.builds/* export-ignore -# to make cargo vendor work correctly -/.cargo/ export-ignore -/.cargo/config.toml export-ignore # for linguist, which drives GitHub's language statistics alpine.js linguist-vendored diff --git a/build_tools/make_tarball.sh b/build_tools/make_tarball.sh index 98d67b937..13b044bf0 100755 --- a/build_tools/make_tarball.sh +++ b/build_tools/make_tarball.sh @@ -3,6 +3,10 @@ # Script to generate a tarball # Outputs to $FISH_ARTEFACT_PATH or ~/fish_built by default +# Example usage: +# +# build_tools/make_tarball.sh :/!.cargo/config.toml + # Exit on error set -e @@ -14,7 +18,7 @@ path=${FISH_ARTEFACT_PATH:-~/fish_built}/$prefix.tar.xz git archive \ --prefix="$prefix/" \ - HEAD | + HEAD "$@" | xz >"$path" # Output what we did, and the sha256 hash diff --git a/build_tools/make_vendor_tarball.sh b/build_tools/make_vendor_tarball.sh index 65012cf7d..e24fd8ba6 100755 --- a/build_tools/make_vendor_tarball.sh +++ b/build_tools/make_vendor_tarball.sh @@ -42,8 +42,14 @@ rm -f "$path" "$path".xz PREFIX_TMPDIR=$(mktemp -d) cd "$PREFIX_TMPDIR" +# Add .cargo/config.toml. This means that the caller may need to remove that file from the tarball. +# See e4674cd7b5f (.cargo/config.toml: exclude from tarball, 2025-01-12) + mkdir .cargo -cargo vendor --manifest-path "$wd/Cargo.toml" >> .cargo/config.toml +{ + cat "$wd"/.cargo/config.toml + cargo vendor --manifest-path "$wd/Cargo.toml" +} > .cargo/config.toml tar cfvJ "$path".xz vendor .cargo