foundry.nix
foundry.nix copied to clipboard
disambiguate versions via github node id
the version is hardcoded to 0.0.0 in every build, which might be causing hash corruptions such as
error: hash mismatch in fixed-output derivation '/nix/store/df658f2lazlvjgvw6mmasfn29jlh2jnx-source.drv':
specified: sha256-mzOqmdnuX1/vOBefBBYhGw8c95YCZ4jk7qgB1OI/RGU=
got: sha256-goEOKMGFNxFRrTFpnH2IRfyPDH6NN1bO7zRoLwzu/Pw=
error: 1 dependencies of derivation '/nix/store/34ilnj2xlwq4w7slya42qlqajbpa6cl4-foundry-0.0.0.drv' failed to build
This PR changes the version so that the derivation should be named foundry-gh-node-id-<node_id>.drv instead of foundry-0.0.0.drv and therefore no longer risk collisions and hash mismatches
What's the current state of this? Is it working for you?
@shazow it's sooorta working
i can manually build it such that it picks up a hash and then yes it works, but if i build it and it picks up the generic nightly tag it will just break as soon as another release happens
@shazow current situation is several issues that all kinda play off each other
- monthly releases go missing => if i'm on
/monthlythen i end up with 404s at some point - if the versions are the same e.g. with hardcoded
0.0.0then the nix derivations seem to be able to collide - if the update script hits a mutable tag e.g.
nightlythen it will corrupt itself as soon as the mutable tag changes - nightlies get rugged after a few days anyway, so in combination of the monthly 404s, there seems like inevitable release chasing
For now i'm unblocked because i've got a nightly binary with a hash in it in this branch :)
@shazow hmmmmmm it's corrupting again even with the commit hashes
https://github.com/rainlanguage/rain.orderbook/actions/runs/7517565306/job/20463877231?pr=73
aaaaaah
release 20 hours ago
assets 6 hours ago
the tags with the hashes on them are mutable too?
They're not mutable so much as they're purged, they only last 2-3 days. [Edit: Ah your theory of race condition makes sense too]
We need to fix this issue too: https://github.com/foundry-rs/foundry/issues/6732#issuecomment-1889536123
Another option is we could mirror releases in this repo, but I was really hoping to avoid that.
@shazow they are mutable, i've seen the same nightly-<sha> tag with two different sets of assets built about 14 hours apart, and those asset sets have different hashes (because rust compilation is non deterministic)
The tag is created before the assets are uploaded, there is no other way unfortunately
@onbjerg @shazow the assets are built one time and uploaded, then much later (14 hours) all the assets are built a second time and uploaded to the same tag, dropping and replacing what was there before
this isn't a race condition or problem with the tag being created before the assets, its an issue of the assets being built multiple times for the same tag
i did think it was a race condition at first, but then saw the assets being replaced later