Merge pull request #321095 from mmlb/rust-write-config.toml-not-config
rust: Write config.toml not config
This commit is contained in:
commit
a2b5266973
@ -73,7 +73,7 @@ in stdenv.mkDerivation ({
|
|||||||
|
|
||||||
${cargoUpdateHook}
|
${cargoUpdateHook}
|
||||||
|
|
||||||
# Override the `http.cainfo` option usually specified in `.cargo/config`.
|
# Override the `http.cainfo` option usually specified in `.cargo/config.toml`.
|
||||||
export CARGO_HTTP_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
|
export CARGO_HTTP_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
|
||||||
|
|
||||||
if grep '^source = "git' Cargo.lock; then
|
if grep '^source = "git' Cargo.lock; then
|
||||||
@ -96,7 +96,7 @@ in stdenv.mkDerivation ({
|
|||||||
|
|
||||||
# Packages with git dependencies generate non-default cargo configs, so
|
# Packages with git dependencies generate non-default cargo configs, so
|
||||||
# always install it rather than trying to write a standard default template.
|
# always install it rather than trying to write a standard default template.
|
||||||
install -D $CARGO_CONFIG $name/.cargo/config;
|
install -D $CARGO_CONFIG $name/.cargo/config.toml;
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
@ -22,7 +22,7 @@ cargoSetupPostUnpackHook() {
|
|||||||
mkdir .cargo
|
mkdir .cargo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config="$cargoDepsCopy/.cargo/config";
|
config="$cargoDepsCopy/.cargo/config.toml";
|
||||||
if [[ ! -e $config ]]; then
|
if [[ ! -e $config ]]; then
|
||||||
config=@defaultConfig@
|
config=@defaultConfig@
|
||||||
fi;
|
fi;
|
||||||
@ -30,9 +30,9 @@ cargoSetupPostUnpackHook() {
|
|||||||
tmp_config=$(mktemp)
|
tmp_config=$(mktemp)
|
||||||
substitute $config $tmp_config \
|
substitute $config $tmp_config \
|
||||||
--subst-var-by vendor "$cargoDepsCopy"
|
--subst-var-by vendor "$cargoDepsCopy"
|
||||||
cat ${tmp_config} >> .cargo/config
|
cat ${tmp_config} >> .cargo/config.toml
|
||||||
|
|
||||||
cat >> .cargo/config <<'EOF'
|
cat >> .cargo/config.toml <<'EOF'
|
||||||
@cargoConfig@
|
@cargoConfig@
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ let
|
|||||||
else "cp $lockFileContentsPath $out/Cargo.lock"
|
else "cp $lockFileContentsPath $out/Cargo.lock"
|
||||||
}
|
}
|
||||||
|
|
||||||
cat > $out/.cargo/config <<EOF
|
cat > $out/.cargo/config.toml <<EOF
|
||||||
[source.crates-io]
|
[source.crates-io]
|
||||||
replace-with = "vendored-sources"
|
replace-with = "vendored-sources"
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ EOF
|
|||||||
declare -A keysSeen
|
declare -A keysSeen
|
||||||
|
|
||||||
for registry in ${toString (builtins.attrNames extraRegistries)}; do
|
for registry in ${toString (builtins.attrNames extraRegistries)}; do
|
||||||
cat >> $out/.cargo/config <<EOF
|
cat >> $out/.cargo/config.toml <<EOF
|
||||||
|
|
||||||
[source."$registry"]
|
[source."$registry"]
|
||||||
registry = "$registry"
|
registry = "$registry"
|
||||||
@ -253,7 +253,7 @@ EOF
|
|||||||
key=$(sed 's/\[source\."\(.*\)"\]/\1/; t; d' < "$crate/.cargo-config")
|
key=$(sed 's/\[source\."\(.*\)"\]/\1/; t; d' < "$crate/.cargo-config")
|
||||||
if [[ -z ''${keysSeen[$key]} ]]; then
|
if [[ -z ''${keysSeen[$key]} ]]; then
|
||||||
keysSeen[$key]=1
|
keysSeen[$key]=1
|
||||||
cat "$crate/.cargo-config" >> $out/.cargo/config
|
cat "$crate/.cargo-config" >> $out/.cargo/config.toml
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -215,7 +215,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||||||
export JEMALLOC_SYS_WITH_LG_VADDR=48
|
export JEMALLOC_SYS_WITH_LG_VADDR=48
|
||||||
'' + lib.optionalString (!(finalAttrs.src.passthru.isReleaseTarball or false)) ''
|
'' + lib.optionalString (!(finalAttrs.src.passthru.isReleaseTarball or false)) ''
|
||||||
mkdir .cargo
|
mkdir .cargo
|
||||||
cat > .cargo/config <<\EOF
|
cat > .cargo/config.toml <<\EOF
|
||||||
[source.crates-io]
|
[source.crates-io]
|
||||||
replace-with = "vendored-sources"
|
replace-with = "vendored-sources"
|
||||||
[source.vendored-sources]
|
[source.vendored-sources]
|
||||||
|
@ -326,7 +326,7 @@ in
|
|||||||
rustc.unwrapped
|
rustc.unwrapped
|
||||||
];
|
];
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
cat ../.cargo/config > ext/fast_mmaped_file_rs/.cargo/config.toml
|
cat ../.cargo/config.toml > ext/fast_mmaped_file_rs/.cargo/config.toml
|
||||||
sed -i "s|cargo-vendor-dir|$PWD/../cargo-vendor-dir|" ext/fast_mmaped_file_rs/.cargo/config.toml
|
sed -i "s|cargo-vendor-dir|$PWD/../cargo-vendor-dir|" ext/fast_mmaped_file_rs/.cargo/config.toml
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user