Grdo1.putty PDocsSoftware Tools
Related
iOS 27 AI Leaks: Writing Tools, Wallpapers, and Smarter ShortcutsMastering BleachBit TUI: A Step-by-Step Guide to Using the New Text Interface8 Crucial Details About the Kim Kardashian Instagram Mix-Up That Backfired on a Random Man10 Reasons Why Switching from OneDrive to Ente Photos Changed My Backup GameCan Ibogaine Help Veterans Conquer PTSD? Insights from Recent TrialsBehind the Lens: How AI is Quietly Reshaping Filmmaking Workflows10 Crucial Insights into OpenAI's Codex Chrome Extension for Browser AutomationACEMAGIC Unveils Updated F5A Mini PC with Ryzen AI HX 470: Enhanced Performance and Connectivity

Cargo Developers Urge Immediate Testing of New Build Directory Layout

Last updated: 2026-05-01 08:03:52 · Software Tools

Breaking: Cargo Unveils Build Dir Layout v2

The Cargo team has announced a critical testing phase for a redesigned build directory layout, available now in nightly builds via the -Zbuild-dir-new-layout flag. Developers are urged to test their projects immediately to identify compatibility issues before the change becomes the default.

Cargo Developers Urge Immediate Testing of New Build Directory Layout
Source: blog.rust-lang.org

According to Cargo team members, "While the layout of the build dir is internal-only, many projects need to rely on the unspecified details due to missing features within Cargo." This testing phase is essential to uncover tooling and process dependencies that could break under the new structure.

Background: Internal Change, Broad Impact

The current layout organizes build artifacts by content type. The new layout (v2) scopes artifacts by package name and a hash of the build unit and its inputs. This shift aims to improve caching and reproducibility but may disrupt tools that infer paths or rely on the old file structure.

Although a crater run has been performed, it does not cover every use case. The team needs community help to identify tools, scripts, and processes that depend on unspecified layout details. "We need help identifying tools and process that rely on the details, reporting issues to these projects so they can update to the new layout or support them both," the team stated.

What This Means for Developers

If you use nightly Rust (2026-03-10 or later), run your tests, release processes, and any other operations that touch build-dir or target-dir with the flag -Zbuild-dir-new-layout. Example: cargo test -Zbuild-dir-new-layout.

Note that failures may not be isolated to this flag. Since Cargo 1.91, you can separate intermediate artifacts (build-dir) from final artifacts (target-dir) using CARGO_BUILD_BUILD_DIR=build. The team is evaluating making this the default in #16147.

Known Failure Modes

  • Inferring binary path from test path: Use std::env::var_os("CARGO_BIN_EXE_*") (Cargo 1.94+) or env!("CARGO_BIN_EXE_*") as fallback.
  • Build scripts looking up target-dir from binary or OUT_DIR: See Issue #13663 – update workarounds.
  • Looking up user-requested artifacts from rustc: See Issue #13672 – update workarounds.

Library Support Status (as of publish time)

  • assert_cmd: fixed
  • cli_test_dir: Issue #65 – pending fix
  • compiletest_rs: Issue #309 – pending fix
  • executable-path: fixed
  • snapbox: fixed
  • term-transcript: Issue #269 – pending fix
  • test_bin: Issue #13 – pending fix
  • trycmd: fixed

What Is Not Changing

The layout of final artifacts within target-dir remains unchanged. The nesting of build artifacts under the profile and target tuple (if specified) also stays the same.

How to Test

Use at least nightly 2026-03-10. Run your standard workflows (tests, release builds, CI) with -Zbuild-dir-new-layout. Report issues on the tracking issue. The team encourages fixing local problems, reporting upstream issues, and providing feedback.