Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unison-ucm: 1.0.M1h-alpha -> 1.0.M1j-alpha #85940

Merged
merged 1 commit into from Apr 25, 2020

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Apr 24, 2020

Replaces #84235

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hash is mismatching on x86_64-linux (see the Checks results).

}
else
fetchurl {
url = "https://github.com/unisonweb/unison/releases/download/release/${milestone_id}/unison-linux64.tar.gz";
sha256 = "0fb84c1yn8pidflh7kq696j3v4blkvbk1fsqp36h30p7vv676yci";
sha256 = "0ybs7y7p4wlhzl3vsn60wx9icf8pv09g2r6qcr2pyar76vd142sw";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hash should be 1xpblx405cp3mv0vrhcqwjlxvrhgmc77mxbvcy93srxja3qai1af

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ nix-prefetch-url  https://github.com/unisonweb/unison/releases/download/release/M1j/unison-linux64.tar.gz
[7.2 MiB DL]
path is '/nix/store/d6r6vvd6w1lamg37hh9dqqg4gi3mls8n-unison-linux64.tar.gz'
1xpblx405cp3mv0vrhcqwjlxvrhgmc77mxbvcy93srxja3qai1af

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I had done nix-prefetch-url --unpack https://github.com/unisonweb/unison/releases/download/release/M1j/unison-linux64.tar.gz, which resulted in a different hash. When should you use --unpack and when shouldn't you? I tried finding more information on this and couldn't find much. I think that I did the same for the Darwin file, so maybe that needs to change too? But it worked fine for me when I ran it locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh never mind, looking at my shell history I didn't do the same for Darwin, so it's probably right. Still if someone could shed some light on when to --unpack and when not to, I'd appreciate it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ceedubs --unpack is a hash of the content. You will need to use --unpack to get hashes for fetchzip, since that hashes the content. Not using --unpack is a hash of the archive.

Copy link

@aryairani aryairani Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@virusdave @worldofpeace
Sorry to butt in, but could/would someone help me understand the nix hashing here better? When I try to compute it using shasum (which is what we use for the ucm homebrew formula), I get a different result from any of the above:

$ wget https://github.com/unisonweb/unison/releases/download/release/M1j/unison-linux64.tar.gz
$ shasum -a 256 unison-linux64.tar.gz 
4e85a8f050b2673d92677bf57a0eab0fe6dda9e498c1bcc1aee3b20248a7ebf6  unison-linux64.tar.gz
$ shasum -a 1 unison-linux64.tar.gz 
17d7b14f0eed55eb5edc31088db67ebc77168935  unison-linux64.tar.gz

Any ideas why? Thanks in advance.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, hm, I guess it has to do with the encoding of the hash; shasum is using base16, and nix is using... base32, maybe?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't seem to match according to any base32 alphabet I can find (rfc4648 base32, z-base-32, crockford's, base32hex, geohash). 😕

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess nix uses its own alphabet, though I still can't seem to make the hash bits match up; but maybe it's enough to say that the appropriate hash comes from the nix tools (and not from elsewhere) and that's okay :)

Copy link
Contributor

@virusdave virusdave Apr 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@virusdave @worldofpeace
Sorry to butt in, but could/would someone help me understand the nix hashing here better? When I try to compute it using shasum (which is what we use for the ucm homebrew formula), I get a different result from any of the above:

$ wget https://github.com/unisonweb/unison/releases/download/release/M1j/unison-linux64.tar.gz
$ shasum -a 256 unison-linux64.tar.gz 
4e85a8f050b2673d92677bf57a0eab0fe6dda9e498c1bcc1aee3b20248a7ebf6  unison-linux64.tar.gz
$ nix-hash --to-base16 --type sha256 1xpblx405cp3mv0vrhcqwjlxvrhgmc77mxbvcy93srxja3qai1af

4e85a8f050b2673d92677bf57a0eab0fe6dda9e498c1bcc1aee3b20248a7ebf6


$ nix-hash --to-base32 --type sha256 4e85a8f050b2673d92677bf57a0eab0fe6dda9e498c1bcc1aee3b20248a7ebf6 

1xpblx405cp3mv0vrhcqwjlxvrhgmc77mxbvcy93srxja3qai1af

They match :)

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build unison-ucm

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@worldofpeace worldofpeace merged commit 882d124 into NixOS:master Apr 25, 2020
@ceedubs ceedubs deleted the unison-M1j branch April 25, 2020 20:06
ceedubs added a commit to ceedubs/nixpkgs that referenced this pull request Apr 28, 2020
Follow-up to NixOS#85940. There were a couple of issues with the
1.0.M1j-alpha release that were promptly fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants