Skip to content

Conversation

@ipetkov
Copy link
Owner

@ipetkov ipetkov commented Dec 26, 2025

Motivation

Unfortunately, we cannot support automatic path remapping on Darwin. The remap paths option
requires absolute paths (since rustc will basically do a blind substitution). On Linux builds,
each derivation is chrooted to /build/{name-of-src} which ends up being the same string for
both the real and the deps-only derivations. On Darwin, however, this ends up being
/nix/var/nix/builds/{name-of-derivation} which is different between the main and deps-only
derivations. Since this value ends up in CARGO_BUILD_RUSTFLAGS, it effectively will lead to
cache invalidation when the real derivation runs if the values differ.

Moreover, we can't "just" replace the bytes ourselves since there's no guarantee that the
original build path is the same length as the un-neutered store path. Thus we'll noop this for
now on Darwin builders and leave it up to the caller to handle path remap if needed...

Resolves #944

Checklist

  • added tests to verify new behavior
  • added an example template or updated an existing one
  • updated docs/API.md (or general documentation) with changes
  • updated CHANGELOG.md

@ipetkov ipetkov enabled auto-merge (squash) December 26, 2025 18:45
@ipetkov ipetkov merged commit f1a8c74 into master Dec 26, 2025
18 checks passed
@ipetkov ipetkov deleted the push-qxmuuopoqnno branch December 26, 2025 18:48
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.

2 participants