Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run miri without having to cargo install xargo #100

Open
ambroisie opened this issue Jul 30, 2022 · 2 comments
Open

Run miri without having to cargo install xargo #100

ambroisie opened this issue Jul 30, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ambroisie
Copy link

ambroisie commented Jul 30, 2022

Hello, first of all thank you for working on this overlay.

I would like to know if there are plans to be able to use clippy without having to cargo install xargo.

I am not very familiar with miri so I'm not sure exactly how much it relies on having access to xargo or not. From what I can gather, it seems like it needs to be provided with a std compiled for miri. Could this crate be provided as an extra component in the overlay?

Otherwise, could adding the miri component also add xargo so that it doesn't try to imperatively install it on my computer?

@oxalica oxalica added the enhancement New feature or request label Jul 30, 2022
@oxalica
Copy link
Owner

oxalica commented Jul 30, 2022

clippy works out-of-box. I'd assume you are referring to miri and cargo-miri.

I tried to package miri-sysroot before, in order to avoid xargo and cargo miri setup. But the key issue is that rust-src just contains a Cargo.toml for 3rd-party dependencies of std but not any vendored source. So it requires downloading these crates before building sysroot for MIRI.
Due to the network sandbox of Nix, we cannot easily package it without knowing hashes of vendored dep sources at eval-time.

BTW: Currently, to use MIRI, you first need to add extensions miri-preview and rust-src (eg. rust-bin.nightly."2022-07-30".default.override { extensions = [ "miri-preview" "rust-src" ]; }), run cargo miri setup which builds std with MIRI, then you should be able to use cargo miri on your projects.

@ambroisie
Copy link
Author

clippy works out-of-box. I'd assume you are referring to miri and cargo-miri.

Oops indeed, I edited the issue to fix that.

BTW: Currently, to use MIRI, you first need to add extensions miri-preview and rust-src (eg. rust-bin.nightly."2022-07-30".default.override { extensions = [ "miri-preview" "rust-src" ]; }), run cargo miri setup which builds std with MIRI, then you should be able to use cargo miri on your projects.

Alright, I will do that in as long as we can't take care of it declaratively.

Thanks for the quick answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants