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

guid: fix compilation of Setup.hs and disable tests #88754

Merged

Conversation

aycanirican
Copy link
Member

Motivation for this change

haskellPackages.guid doesn't compile due to the error below:

% nix-shell -I. -p haskellPackages.guid                              
these derivations will be built:
  /nix/store/7xz2i3rq5ddh0ns9kbv82f3bv78xydfa-guid-0.1.0.drv
building '/nix/store/7xz2i3rq5ddh0ns9kbv82f3bv78xydfa-guid-0.1.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/blamkv8vbxc4nyzs61llligwi1bz9v4f-ghc-8.8.3.
unpacking sources
unpacking source archive /nix/store/za6hxapidmb06sv17gkgq3dx6y2nw6gj-guid-0.1.0.tar.gz
source root is guid-0.1.0
setting SOURCE_DATE_EPOCH to timestamp 1460276507 of file guid-0.1.0/guid.cabal
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/var/folders/b8/hhb93lms7mb097rx6lq3zq1m0000gn/T/nix-build-guid-0.1.0.drv-0/setup-package.conf.d -j8 -threaded -rtsopts
[1 of 1] Compiling Setup            ( Setup.hs, /private/var/folders/b8/hhb93lms7mb097rx6lq3zq1m0000gn/T/nix-build-guid-0.1.0.drv-0/Setup.o )

<no location info>: error:
    output was redirected with -o, but no output will be generated
because there is no Main module.

builder for '/nix/store/7xz2i3rq5ddh0ns9kbv82f3bv78xydfa-guid-0.1.0.drv' failed with exit code 1
error: build of '/nix/store/7xz2i3rq5ddh0ns9kbv82f3bv78xydfa-guid-0.1.0.drv' failed

Removing module declaration in Setup.hs fixes the problem. Also tests are failing due to the dependency on hspec-discover, I just disabled them since there actually are no tests.

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.

@@ -750,4 +750,9 @@ self: super: builtins.intersectAttrs super {
'';
});

# Fix compilation of Setup.hs and disable tests since it's empty
guid = overrideCabal (super.guid) (drv: {
prePatch = "sed -i '1d' Setup.hs";
Copy link
Member

Choose a reason for hiding this comment

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

What is this doing?

Also, is this an upstream problem? If so, please report it upstream.

Copy link
Member Author

Choose a reason for hiding this comment

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

This removes the module declaration at the first line of Setup.hs.

Upstream already notified about it but unresponsive. This package is dependency of many packages in haskell ecosystem and I'm trying to fix it to use nix in unison compiler source.

Copy link
Member

Choose a reason for hiding this comment

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

This removes the module declaration at the first line of Setup.hs

Could you add a comment about this right above the line 755? It should be obvious to anyone why sed is being used, and what it is doing, even if they haven't personally looked at the problematic Setup.hs file.

Also, could you link to the upstream issue? This is so that it is easy for us to know when a new (fixed) version is released, so we can remove this override.


Two other things:

  • Could you rebase this on the haskell-updates branch and change the base here on github to haskell-updates? We generally send haskell fixes to the haskell-updates branch (not master).

  • Could you remove guid from the list of broken-packages in pkgs/development/haskell-modules/configuration-hackage2nix.yaml? If you don't do this, then broken = true will always be set in the pkgs/development/haskell-modules/hackage-packages.nix file.

  • Maybe the comment should be edited to not talk about disabling tests? It looks like you went back and enabled the tests again. I guess they didn't end up causing a problem?


Also, completely unrelated, but I'm surprised you're saying guid is a dependency of many packages in the Haskell ecosystem. I've never heard of it, and it doesn't look like it is a dependency in any other packages in hackage-packages.nix.

guid: fix compilation of Setup.hs and disable tests

Add more docs

Remove guid from broken-packages
@aycanirican aycanirican changed the base branch from master to haskell-updates May 24, 2020 23:37
@aycanirican
Copy link
Member Author

@cdepillabout Ouch it's a disaster, I think I mistyped my search term, thank you for spotting it. And it feels awesome to see how nixpkgs quality still the best by means of code review and quality. I can catch up how things evolved with your guidance.

I think it's unnecessary to fix this package for now but for the sake of completeness I did all the tasks that you mentioned.

Thank you.

@cdepillabout
Copy link
Member

@aycanirican Ah, well thanks for going through and fixing this up even though it might not have been the package you were after!

Looks good to me, thanks!

@cdepillabout cdepillabout merged commit adf16b1 into NixOS:haskell-updates May 25, 2020
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

2 participants