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

haskellPackages.ghcHEAD: Mark "exceptions" as a core library #95788

Merged
merged 1 commit into from Aug 21, 2020

Conversation

utdemir
Copy link
Member

@utdemir utdemir commented Aug 19, 2020

Motivation for this change

It turns out exceptions is now a core library, this patch marks it as so.

Before this patch, packages depending on exceptions would pull in a version from Hackage, which would collide with the core version.

cc @cdepillabout

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.

@cdepillabout
Copy link
Member

cdepillabout commented Aug 19, 2020

@utdemir Do you know of some library that I can try compiling that uses exceptions and compiles correctly with ghcHEAD?

I want to test that setting exceptions to null actually works for compiling libraries (well, at least one library) that depend on it.

I don't think ghcHEAD is widely used, so breaking it is not the worst thing in the world, but I guess it is better to be safe than sorry.


Also, I've confirmed that exceptions is actually a boot library. The following is on the current haskell-updates branch (commit 0e2ed7a):

$ nix-shell -I nixpkgs=./. -p haskell.compiler.ghcHEAD --run 'ghc-pkg list | grep exception'
    exceptions-0.10.4

@cdepillabout
Copy link
Member

cdepillabout commented Aug 19, 2020

Hmm, https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history seems to indicate that it is a boot library even with GHC-8.10.

Do we need to add this to the configuration-ghc8.10.nix file as well?

$ nix-shell -I nixpkgs=./. -p haskell.compiler.ghc8101 --run 'ghc-pkg list | grep exception'
    exceptions-0.10.4

@utdemir
Copy link
Member Author

utdemir commented Aug 19, 2020

Do we need to add this to the configuration-ghc8.10.nix file as well?

It looks like it is already the case, it was added by: 2514bdd . Probably we simply forgot updating ghcHEAD, as you said it's not as widely used.

@utdemir Do you know of some library that I can try compiling that uses exceptions and compiles correctly with ghcHEAD?

Not easily. I had the issue when compiling doctest's tests, where I hit this case:

if ${gnugrep}/bin/egrep -q -z 'Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
echo >&2 "*** abort because of serious configure-time warning from Cabal"
exit 1

Unfortunately, it requires hundreds of lines of overrides to get doctest dependencies compile, even after that tests fail for a different reason after applying this patch. As an alternative, I tried safe-exceptions which is pretty dependency-light, however it did compile successfully both with and without this patch. That confuses me, I don't know why is it complaining on doctest but not on safe-exceptions. I'll try to get a small reproducing example tomorrow.

@cdepillabout
Copy link
Member

I tried safe-exceptions which is pretty dependency-light, however it did compile successfully both with and without this patch.

That is somewhat confusing.

Although like you say, it seems like this is necessary, so maybe we should go ahead and merge it even if you can't get some sort of reproducible example.

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

3 participants