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 tests #71967
polysemy-plugin: fix tests #71967
Conversation
Now I've done a couple of things that might be frowned upon, I would love some help with these:
No longer broken:
Still broken:
|
# The polysemy-plugin tests failed because it couldn't find | ||
# the polysemy-plugin package in the doctests: | ||
# https://github.com/NixOS/nixpkgs/issues/71164 | ||
# I've addressed this with a PR upstream: | ||
# https://github.com/polysemy-research/polysemy/pull/265 | ||
# The patch of which is applied here. | ||
polysemy-plugin = appendPatch super.polysemy-plugin ./patches/polysemy-plugin.patch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, we don't like to carry around packages in the nixpkgs repo.
Also, it is generally easier for us to just disable the tests with dontCheck
instead of trying to patch them.
Please change this to the dontCheck
approach (or you could wait until polysemy-research/polysemy#265 is merged and a new release is made).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is generally easier for us to just disable the tests with dontCheck instead of trying to patch them.
That is true, we hardly ever patch test suites simply because that tends to be more effort than just disabling them. There is one argument to favor of patching over disabling, though: When a new version of the package comes out that incorporates the fixes, our patch will fail to apply -- which means that someone notices that the corresponding override can be deleted. That is not true for dontCheck
; those overrides won't fail when a new version comes out and therefore we usually don't remove them even though the override has become obsolete.
@@ -185893,7 +185894,7 @@ self: { | |||
base containers doctest ghc ghc-tcplugins-extra hspec | |||
inspection-testing polysemy should-not-typecheck syb transformers | |||
]; | |||
testToolDepends = [ hspec-discover ]; | |||
testToolDepends = [ hspec-discover cabal-doctest ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct that this file is autogenerated, so it shouldn't be edited by hand.
Above I suggest just using dontCheck
for polysemy-plugin, but in case you're curious, you can grep through pkgs/development/haskell-modules/configuration-common.nix
to see how people add test tools.
One solution is to use the addBuildTool
function. The other solution is to use overrideCabal
and explicitly set testToolDepends
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cabal-doctest
should probably go into setupHaskellDepends
since it's a part of the Setup.hs
build. This means that this dependency will be required regardless of whether testing is enabled or disabled.
@sevanspowell Thanks for taking the time to update this! There are a couple things above you'll need to change before this can be merged. Also, polysemy-plugin is marked broken, so you'll have to remove this line as well (otherwise it won't get unmarked broken next time the Haskell package set is regenerated):
|
The problem appears to be that the patch containts another directory hierarchy "polysemy-plugin/" that does not exist, obviously, in the checked-out Hackage tarball. There's multiple ways of fixing that, but the easiest one is probably to post-process the patch with
Check out
See the |
@peti Thanks for the suggestions here! |
Thank you @peti amd @cdepillabout. That’s super helpful! I’ll make these changes soon. |
RE: using fetchpatch. That's so annoying! fetchpatch was the first tool I reached for and I figured a "stripLen" value of 1 should work. The patch failed to apply though. So I tried a couple of other values then reviewed the fetchpatch source code. I even resorted to trying to It's very possible I was just pulling the wrong patch from github, I'm unsure at this point. Thanks for being so helpful @peti, your suggestion worked just fine. |
- polysemy-plugin was broken due to failing doctests: NixOS#71164. - I submitted a PR upstream to fix this: polysemy-research/polysemy#265. - I've applied the patch of the PR here and moved the default "polysemy" attribute to "polysemy_1_2_0_0" because polysemy-plugin requires "polysemy >= 1.2.0.0". - Move default "polysemy-zoo" attribute to "polysemy-zoo_0_6_0_1" because it is fixed by the polysemy-plugin changes and fixes issues with building "polysemy-RandomFu" and "knit-haskell". - Removed packages no longer broken from "configuration-hackage2nix.yaml". - Add cabal-doctest to setupDepends of polysemy-plugin.
0e3f87e
to
94455d0
Compare
@GrahamcOfBorg build haskellPackages.axel haskellPackages.knit-haskell haskellPackages.polysemy-plugin haskellPackages.polysemy-RandomFu haskellPackages.polysemy-zoo |
I think we're pretty much ready to go. @peti, I've followed your video on regenerating the haskell package-set for Nix and used it to mark these now fixed packages as unbroken in hackage-packages.nix. What's the typical workflow for a PR? Do we mark the packages as unbroken in configuration-hackage2nix.yaml and leave it at that, or do we submit a "hackage-packages.nix: automatic Haskell package set update" commit as part of the PR? |
I'd prefer if you'd just push the change to configuration-hackage2nix.yaml. The automatic generator will push the update to hackage-packages.nix soon afterwards.
|
Motivation for this change
polysemy-plugin is broken due to failing tests.
Things done
polysemy-plugin: Make plugin available to doctest #71164.
Use cabal-doctest polysemy-research/polysemy#265.
attribute to "polysemy_1_2_0_0" because polysemy-plugin requires
"polysemy >= 1.2.0.0".
because it is fixed by the polysemy-plugin changes and fixes issues
with building "polysemy-RandomFu" and "knit-haskell".
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
Notify maintainers
cc @peti