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

Override config.toml options from command line #111566

Merged
merged 1 commit into from
May 24, 2023

Conversation

@rustbot
Copy link
Collaborator

rustbot commented May 14, 2023

r? @ozkanonur

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 14, 2023
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan
Copy link
Member

We should do the overriding in bootstrap::config module without changing the behaviour of the file deserialization. This will not help what's been said in the zulip thread at https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Running.20tests.20on.20precompiled.20rustc/near/358250357 since this logic needs toml file to be deserialized.

@onur-ozkan onur-ozkan added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 14, 2023
@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 1a36a1d to 4c84b7a Compare May 14, 2023 17:00
@clubby789 clubby789 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 14, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 4c84b7a to 7f0d98d Compare May 14, 2023 17:52
@onur-ozkan
Copy link
Member

Looks roughly good, can we have test for this?

@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 7f0d98d to 9b29cd4 Compare May 15, 2023 11:20
@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 9b29cd4 to 4a63d58 Compare May 15, 2023 13:23
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 4a63d58 to 49579e4 Compare May 15, 2023 13:34
@jyn514 jyn514 self-assigned this May 18, 2023
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems broadly good 👍 good call on slotting this into the existing Merge trait.

I would like to use this new mechanism in ./configure; I think it will both be a lot more maintainable (easier to test, the existing hacky regex in bootstrap.py only has to handle options it's actually using instead of all options) and a good way to verify that your new code is doing the right thing.

@jyn514
Copy link
Member

jyn514 commented May 18, 2023

I would like to use this new mechanism in ./configure

I think this shouldn't be too hard to add if you change

with bootstrap.output('Makefile') as f:
contents = os.path.join(rust_dir, 'src', 'bootstrap', 'mk', 'Makefile.in')
contents = open(contents).read()

to something like

 with bootstrap.output('Makefile') as f: 
     template = os.path.join(rust_dir, 'src', 'bootstrap', 'mk', 'Makefile.in') 
     contents = "BOOTSTRAP_ARGS := " + " ".join(sys.argv[1:]) + "\n"
     contents += open(template).read() 

and then delete all the handling of config.toml except for the defaults.

@clubby789
Copy link
Contributor Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2023
@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 49579e4 to 0ca21e2 Compare May 18, 2023 21:45
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last review notes from my side, thank you for the previous fixes :)

@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 0ca21e2 to 08a176b Compare May 19, 2023 11:16
@onur-ozkan
Copy link
Member

This LGTM. Feel free to r=me if your notes were resolved @jyn514

@clubby789
Copy link
Contributor Author

I haven't yet implemented #111566 (comment), planning to work on that today

@rust-cloud-vms rust-cloud-vms bot force-pushed the bootstrap-override-config branch from 08a176b to 9e088b2 Compare May 19, 2023 15:18
@clubby789
Copy link
Contributor Author

clubby789 commented May 19, 2023

Pushing to test if this is working with CI so far, but please let me know if you have any thoughts on the changes. I've not cleaned it up yet, so there's some unused functions

EDIT: newer, simpler approach

@rust-log-analyzer

This comment has been minimized.

@clubby789 clubby789 force-pushed the bootstrap-override-config branch from 9e088b2 to fe6b3d1 Compare May 19, 2023 18:43
@rust-log-analyzer

This comment has been minimized.

@clubby789
Copy link
Contributor Author

Ah, @jyn514 scripts like checktools.sh don't know about BOOTSTRAP_ARGS

@jyn514
Copy link
Member

jyn514 commented May 19, 2023

ah hmm, I see - running ./configure doesn't necessarily mean that all the bootstrap invocations are going to go through make, we need to support running ./x.py directly too.

That's unfortunate. The only way I can think of to get configure to use the new set option is to allow it in config.toml itself, and embedding toml in toml seems ... weird, to say the least.

I think for now let's leave ./configure as-is and land the improvement to bootstrap itself and I'll think more about whether it makes sense to allow set in config.toml.

@clubby789
Copy link
Contributor Author

What about setting BOOTSTRAP_ARGS as an env var, and having bootstrap append them to the end of argv?

@jyn514
Copy link
Member

jyn514 commented May 19, 2023

I don't see how that will work? How will they get set in the environment of the code that runs x.py?

@clubby789
Copy link
Contributor Author

Ah yes, my mistake. I'll revert the configure changes

@clubby789 clubby789 force-pushed the bootstrap-override-config branch from fe6b3d1 to 7a7cbe0 Compare May 20, 2023 15:42
@jyn514
Copy link
Member

jyn514 commented May 22, 2023

@bors r=ozkanonur

@bors
Copy link
Contributor

bors commented May 22, 2023

📌 Commit 7a7cbe0 has been approved by ozkanonur

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 22, 2023
@bors
Copy link
Contributor

bors commented May 24, 2023

⌛ Testing commit 7a7cbe0 with merge 70db836...

@bors
Copy link
Contributor

bors commented May 24, 2023

☀️ Test successful - checks-actions
Approved by: ozkanonur
Pushing 70db836 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 24, 2023
@bors bors merged commit 70db836 into rust-lang:master May 24, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 24, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (70db836): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 647.352s -> 647.458s (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants