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

bootstrap: Allow configuring the opt-level, not just debug vs release #112678

Closed
Noratrieb opened this issue Jun 15, 2023 · 6 comments · Fixed by #112756
Closed

bootstrap: Allow configuring the opt-level, not just debug vs release #112678

Noratrieb opened this issue Jun 15, 2023 · 6 comments · Fixed by #112756
Assignees
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Noratrieb
Copy link
Member

Noratrieb commented Jun 15, 2023

It would be nice if we could speed up stage1 library builds by building it with less opts and no debuginfo.

@jyn514 had the idea to control this with something like rust.stage1.opt-level

@Noratrieb Noratrieb added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Jun 15, 2023
@jyn514
Copy link
Member

jyn514 commented Jun 15, 2023

i'm going to use #112679 as a separate more broad issue for rust.stage1 - i'll repurpose this to just be for rust.opt-level (which is a lot simpler to add)

@jyn514 jyn514 changed the title Allow building stage1 library with O1 and no debuginfo bootstrap: Allow configuring the opt-level, not just debug vs release Jun 15, 2023
@jyn514
Copy link
Member

jyn514 commented Jun 15, 2023

mentoring instructions: add this option to the config::Rust struct, then around

cargo.env(profile_var("DEBUG"), debuginfo_level.to_string());
, set cargo.env(profile_var("OPT_LEVEL"), config.opt_level)

@jyn514 jyn514 added E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Jun 15, 2023
@Mark-Simulacrum
Copy link
Member

Can we confirm before we land this support that this is actually a significant win in practice? I recall historically having issues with optimize = false equivalents where the net effect is broken and slower tests - I would prefer to avoid landing support we don't want to actually support :)

@jyn514
Copy link
Member

jyn514 commented Jun 16, 2023

@Mark-Simulacrum this is especially useful in combination with #112679 - optimizing only rustc and not std should be a speedup even if we include the time taken for tests.

@Rustin170506
Copy link
Member

@rustbot claim

@Kobzol
Copy link
Contributor

Kobzol commented Jun 16, 2023

Maybe we should just generalize the optimize config value to a number/boolean, instead of adding a new attribute?

@bors bors closed this as completed in be6e38c Jul 2, 2023
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jul 2, 2023
Use RustOptimize to set optimize

close rust-lang/rust#112678

Use RustOptimize to set optimize.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants