add sysroot lockfile update script then run it

This commit is contained in:
Aaron Janse 2020-10-17 01:34:51 -07:00
parent 7ebcb6ee48
commit 512458c68a
4 changed files with 42 additions and 11 deletions

View file

@ -1,14 +1,21 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "alloc"
version = "0.0.0"
dependencies = ["compiler_builtins", "core"]
dependencies = [
"compiler_builtins",
"core",
]
[[package]]
name = "compiler_builtins"
version = "0.1.32"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bc4ac2c824d2bfc612cba57708198547e9a26943af0632aff033e0693074d5c"
dependencies = ["rustc-std-workspace-core"]
checksum = "7cd0782e0a7da7598164153173e5a5d4d9b1da094473c98dce0ff91406112369"
dependencies = [
"rustc-std-workspace-core",
]
[[package]]
name = "core"
@ -17,4 +24,6 @@ version = "0.0.0"
[[package]]
name = "rustc-std-workspace-core"
version = "1.99.0"
dependencies = ["core"]
dependencies = [
"core",
]

View file

@ -2,7 +2,7 @@ import os
import toml
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 = {
'package': {
@ -33,10 +33,11 @@ base = {
},
}
with open(orig_cargo, 'r') as f:
src = toml.loads(f.read())
if 'profile' in src:
base['profile'] = src['profile']
if orig_cargo is not None:
with open(orig_cargo, 'r') as f:
src = toml.loads(f.read())
if 'profile' in src:
base['profile'] = src['profile']
out = toml.dumps(base)

View file

@ -23,7 +23,7 @@ in rustPlatform.buildRustPackage {
RUSTC_BOOTSTRAP = 1;
__internal_dontAddSysroot = true;
cargoSha256 = "1l5z44dw5h7lbwmpjqax2g40cf4h27yai3wlj0p5di5v1xf25rng";
cargoSha256 = "0y6dqfhsgk00y3fv5bnjzk0s7i30nwqc1rp0xlrk83hkh80x81mw";
doCheck = false;

View 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"