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

Support running without a typical rust installation #295

Closed
Jake-Shadle opened this issue Oct 20, 2020 · 2 comments · Fixed by #520
Closed

Support running without a typical rust installation #295

Jake-Shadle opened this issue Oct 20, 2020 · 2 comments · Fixed by #520
Labels
enhancement New feature or request

Comments

@Jake-Shadle
Copy link
Member

#54 was closed by #243, but unfortunately that was apparently just the miniboss, as cargo internally calls rustc when gathering metadata

eg, rustc -vV and rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg are called, and while rustc -vV is easy to fake that's...the only one.

The original intention of #54 was to be able to run cargo-deny in minimal container environments, so opening this as a new issue since at least cargo is out of the way, but rustc might be a lot harder.

@Jake-Shadle Jake-Shadle added the enhancement New feature or request label Oct 20, 2020
@luser
Copy link
Contributor

luser commented Dec 7, 2020

FYI the first invocation comes from Rustc::new which gets called via Config::load_global_rustc. That codepath does use a cache in target/.rustc_info.json, so you could write a dummy file out there to force it to avoid that. It gets called in RustcTargetData::new, which is called from build_resolve_graph , which is called from output_metadata.

The second invocation is in TargetInfo::new, which gets called one or more times for every target specified in RustcTargetData::new. This seems a bit excessive, maybe cargo could be changed to load this information on-demand?

@Jake-Shadle
Copy link
Member Author

Ahh nice, might take a look at that for a workaround!

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

Successfully merging a pull request may close this issue.

2 participants