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

Allow configuring the parent GitHub repository #117122

Merged
merged 5 commits into from Nov 9, 2023

Conversation

pietroalbini
Copy link
Member

The git integration in build_helper hardcoded rust-lang/rust as the parent GitHub repository, and master as the branch name. This works great for rust-lang/rust, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like ./x fmt).

In src/stage0.json there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This PR adds the github_repository key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.

The git integration in build_helper hardcoded `rust-lang/rust` as the
parent GitHub repository, and `master` as the branch name. This works
great for `rust-lang/rust`, but causes problems in downstream forks like
Ferrocene whenever those functions are invoked (like `./x fmt`).

In `src/stage0.json` there was already a configuration key for the name
of the nightly branch, but it wasn't used by build_helper. This commit
adds the `github_repository` key to the file, and requires both values
to be passed to build_helper whenever a git function is called. This
will allow downstream forks to tweak the values.
@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2023

r? @albertlarsan68

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

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-release Relevant to the release subteam, which will review and decide on the PR/issue. labels Oct 24, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2023

This PR modifies src/bootstrap/src/core/config. If appropriate, please also update CONFIG_CHANGE_HISTORY in src/bootstrap/src/lib.rs and change-id in config.example.toml.

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@albertlarsan68
Copy link
Member

This is a good idea, thanks!
Can you update config.example.toml with the default values and explanation about the new config?

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2023

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

This PR modifies src/bootstrap/src/core/config. If appropriate, please also update CONFIG_CHANGE_HISTORY in src/bootstrap/src/lib.rs and change-id in config.example.toml.

@pietroalbini
Copy link
Member Author

Can you update config.example.toml with the default values and explanation about the new config?

Right now the configuration is not in config.toml/config.example.toml, but in src/stage0.json, for two reasons:

  • nightly_branch was already there, so I added github_repository alongside it.
  • This is not really a configuration the user should set, but a configuration of the repository/fork itself. It should work without users having to set any config value when cloning Ferrocene (or any other fork of the compiler). I agree src/stage0.json is suboptimal for this, but there is no other place like that right now.

@rust-log-analyzer

This comment has been minimized.

@albertlarsan68
Copy link
Member

My bad, I was thinking it was an option in config.toml.
I'll review this when I have the time

Copy link
Member

@albertlarsan68 albertlarsan68 left a comment

Choose a reason for hiding this comment

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

LGTM, I would prefer if github_repository was renamed to git_repository.
r=me with the change

@albertlarsan68 albertlarsan68 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 Nov 5, 2023
@pietroalbini
Copy link
Member Author

@bors r=albertlarsan68

@bors
Copy link
Contributor

bors commented Nov 6, 2023

📌 Commit 580fa0c has been approved by albertlarsan68

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 Nov 6, 2023
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 6, 2023

⌛ Testing commit 580fa0c with merge 2f0d41a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 6, 2023
…lbertlarsan68

Allow configuring the parent GitHub repository

The git integration in build_helper hardcoded `rust-lang/rust` as the parent GitHub repository, and `master` as the branch name. This works great for `rust-lang/rust`, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like `./x fmt`).

In `src/stage0.json` there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This PR adds the `github_repository` key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 6, 2023

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 6, 2023
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 6, 2023
TaKO8Ki added a commit to TaKO8Ki/rust that referenced this pull request Nov 9, 2023
…=albertlarsan68

Allow configuring the parent GitHub repository

The git integration in build_helper hardcoded `rust-lang/rust` as the parent GitHub repository, and `master` as the branch name. This works great for `rust-lang/rust`, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like `./x fmt`).

In `src/stage0.json` there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This PR adds the `github_repository` key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.
@pietroalbini
Copy link
Member Author

@bors r=albertlarsan68

@bors
Copy link
Contributor

bors commented Nov 9, 2023

📌 Commit 488dd9b has been approved by albertlarsan68

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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2023
@bors
Copy link
Contributor

bors commented Nov 9, 2023

⌛ Testing commit 488dd9b with merge 4c8862b...

@bors
Copy link
Contributor

bors commented Nov 9, 2023

☀️ Test successful - checks-actions
Approved by: albertlarsan68
Pushing 4c8862b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 9, 2023
@bors bors merged commit 4c8862b into rust-lang:master Nov 9, 2023
12 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Nov 9, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c8862b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

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.8% [0.6%, 1.0%] 5
Regressions ❌
(secondary)
4.4% [4.4%, 4.4%] 1
Improvements ✅
(primary)
-0.7% [-1.2%, -0.4%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-1.2%, 1.0%] 12

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.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.7%, 0.7%] 1

Binary size

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

Bootstrap: 662.476s -> 663.173s (0.11%)
Artifact size: 308.77 MiB -> 308.78 MiB (0.00%)

@tshepang tshepang deleted the pa-configure-git-diff branch November 10, 2023 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants