add sysroot lockfile update script then run it
This commit is contained in:
parent
7ebcb6ee48
commit
512458c68a
19
pkgs/build-support/rust/sysroot/Cargo.lock
generated
19
pkgs/build-support/rust/sysroot/Cargo.lock
generated
|
@ -1,14 +1,21 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "alloc"
|
name = "alloc"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = ["compiler_builtins", "core"]
|
dependencies = [
|
||||||
|
"compiler_builtins",
|
||||||
|
"core",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "compiler_builtins"
|
name = "compiler_builtins"
|
||||||
version = "0.1.32"
|
version = "0.1.36"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7bc4ac2c824d2bfc612cba57708198547e9a26943af0632aff033e0693074d5c"
|
checksum = "7cd0782e0a7da7598164153173e5a5d4d9b1da094473c98dce0ff91406112369"
|
||||||
dependencies = ["rustc-std-workspace-core"]
|
dependencies = [
|
||||||
|
"rustc-std-workspace-core",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core"
|
name = "core"
|
||||||
|
@ -17,4 +24,6 @@ version = "0.0.0"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-std-workspace-core"
|
name = "rustc-std-workspace-core"
|
||||||
version = "1.99.0"
|
version = "1.99.0"
|
||||||
dependencies = ["core"]
|
dependencies = [
|
||||||
|
"core",
|
||||||
|
]
|
||||||
|
|
|
@ -2,7 +2,7 @@ import os
|
||||||
import toml
|
import toml
|
||||||
|
|
||||||
rust_src = os.environ['RUSTC_SRC']
|
rust_src = os.environ['RUSTC_SRC']
|
||||||
orig_cargo = os.environ['ORIG_CARGO']
|
orig_cargo = os.environ['ORIG_CARGO'] if 'ORIG_CARGO' in os.environ else None
|
||||||
|
|
||||||
base = {
|
base = {
|
||||||
'package': {
|
'package': {
|
||||||
|
@ -33,10 +33,11 @@ base = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(orig_cargo, 'r') as f:
|
if orig_cargo is not None:
|
||||||
src = toml.loads(f.read())
|
with open(orig_cargo, 'r') as f:
|
||||||
if 'profile' in src:
|
src = toml.loads(f.read())
|
||||||
base['profile'] = src['profile']
|
if 'profile' in src:
|
||||||
|
base['profile'] = src['profile']
|
||||||
|
|
||||||
out = toml.dumps(base)
|
out = toml.dumps(base)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ in rustPlatform.buildRustPackage {
|
||||||
|
|
||||||
RUSTC_BOOTSTRAP = 1;
|
RUSTC_BOOTSTRAP = 1;
|
||||||
__internal_dontAddSysroot = true;
|
__internal_dontAddSysroot = true;
|
||||||
cargoSha256 = "1l5z44dw5h7lbwmpjqax2g40cf4h27yai3wlj0p5di5v1xf25rng";
|
cargoSha256 = "0y6dqfhsgk00y3fv5bnjzk0s7i30nwqc1rp0xlrk83hkh80x81mw";
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
|
21
pkgs/build-support/rust/sysroot/update-lockfile.sh
Executable file
21
pkgs/build-support/rust/sysroot/update-lockfile.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p python3 python3.pkgs.toml cargo
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
HERE=$(dirname "${BASH_SOURCE[0]}")
|
||||||
|
NIXPKGS_ROOT="$HERE/../../../.."
|
||||||
|
|
||||||
|
# https://unix.stackexchange.com/a/84980/390173
|
||||||
|
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-lockfile')
|
||||||
|
|
||||||
|
cd "$tempdir"
|
||||||
|
nix-build -E "with import (/. + \"${NIXPKGS_ROOT}\") {}; pkgs.rustPlatform.rustcSrc.override { minimalContent = false; }"
|
||||||
|
RUSTC_SRC="$(pwd)/result" python3 "$HERE/cargo.py"
|
||||||
|
RUSTC_BOOTSTRAP=1 cargo build || echo "Build failure is expected. All that's needed is the lockfile."
|
||||||
|
|
||||||
|
cp Cargo.lock "$HERE"
|
||||||
|
|
||||||
|
rm -rf "$tempdir"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue