Adding a new crate to libstd dependency

I'm trying to port libstd to a new target, and I want to use some external crates (no_std).

Those crates are built without problem on their own, but when I add it to libstd dependency, build fails with can't find crate "core" error.

I found that explicitly adding core dependency to Cargo.toml solves the problem. But then I'd have to keep local copies of all the crates in the dependency chain t.t. Why do they require core dependency explicitly listed??

I think you’re supposed to use rustc-std-workspace-core for this, so that the crate can be published on while also working in the libstd build system.

1 Like

I guess that's the only way. I was hoping for some way to use external crates as-is.
There are several crates in the dependency chain of a crate that I want to use.

I'll have to add the following line to all of the crates.
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }

I guess I'll have to keep local copies of those crates with the change applied, or open a PR to add the line to those crates.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.