4 rust_src
= os
.environ
['RUSTC_SRC']
5 orig_cargo
= os
.environ
['ORIG_CARGO'] if 'ORIG_CARGO' in os
.environ
else None
9 'name': 'nixpkgs-sysroot-stub-crate',
11 'authors': ['The Rust Project Developers'],
15 'compiler_builtins': {
17 'features': ['rustc-dep-of-std', 'mem'],
20 'path': os
.path
.join(rust_src
, 'core'),
23 'path': os
.path
.join(rust_src
, 'alloc'),
28 'rustc-std-workspace-core': {
29 'path': os
.path
.join(rust_src
, 'rustc-std-workspace-core'),
31 'rustc-std-workspace-alloc': {
32 'path': os
.path
.join(rust_src
, 'rustc-std-workspace-alloc'),
38 if orig_cargo
is not None:
39 with
open(orig_cargo
, 'r') as f
:
40 src
= toml
.loads(f
.read())
42 base
['profile'] = src
['profile']
44 out
= toml
.dumps(base
)
46 with
open('Cargo.toml', 'x') as f
: