-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Update cargo submodule #150739
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
base: main
Are you sure you want to change the base?
Update cargo submodule #150739
Conversation
|
Some changes occurred in src/tools/cargo cc @ehuss |
|
This comment has been minimized.
This comment has been minimized.
fa879ed to
63dd6a8
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
63dd6a8 to
69f8120
Compare
|
@bors r+ rollup=never p=1 |
|
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
This comment has been minimized.
This comment has been minimized.
Update cargo submodule 19 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..623444427f04292f3a3c7eac560cfa65ba0bb88e 2025-12-26 19:39:15 +0000 to 2026-01-06 21:05:05 +0000 - docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476) - test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467) - feat(report): add cargo report rebuilds (rust-lang/cargo#16456) - feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121) - refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461) - docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437) - chore: Update dependencies (rust-lang/cargo#16460) - Update handlebars to 6.4.0 (rust-lang/cargo#16457) - chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454) - Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436) - fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448) - Implement fine grain locking for `build-dir` (rust-lang/cargo#16155) - feat(resolver): List features when no close match (rust-lang/cargo#16445) - feat(report): new command `cargo report sessions` (rust-lang/cargo#16428) - feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407) - test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444) - feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415) - feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441) - fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439) r? ghost
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 709282b failed: CI. Failed jobs:
|
|
@ranger-ross It looks like rust-lang/cargo#16436 is causing some test failures. Can you take a look? |
|
Sorry for the trouble here. I was able to reproduced with following on cargo new foo
cd foo
cargo add cortex-m-semihosting
cargo buildLooking the the issue it seems to be an issue with the version comparison added here d.version_req().matches(unit.pkg.version())Printing the versions: So the resolved version is less than 0.5.8 required by the To unblock this I can open a PR to revert this change for now? (Unless the y'all see an obvious fix that I am missing) |
|
@ranger-ross this might be the fix you were looking for: diff --git a/src/cargo/core/compiler/custom_build.rs b/src/cargo/core/compiler/custom_build.rs
index 851b51018..16a2f4888 100644
--- a/src/cargo/core/compiler/custom_build.rs
+++ b/src/cargo/core/compiler/custom_build.rs
@@ -467,7 +467,7 @@ fn build_work(build_runner: &mut BuildRunner<'_, '_>, unit: &Unit) -> CargoResul
let Some(dependency) = unit.pkg.dependencies().iter().find(|d| {
d.package_name() == dep.unit.pkg.name()
&& d.source_id() == dep.unit.pkg.package_id().source_id()
- && d.version_req().matches(unit.pkg.version())
+ && d.version_req().matches(dep.unit.pkg.version())
}) else {
panic!(
"Dependency `{}` not found in `{}`s dependencies", |
|
yikes... yeah this likely the problem. Good catch! I'll open a PR with this change. |
|
raised rust-lang/cargo#16486 |
…lection (#16486) ### What does this PR try to resolve? Fixes a bug in the logic during (unit) dependency selection for build scripts introduced in #16436 This was discovered while updating the submodule in rust-lang/rust rust-lang/rust#150739 ### How to test and review this PR? ```sh cargo new foo cd foo cargo add cortex-m-semihosting cargo build ``` I plan to add test case for this in a follow up PR, but raising the fix PR to unblock the submodule update for now. r? @weihanglo
69f8120 to
d833c5c
Compare
|
@bors r+ rollup=never p=1 |
|
💔 Test for 21c0a5c failed: CI. Failed jobs:
|
|
Interesting… |
|
The test failed because it is a The dependency tree look like (constructed from I guess a simple fix would be putting |
Actually, we might want to make sure that whether we has been exposing link metadata for std crates previously. |
|
@weihanglo I am available to make that change.
Hmm good point, do std crates even use |
compiler-builtins does
And I don't know if any transitive dependencies also. I guess we shouldn't let metadata propagate across std_resolve / usr_resolve boundary. |
|
I tend to think this as well. Having a clear boundary makes sense and we could always loosen it in the future if there is a strong usecase for this. |
Yeah I know. I meant if we skip all |
|
https://github.com/search?q=DEP_COMPILER_RT_COMPILER_RT&type=code BTW rust-lang/rust itself used to use I am good with having a boundary. |
|
Actually, I don't think its very difficult to properly handle build-std. let dependency_name = unit
.pkg
.dependencies()
.iter()
.find(|d| {
d.package_name() == dep.unit.pkg.name()
&& d.source_id() == dep.unit.pkg.package_id().source_id()
&& d.version_req().matches(dep.unit.pkg.version())
})
.map(|d| d.name_in_toml())
.unwrap_or_else(|| {
if dep.unit.is_std {
// If the depenency is a build-std dependency, it might not be in
// Cargo.toml. If its not present, we simply use the package name as we
// know its not renamed.
dep.unit.pkg.name()
} else {
panic!(
"Dependency `{}` not found in `{}`s dependencies",
dep.unit.pkg.name(),
unit.pkg.name()
)
}
}); |
|
I went ahead and posted rust-lang/cargo#16489 with the snippet above. Though if you'd prefer to go with a boundary instead, I'm fine with that as well. |
I don't know if this is true rust/library/panic_unwind/Cargo.toml Line 16 in 31cd367
Lines 92 to 94 in 31cd367
|
|
ohhhhh, geez sorry 😅 |
#16489) ### What does this PR try to resolve? This PR fixes a regression found in rust-lang/rust#150739 that was introduced in #16436. For `-Zbuild-std` std dependencies, we would panic due to the dependency not being present in `Cargo.toml`. ~~This PR adds handling fallback to the `unit.pkg.name()` if the unit both not present in `Cargo.toml` and `is_std`.~~ (see #16489 (comment)) This PR ensures that metadata propagation is only allowed between `std->std` crates and `non-std->non-std` crates. ### How to test and review this PR? ``` cargo new foo cd foo cargo add cortex-m cargo -Zbuild-std build ``` Previously we panic with ``` thread 'main' (4072127) panicked at src/cargo/core/compiler/custom_build.rs:472:21: Dependency `compiler_builtins` not found in `foo`s dependencies note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` with this change we not compile successfully r? @weihanglo
d833c5c to
a97825c
Compare
|
@bors r+ rollup=never p=1 |
|
🔒 Merge conflict This pull request and the base branch diverged in a way that cannot How do I rebase?Assuming
You may also read Please avoid the "Resolve conflicts" button on GitHub. Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how |
|
There should be no merge conflicts. Not sure what happened. cc @jieyouxu if you know something |
|
⌛ Testing commit a97825c with merge a3f2d5a... Workflow: https://github.com/rust-lang/rust/actions/runs/20856959263 |
Update cargo submodule 27 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..8c133afcd5e0d69932fe11f5907683723f8d361d 2025-12-26 19:39:15 +0000 to 2026-01-09 03:50:15 +0000 - Isolate build script metadata progation between std and non-std crates (rust-lang/cargo#16489) - Add Clippy like lint groups (rust-lang/cargo#16464) - feat: in-memory only `Manifest` (rust-lang/cargo#16409) - Fixed incorrect version comparision during build script dependency selection (rust-lang/cargo#16486) - refactor: new type for unit index (rust-lang/cargo#16485) - feat(test): Make CARGO_BIN_EXE_ available at runtime (rust-lang/cargo#16421) - fix(package): detect dirty files when run from workspace member (rust-lang/cargo#16479) - fix(timing)!: remove `--timings=<FMT>` optional format values (rust-lang/cargo#16420) - docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476) - test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467) - feat(report): add cargo report rebuilds (rust-lang/cargo#16456) - feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121) - refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461) - docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437) - chore: Update dependencies (rust-lang/cargo#16460) - Update handlebars to 6.4.0 (rust-lang/cargo#16457) - chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454) - Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436) - fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448) - Implement fine grain locking for `build-dir` (rust-lang/cargo#16155) - feat(resolver): List features when no close match (rust-lang/cargo#16445) - feat(report): new command `cargo report sessions` (rust-lang/cargo#16428) - feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407) - test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444) - feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415) - feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441) - fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)
27 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..8c133afcd5e0d69932fe11f5907683723f8d361d
2025-12-26 19:39:15 +0000 to 2026-01-09 03:50:15 +0000
Manifest(feat: in-memory onlyManifestcargo#16409)--timings=<FMT>optional format values (fix(timing)!: remove--timings=<FMT>optional format values cargo#16420)-Zbuild-analysis(docs(unstable): expand docs for-Zbuild-analysiscargo#16476)-Zunstable-optionswith custom targets (test: add-Zunstable-optionswith custom targets cargo#16467)dependenciesfield toUnitRegistered(fix(log): adddependenciesfield toUnitRegisteredcargo#16448)build-dir(Implement fine grain locking forbuild-dircargo#16155)cargo report sessions(feat(report): new commandcargo report sessionscargo#16428)cargo report timings(feat(report): support --manifest-path incargo report timingscargo#16441)