Skip to content

Allow passing custom args to cargo in builds #1353

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

Closed
jyn514 opened this issue Apr 15, 2021 · 1 comment · Fixed by #1374
Closed

Allow passing custom args to cargo in builds #1353

jyn514 opened this issue Apr 15, 2021 · 1 comment · Fixed by #1374
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature E-easy Effort: Should be easy to implement and would make a good first PR mentor This has instructions for getting started

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 15, 2021

Right now, .cargo/config is stripped before the build, so there's no way to pass custom arguments to cargo during the build. It would be helpful to add cargo-args to the metadata in order to support flags like -Zbuild-std=std,alloc.

Originally posted by @Nemo157 in #1299 (comment)

@jyn514 jyn514 added A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature E-easy Effort: Should be easy to implement and would make a good first PR labels Apr 15, 2021
@jyn514
Copy link
Member Author

jyn514 commented Apr 15, 2021

Mentoring instructions:

  1. Add a new cargo_args field to Metadata, similar to rustdoc_args:
    /// List of command line arguments for `rustdoc`.
    #[serde(default)]
    rustdoc_args: Vec<String>,
  2. Add it to cargo_args():
    pub fn cargo_args(&self, additional_args: &[String], rustdoc_args: &[String]) -> Vec<String> {
  3. Document it on /about/builds:
    # Additional `RUSTDOCFLAGS` to set (default: [])
    rustdoc-args = ["--example-rustdoc-arg"]

@jyn514 jyn514 added the mentor This has instructions for getting started label Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature E-easy Effort: Should be easy to implement and would make a good first PR mentor This has instructions for getting started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant