Skip to content

Conversation

@ranger-ross
Copy link
Member

What does this PR try to resolve?

In #16502 (comment) there was a discussion about merging the build-script and deps dirs in the build-dir.

Currently:

build-dir/<profile>/build/<pkgname>/<hash>/
    deps/ # rustc output
    build-script/ # build script binary
    build-script-execution/ # the output of running a build script

Note: For build-scripts deps is empty.

This PR:

  1. moves the build script binaries from build-script to deps to simplify the layout
  2. renames build-script-execution to build-script to simplify the dir naming and shorten the path length for windows
build-dir/<profile>/build/<pkgname>/<hash>/
    deps/ # rustc output including build-script bins
    build-script/ # the output of running a build script

cc tracking issue: #15010

How to test and review this PR?

see the test changes

r? @epage

@rustbot rustbot added A-layout Area: target output directory layout, naming, and organization S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2026
@ranger-ross
Copy link
Member Author

---- cache_lock::mutate_then_download stdout ----

thread 'cache_lock::mutate_then_download' (588) panicked at tests\testsuite\cache_lock.rs:15:5:
test did not finish within 10 attempts (1.0023922s total)

---- cache_lock::mutate_then_shared stdout ----

thread 'cache_lock::mutate_then_shared' (11248) panicked at tests\testsuite\cache_lock.rs:15:5:
test did not finish within 10 attempts (1.0029349s total)

hmmm, spurious failure?

pub fn build_script_execution(&self, pkg_dir: &str) -> PathBuf {
if self.is_new_layout {
self.build_unit(pkg_dir).join("build-script-execution")
self.build_unit(pkg_dir).join("build-script")
Copy link
Contributor

Choose a reason for hiding this comment

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

I might even call this just run and generalize it beyond build scripts to executing some process.

Copy link
Contributor

Choose a reason for hiding this comment

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

But not a blocker for this

@epage epage enabled auto-merge January 15, 2026 15:32
@epage epage added this pull request to the merge queue Jan 15, 2026
Merged via the queue into rust-lang:master with commit 102926c Jan 15, 2026
52 of 58 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 15, 2026
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 16, 2026
Update cargo submodule

15 commits in 8c133afcd5e0d69932fe11f5907683723f8d361d..85eff7c80277b57f78b11e28d14154ab12fcf643
2026-01-09 03:50:15 +0000 to 2026-01-15 16:18:08 +0000
- fix(lockfile): switch to `resolver.lockfile-path` config (rust-lang/cargo#16510)
- Moved build-script bins to `deps` directory (rust-lang/cargo#16515)
- Invalidate the whole build cache when `-Zno-embed-metadata` changes (rust-lang/cargo#16513)
- Do not create examples dir in build dir with new layout (rust-lang/cargo#16514)
- fix(git): avoid partial oid got zero padded (rust-lang/cargo#16511)
- Optimize cargo locate-project --workspace (rust-lang/cargo#16423)
- chore: Update typos (rust-lang/cargo#16507)
- refactor(git): remove unnecessary serialization (rust-lang/cargo#16505)
- fix(build-std): std link metadata propagate to user (rust-lang/cargo#16496)
- Improve error message for missing dependencies (rust-lang/cargo#16500)
- fix: preserve `dep_name` for build script metadata  (rust-lang/cargo#16494)
- refactor(toml): clarify `to_dependency` for config patch (rust-lang/cargo#16492)
- Add `--id` flag to `cargo report timings` and `cargo report rebuilds` (rust-lang/cargo#16490)
- Display lockfile path in very verbose mode when blocking (rust-lang/cargo#16491)
- fix(info): resolve underscore vs hyphen mismatch in schema lookup (rust-lang/cargo#16455)

r? ghost
@rustbot rustbot added this to the 1.94.0 milestone Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-layout Area: target output directory layout, naming, and organization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants