Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Working on no_std crates with a custom target specification #500

Closed
joepie91 opened this issue Feb 10, 2019 · 1 comment
Closed

Working on no_std crates with a custom target specification #500

joepie91 opened this issue Feb 10, 2019 · 1 comment

Comments

@joepie91
Copy link

When working on eg. an operating system project (such as Philipp Opperman's follow-along blog series), you'll have to use a custom x86_64-unknown-none target specification alongside no_std to be able to develop and build for the correct target.

Unfortunately, this seems currently unworkable in combination with rls-vscode; any attempt at using RLS will result in a failure to build dependencies, marking Cargo.toml as failed and not providing any code intelligence nor error markings anywhere else.

Upon inspection of rls' error output (via the "log stderr to file" extension option), it turns out that the problem is the lack of an available core build for the target:

{"message":"can't find crate for `core`","code":{"code":"E0463","explanation":"\nA plugin/crate was declared but cannot be found. Erroneous code example: [... snipped ...]

This is a fairly common problem for custom target triples, and normally this is solved by using a tool like Xargo or cargo-xbuild for builds. But of course rls-vscode is not aware of this, and therefore fails to build it.

I'm not sure how to solve this with RLS (or if it is indeed currently solvable at all!), but this currently prevents ergonomic OS development.

@Xanewok
Copy link
Member

Xanewok commented Apr 7, 2019

Thanks, that's indeed a void in terms of tooling support. We're aware of the problem but most likely will waiit for std-aware/xargo-integrated cargo to help with that and unfortunately it's not high on the priority list. This is tracked upstream at rust-lang/rls#309 so I'll close this issue if you don't mind.

@Xanewok Xanewok closed this as completed Apr 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants