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

Partition all-cabal-hashes into case-insensitive-safe components. #30290

Merged
merged 2 commits into from Oct 15, 2017

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Oct 10, 2017

OS X by default has a case-insensitive filesystem, and fetching
all-cabal-hashes there fails due to a hash mismatch caused by package
pairs like compactable and Compactable. This partitions the package set
such that each partition contains no equivalent-up-to-case pairs.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@shlevy
Copy link
Member Author

shlevy commented Oct 11, 2017

Have an idea for simplifying this and hopefully speeding it up significantly.

OS X by default has a case-insensitive filesystem, and fetching
all-cabal-hashes there fails due to a hash mismatch caused by package
pairs like compactable and Compactable. This partitions the package set
such that each partition contains no equivalent-up-to-case pairs.
@shlevy shlevy force-pushed the all-cabal-hashes-components branch from 8c9af0a to 843e099 Compare October 12, 2017 19:08
@shlevy
Copy link
Member Author

shlevy commented Oct 12, 2017

OK, recent version is much faster. Faster than a tar xf, even.

@shlevy
Copy link
Member Author

shlevy commented Oct 13, 2017

Barring any objection I'll merge mid next week @peti

@shlevy shlevy changed the title Break all-cabal-hashes into case-insensitive-safe components. Partition all-cabal-hashes into case-insensitive-safe components. Oct 13, 2017
{ name = "partition-all-cabal-hashes";
src = ./partition-all-cabal-hashes.c;
unpackPhase = "true";
buildInputs = [ pkgconfig libarchive glib ];
Copy link
Member

Choose a reason for hiding this comment

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

Should be a nativeBuildInputs = [ pkgconfig ];.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Ericson2314 I'll make that change, but FWIW this is almost always going to be used at eval time and thus not cross-compiled.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

The functionality provided by partition-all-cabal-hashes.c seems more general, i.e. I assume that many other projects have similar problems. Would it be possible to factor that tool out of pkgs/data/misc/hackage somehow?

Generally speaking, I'll drop all use of the "all-cabal-hashes" repo ASAP since this stuff if broken in several other ways, too, and we can find the hashes in the 01-index.tar.gz tarball from cabal-install anyway these days.

@shlevy
Copy link
Member Author

shlevy commented Oct 14, 2017

Hmm I don't know of any other projects with similar problems. Anyway this assumes things about the structure of the tarball, it could possibly be generalized but I would like to see another example or two to see how it can be done usefully.

What is the structure of the 01-index.tar.gz tarball?

@shlevy
Copy link
Member Author

shlevy commented Oct 14, 2017

Just checked that tarball, it will have exactly the same issue and this same tool will work on it.

@peti
Copy link
Member

peti commented Oct 14, 2017 via email

@shlevy
Copy link
Member Author

shlevy commented Oct 14, 2017

Ah, cabal2nix will extract info directly from the tarball? Nice.

Can we merge this in the mean time though?

@peti
Copy link
Member

peti commented Oct 14, 2017

If it works, then I don't see why not.

@shlevy shlevy merged commit 3ef3fc4 into NixOS:master Oct 15, 2017
@ElvishJerricco
Copy link
Contributor

@shlevy Wouldn’t it have been easier to just extract individual files from the tar file as needed?

@shlevy
Copy link
Member Author

shlevy commented Nov 3, 2017

@ElvishJerricco Yeah, fair point 😀

@ElvishJerricco ElvishJerricco mentioned this pull request Nov 6, 2017
8 tasks
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.

None yet

4 participants