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

make dist vendoring configurable #130110

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

onur-ozkan
Copy link
Member

Adds a new option dist.vendor which allows people to decide whether to vendor dependencies for their custom distribution tarball builds. Note that our builds will not be affected, as the default for this option is the same as the previous vendoring condition from bootstrap.

@rustbot
Copy link
Collaborator

rustbot commented Sep 8, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Sep 8, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 8, 2024

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

This PR modifies config.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 10, 2024

☔ The latest upstream changes (presumably #130179) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

Thank you!

@Kobzol
Copy link
Contributor

Kobzol commented Sep 13, 2024

You can r=me (unless you want to wait for Mark :) ).

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me

set(&mut config.dist_include_mingw_linker, include_mingw_linker)
set(&mut config.dist_include_mingw_linker, include_mingw_linker);
config.dist_vendor = vendor.unwrap_or_else(|| {
// If we're building from git or tarball sources, enable it by default.
Copy link
Member

Choose a reason for hiding this comment

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

What's the alternative option to these two? Someone clones git and then deletes .git?

Copy link
Member Author

Choose a reason for hiding this comment

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

Someone clones git and then deletes .git?

That might be a bit awkward, but it’s still one possibility.

Another case that fits this scenario is using this download button:

Ekran görüntüsü 2024-09-14 182025

Copy link
Member

Choose a reason for hiding this comment

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

Another case that fits this scenario is using this download button:

That produces a broken source archive as all git submodules missing. You can't even build the standard library from that archive as both stdarch (core::arch) and backtrace (std::backtrace) are submodules.

@onur-ozkan
Copy link
Member Author

@bors r=Kobzol,Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Sep 14, 2024

📌 Commit 7e0fb6e has been approved by Kobzol,Mark-Simulacrum

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 Sep 14, 2024
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 15, 2024
…r, r=Kobzol,Mark-Simulacrum

make dist vendoring configurable

Adds a new option `dist.vendor` which allows people to decide whether to vendor dependencies for their custom distribution tarball builds. Note that our builds will not be affected, as the default for this option is the same as the previous vendoring condition from bootstrap.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 15, 2024
…r, r=Kobzol,Mark-Simulacrum

make dist vendoring configurable

Adds a new option `dist.vendor` which allows people to decide whether to vendor dependencies for their custom distribution tarball builds. Note that our builds will not be affected, as the default for this option is the same as the previous vendoring condition from bootstrap.
@bors
Copy link
Contributor

bors commented Sep 15, 2024

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout configurable-dist-vendor (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self configurable-dist-vendor --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging src/bootstrap/src/utils/change_tracker.rs
CONFLICT (content): Merge conflict in src/bootstrap/src/utils/change_tracker.rs
Auto-merging src/bootstrap/src/core/config/config.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 15, 2024
@workingjubilee
Copy link
Member

@bors r-

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan
Copy link
Member Author

Rebased.

@bors r=Kobzol,Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Sep 15, 2024

📌 Commit 13542cd has been approved by Kobzol,Mark-Simulacrum

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 Sep 15, 2024
@@ -942,3 +942,6 @@
# Copy the linker, DLLs, and various libraries from MinGW into the Rust toolchain.
# Only applies when the host or target is pc-windows-gnu.
#include-mingw-linker = true

# Whether to vendor dependencies for the dist tarball.
#vendor = if "is a tarball source" || "is a git repository" { true } else { false }
Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be necessary to vendor when building from a source tarball. We can just reuse the existing vendor directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that, but then decided to leave the task to cargo instead of handling it manually. I couldn't get rid of the paranoia about users potentially cluttering the vendor folder.

Copy link
Contributor

Choose a reason for hiding this comment

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

It shouldn't be necessary to vendor when building from a source tarball. We can just reuse the existing vendor directory.

Exactly!

I'm building using a source release tarball (when packaging for pkgsrc), and expect the tarball to be self-contained. Ref. issue #130708.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 15, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#129439 (Implement feature `string_from_utf8_lossy_owned` for lossy conversion from `Vec<u8>` to `String` methods)
 - rust-lang#129828 (miri: treat non-memory local variables properly for data race detection)
 - rust-lang#130110 (make dist vendoring configurable)
 - rust-lang#130293 (Fix lint levels not getting overridden by attrs on `Stmt` nodes)
 - rust-lang#130342 (interpret, miri: fix dealing with overflow during slice indexing and allocation)

Failed merges:

 - rust-lang#130394 (const: don't ICE when encountering a mutable ref to immutable memory)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8ad52dd into rust-lang:master Sep 15, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 15, 2024
Rollup merge of rust-lang#130110 - onur-ozkan:configurable-dist-vendor, r=Kobzol,Mark-Simulacrum

make dist vendoring configurable

Adds a new option `dist.vendor` which allows people to decide whether to vendor dependencies for their custom distribution tarball builds. Note that our builds will not be affected, as the default for this option is the same as the previous vendoring condition from bootstrap.
@onur-ozkan onur-ozkan deleted the configurable-dist-vendor branch September 16, 2024 05:20
pld-gitsync pushed a commit to pld-linux/rust that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

10 participants