Skip to content

Find hashed Cargo outputs in the Cargo 1.100 build directory layout - #98

Merged
timkpaine merged 2 commits into
mainfrom
find-cargo-build-dir-outputs
Nov 13, 2026
Merged

timkpaine merged 2 commits into
mainfrom
find-cargo-build-dir-outputs

Conversation

@timkpaine

@timkpaine timkpaine commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Description

Cargo 1.100 writes hashed rustc outputs to build/<package>/<hash>/out/ under the profile directory. Earlier versions wrote them to deps/.

Cargo copies a library to the profile directory only for crate types declared in Cargo.toml. When the crate type comes from rustc arguments (rustc-args, or the artifact's crate-type with no matching [lib] entry), hatch-rs looks for the hashed file, and with Cargo 1.100 the build failed with No build artifacts found or did not produce expected file. The lookup for extensions, shared libraries, executables, and Windows import libraries now searches both locations.

CI installs stable Rust, which became 1.100.0 on 2026-11-12, so test_cargo_controls_manifest_rustc_args_and_isolated_target_dir and test_c_abi_symbol_validation_failure fail on other branches until this is merged.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup
  • CI / build configuration
  • Other (describe below)

Checklist

  • Linting passes (make lint)
  • Tests pass (make test)
  • New tests added for new functionality
  • Documentation updated (if applicable)
  • Changelog / version bump (if applicable)

Cargo 1.100 writes hashed rustc outputs to build/<package>/<hash>/out/
under the profile directory. Earlier versions wrote them to deps/.

Cargo copies a library to the profile directory only for crate types
declared in Cargo.toml. When the crate type comes from rustc arguments,
hatch-rs looks for the hashed file, and it found none with Cargo 1.100.
Search both locations.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.34%. Comparing base (af78614) to head (56ff061).

Files with missing lines Patch % Lines
hatch_rs/structs.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   92.19%   92.34%   +0.15%     
==========================================
  Files          15       15              
  Lines        2638     2665      +27     
==========================================
+ Hits         2432     2461      +29     
+ Misses        206      204       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine
timkpaine merged commit b92b7ab into main Nov 13, 2026
6 checks passed
@timkpaine
timkpaine deleted the find-cargo-build-dir-outputs branch November 13, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant