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

polysemy-plugin: fix build #83757

Merged

Conversation

mikesperber
Copy link
Contributor

Motivation for this change

This is the second half of this change:

#83294 (comment)

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.

Comment on lines 1492 to 1499
polysemy-plugin = super.polysemy-plugin.override {
ghc-tcplugins-extra = self.ghc-tcplugins-extra_0_3_2;
};
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment here about why this is needed?

Also, could you open an issue upstream about fixing this (if it makes sense)?

If you wanted to get polysemy-plugin into Stackage, then you wouldn't have to worry about fixing up this kind of stuff in the future.

@mikesperber
Copy link
Contributor Author

Done.

The Polysemy people are already aware of this, but presumably this takes time. But will monitor and push if necessary.

@cdepillabout
Copy link
Member

The Polysemy people are already aware of this, but presumably this takes time. But will monitor and push if necessary.

Please put a link in the comment you added to the upstream issue where this is discussed.

This will help the nixpkgs haskell maintainers know when this override can be removed.

@mikesperber
Copy link
Contributor Author

This mentions both Stackage and the plugin version issue:

polysemy-research/polysemy#322

@mikesperber
Copy link
Contributor Author

Wait, I'll update the patch, too.

1 similar comment
@mikesperber
Copy link
Contributor Author

Wait, I'll update the patch, too.

@cdepillabout
Copy link
Member

@GrahamcOfBorg build haskellPackages.polysemy-plugin

@cdepillabout
Copy link
Member

@mikesperber You'll also have to mark polysemy-plugin as not broken. See this video for instructions:

https://discourse.nixos.org/t/video-tutorial-how-to-fix-broken-haskell-packages-in-nix/3968

@mikesperber
Copy link
Contributor Author

Done also.

@cdepillabout
Copy link
Member

cdepillabout commented Mar 31, 2020

@mikesperber When trying to build polysemy-plugin on this branch, I get the following build failure:

$ nix-build -A haskellPackages.polysemy-plugin --arg config '{allowBroken = true;}'
these derivations will be built:
  /nix/store/a9wnl65pksj4xli9z6mc9a3k4y38gifr-polysemy-plugin-0.2.5.0.drv
building '/nix/store/a9wnl65pksj4xli9z6mc9a3k4y38gifr-polysemy-plugin-0.2.5.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/dhnspmn5hc312lm46a98w4n1bz27bp40-ghc-8.8.3.
unpacking sources
unpacking source archive /nix/store/j8xpmj53gvxz1k7i04dqk0a9jq2565ng-polysemy-plugin-0.2.5.0.tar.gz
source root is polysemy-plugin-0.2.5.0
setting SOURCE_DATE_EPOCH to timestamp 1581682874 of file polysemy-plugin-0.2.5.0/test/VDQSpec.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/3i318ghbzmjh6jljhjd2jwq2rw6l572s-polysemy-plugin-0.2.5.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/75canmpmxy208kqyqgvl68diqy96lskr-polysemy-plugin-0.2.5.0-doc/share/doc/polysemy-plugin-0.2.5.0 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/49x12wk4l8c0lh97crvwhjbzfxrq1fa2-ncurses-6.2/lib --extra-lib-dirs=/nix/store/hfs34n1yww7ba1m8gbrwrwh6v1y269m6-libffi-3.3/lib --extra-lib-dirs=/nix/store/l9nfr0znv7qibrapym32qj7dxmynfh84-gmp-6.2.0/lib --extra-lib-dirs=/nix/store/dhnspmn5hc312lm46a98w4n1bz27bp40-ghc-8.8.3/lib
Using Parsec parser
Configuring polysemy-plugin-0.2.5.0...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1022:20 in Cabal-3.0.1.0:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:475:12 in Cabal-3.0.1.0:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.0.1.0:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.0.1.0:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:125:42 in Cabal-3.0.1.0:Distribution.Simple
  defaultMainWithHooks, called at src/Distribution/Extra/Doctest.hs:170:27 in cabal-doctest-1.0.8-2wQRz9ec1yB5lMDRmEgBWB:Distribution.Extra.Doctest
Setup: Encountered missing or private dependencies:
polysemy >=1.3.0.0

builder for '/nix/store/a9wnl65pksj4xli9z6mc9a3k4y38gifr-polysemy-plugin-0.2.5.0.drv' failed with exit code 1

It looks like you'll also have to update the version of polysemy that polysemy-plugin is using?

Again, if you want to get polysemy-plugin into stackage, you generally won't have to fix these types of error in nixpkgs in the future.

It needs an older version of ghc-tcplugins-extra.
@mikesperber
Copy link
Contributor Author

Argl, I had polysemy = super.polysemy_1_3_0_0 sitting somewhere else.

Patch updated.

I am sorry I'm such a klutz about this. Next time will be better hopefully.

@cdepillabout
Copy link
Member

Looks good. Thanks for working through this with me!

@cdepillabout cdepillabout merged commit 67cef2d into NixOS:haskell-updates Mar 31, 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