makerdao / dss-deploy-scripts

GNU Affero General Public License v3.0
49 stars 59 forks source link

nix: use tag instead of commit hash #26

Closed asymmetric closed 5 years ago

asymmetric commented 5 years ago

More legible and less likely to trigger the "ambiguous refname" conflict.

asymmetric commented 5 years ago

fetchGit has no sha256 attribute AFAICT. It's true that tags can be replaced and therefore point to different objects.

Do you think this is reason enough not to use ref?

icetan commented 5 years ago

That's right, have to use fetchgit for sha256.

I'm very ambivalent to using ref without a hash. Fixed output derivations are good in the sense that nix only needs to look in the store for the hash.

asymmetric commented 5 years ago

What's a fixed output derivation?

Also, we could use fetchTarball, which does support sha256.

Thirdly, any idea why fetchGit doesn't? Seems weird.

icetan commented 5 years ago

What's a fixed output derivation?

Think it's a derivation where you know the output hash before hand: https://nixos.org/nix/manual/#fixed-output-drvs.

Also, we could use fetchTarball, which does support sha256.

Absolutely.

Thirdly, any idea why fetchGit doesn't? Seems weird.

Not sure, I know that the old version of fetchGit and fetchgit needed a sha256 even though you set a rev. A commit hash should be enough to determine the output, but for legacy reasons it still needed a separate content hash.

icetan commented 5 years ago

These changes have been rebased into nixify-poc and merged into master now :)