fix(dart): keep the build directory out of the vodozemac bindings - #62
Merged
Conversation
nikzen
force-pushed
the
fix/vodozemac-darwin-build-paths
branch
from
August 3, 2026 16:33
1fcd558 to
49ca2ff
Compare
nikzen
force-pushed
the
fix/vodozemac-darwin-build-paths
branch
from
August 4, 2026 07:29
49ca2ff to
d7355b0
Compare
5 tasks
yash-garg
approved these changes
Aug 5, 2026
Nix builds in `/nix/var/nix/builds/nix-<pid>-<random>`, and on darwin, where no sandbox remaps that to a constant, the name reached the artefacts: a hundred and four times in the shared library, two hundred and twelve in the static one, plus the hashes LLVM derives from a module's path and the install name the linker writes. Two builds were never the same bytes, so nobody could rebuild the library and see that it matched what was shipped — which is most of what pinning a dependency by version is for. Rewriting the prefix leaves the static library reproducible down to the byte. The shared one keeps a UUID and an ad-hoc signature the linker derives from the rest; dropping the UUID would buy the last forty-eight bytes at the cost of symbolicating a crash, which is the worse trade. The install name is worth fixing whether or not any of that matters. Until now the library announced its own location as a directory that stopped existing when the build finished. Nothing reads it, because `flutter_rust_bridge` opens the file by the path it is handed, but anything that linked against it would have kept a reference to somewhere that was never there. Signed-off-by: Niklas Zender <n.zender@famedly.com> Co-authored-by: Cursor <cursoragent@cursor.com>
nikzen
force-pushed
the
fix/vodozemac-darwin-build-paths
branch
from
August 24, 2026 09:01
d7355b0 to
889b040
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nix build --rebuildshows that two builds offamedly-vodozemacon a Mac arenever the same bytes. Nix builds in
/nix/var/nix/builds/nix-<pid>-<random>,and darwin has no sandbox to remap that to a constant, so the path reaches the
artefacts: 104 occurrences in the shared library, 212 in the static one, the
symbol suffixes LLVM hashes from a module's path, and
LC_ID_DYLIB, which ld64fills with the full output path when no install name is given.
Remapping the prefix leaves the static library reproducible down to the
byte and takes the shared one from ~1500 differing bytes to 48: the Mach-O
UUID and the ad-hoc signature over it.
-Wl,-no_uuidwould remove those at thecost of ever symbolicating a crash, which is the worse trade.
The install name is worth fixing either way. The library announced its own
location as a build directory that stopped existing when the build finished.
Nothing reads it, since
flutter_rust_bridgeopens the file by the path it ishanded, but anything that linked against it would have kept that reference.
Inert on Linux: the hook is darwin-only, and the sandbox already mounts the
build directory at a constant
/build.web.nixis a different artefact by adifferent route and would need its own measurement.
Stacked on #56, where
native.nixlives — the file this used to patch does notsurvive that split. The derivation does: with this applied, both branches
produce the same store path.
Found while measuring what was worth putting in the shared binary cache (#59),
which it does not block.
Test plan
nix flake check --all-systems,prek --all-files --stage pre-pushnix build --rebuildonaarch64-darwin: the.ais byte-identical,the
.dylibdown to 48 bytes, no build directory paths leftotool -lshows the install name under$out/libMade with Cursor
The stack
#63 and #59 stand outside the chain and can land in any order. #59 and #56
both touch the vodozemac module, so whichever goes second wants a rebase.