I want to add a new dependency to libstd in the Rust compiler. I am trying what is mentioned in Adding a new crate to libstd dependency, but I cannot make it work. Please let me know if you see where I am doing something wrong.
I want to add another crate my-crate
to Rust compiler's libstd like:
my-crate = { path = "../../../my-crate" }
I understand for my-crate
to work here, I need to make core
a dependency of my-crate
. So I add this in my-crate/Cargo.toml
which I got from https://github.com/rust-lang/rust/tree/master/library/rustc-std-workspace-core :
[package]
name = "my-crate"
...
edition = "2018"
...
[dependencies]
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
However, building the compiler with libstd gives me the same error as before:
./x.py build -i --stage=1 --target=a-new-crosscompiling-target
Updating only changed submodules
Submodules updated in 0.02 seconds
Finished dev [unoptimized] target(s) in 0.22s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Compiling my-crate v19.0.0 (/home/utsav/Desktop/my-crate)
error[E0463]: can't find crate for `core`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `my-crate`.