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

darcs: compile with ghc 8.8 #84573

Merged
merged 1 commit into from Apr 18, 2020

Conversation

dguibert
Copy link
Member

@dguibert dguibert commented Apr 7, 2020

Motivation for this change
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.

Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

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

I left a few comments above.

Also, could you target the haskell-updates branch for this instead of master?

pkgs/development/haskell-modules/configuration-common.nix Outdated Show resolved Hide resolved
Comment on lines 51 to 55
# cabal 3.0 support
( pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/input-output-hk/haskell.nix/9f8a6e3e5755e4b917686c6267b1135caf724f1f/patches/darcs-setup.patch";
sha256 = "sha256-LJDc22EUHchm7hzVVs6LvG115T6OBAI8BdmsGK38GdE=";
})
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 little bit more about what this patch does (and why you're pulling it from haskell.nix and not the darcs upstream)?

Copy link
Member Author

@dguibert dguibert Apr 18, 2020

Choose a reason for hiding this comment

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

This patch comes from the differences between the 2.14.2 version and the master.

pkgs/development/haskell-modules/configuration-common.nix Outdated Show resolved Hide resolved
@dguibert
Copy link
Member Author

dguibert commented Apr 8, 2020

I left a few comments above.

Ok, I'll try to figure out how to deal with upstream repo and bug tracker...

Also, could you target the haskell-updates branch for this instead of master?

Yeah sure.

@nh2
Copy link
Contributor

nh2 commented Apr 17, 2020

This is pretty hard to understand what is going on. Is there any way to get a patch for this instead of using sed?

I've run the commands and produced this:

darcs-Compile-against-GHC-8.8.patch.txt

@dguibert dguibert changed the base branch from master to haskell-updates April 17, 2020 19:27
@dguibert
Copy link
Member Author

This is pretty hard to understand what is going on. Is there any way to get a patch for this instead of using sed?

I've run the commands and produced this:

darcs-Compile-against-GHC-8.8.patch.txt

Thanks. I took your patch and remove the changes in comments ;-)
I've also rebase this PR to haskell-updates.

Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

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

Could you rebase this again on top of haskell-updates? It looks like haskell-updates has advanced, and this PR has picked up some unnecessary commits.

pkgs/development/haskell-modules/configuration-common.nix Outdated Show resolved Hide resolved
@@ -45,6 +45,13 @@ self: super: {
# Needs older QuickCheck version
attoparsec-varword = dontCheck super.attoparsec-varword;

# http://bugs.darcs.net/issue2642
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for submitting this upstream. It looks like the author replied.

Maybe you should link the author to the patch from @nh2? It might be useful to the author as a starting point to start updating darcs in a backward-compatible way.

@dguibert
Copy link
Member Author

Hi, for some reason the patch does not apply during the build:

$ nix-build -A haskellPackages.darcs
these derivations will be built:
  /nix/store/6xv1ddbj7gw5i19cj8snnln23ar4v4vs-darcs-2.14.2.drv
building '/nix/store/6xv1ddbj7gw5i19cj8snnln23ar4v4vs-darcs-2.14.2.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/dflqgn35158dm3036k6a6ch3vymvq2w2-ghc-8.8.3.
unpacking sources
unpacking source archive /nix/store/1564cyp5ffgxph5vhsi5iph5vhsi5is6h058hkp7s-darcs-2.14.2.tar.gz
source root is darcs-2.14.2
setting SOURCE_DATE_EPOCH to timestamp 1548512091 of file darcs-2.14.2/tests/xmlschema.sh
patching sources
Replace Cabal file with edited version from mirror://hackage/darcs-2.14.2/revision/1.cabal.
applying patch /nix/store/kb47in7y970qsc2g6kszp327xvkiyv26-darcs-2.14.2-Compile-against-GHC-8.8.patch
patching file Setup.hs
patching file darcs.cabal
Hunk #1 FAILED at 112 (different line endings).
Hunk #2 FAILED at 380 (different line endings).
Hunk #3 FAILED at 401 (different line endings).
Hunk #4 FAILED at 442 (different line endings).
Hunk #5 FAILED at 499 (different line endings).
Hunk #6 FAILED at 517 (different line endings).
Hunk #7 FAILED at 526 (different line endings).
7 out of 7 hunks FAILED -- saving rejects to file darcs.cabal.rej
patching file src/Darcs/Patch/Depends.hs
patching file src/Darcs/Patch/Match.hs
patching file src/Darcs/Patch/PatchInfoAnd.hs
patching file src/Darcs/Patch/Prim/V1/Apply.hs
patching file src/Darcs/Patch/Prim/V1/Commute.hs
patching file src/Darcs/Repository/Diff.hs
patching file src/Darcs/Repository/Match.hs
patching file src/Darcs/Util/Tree/Monad.hs
builder for '/nix/store/6xv1ddbj7gw5i19cj8snnln23ar4v4vs-darcs-2.14.2.drv' failed with exit code 1
error: build of '/nix/store/6xv1ddbj7gw5i19cj8snnln23ar4v4vs-darcs-2.14.2.drv' failed

but outside, it applies cleanly:

$ tar xf /nix/store/1564cyp5ffgxph5vhsi5is6h058hkp7s-darcs-2.14.2.tar.gz
$ cd darcs-2.14.2
$ patch -p1 -i /nix/store/kb47in7y970qsc2g6kszp327xvkiyv26-darcs-2.14.2-Compile-against-GHC-8.8.patch
patching file Setup.hs
patching file darcs.cabal
patching file src/Darcs/Patch/Depends.hs
patching file src/Darcs/Patch/Match.hs
patching file src/Darcs/Patch/PatchInfoAnd.hs
patching file src/Darcs/Patch/Prim/V1/Apply.hs
patching file src/Darcs/Patch/Prim/V1/Commute.hs
patching file src/Darcs/Patch/ReadMonads.hs
patching file src/Darcs/Patch/V1/Commute.hs
patching file src/Darcs/Repository/Diff.hs
patching file src/Darcs/Repository/Match.hs
patching file src/Darcs/Util/Tree/Monad.hs

@dguibert
Copy link
Member Author

Hi, for some reason the patch does not apply during the build:

Ok, darcs.cabal is overriden during the build.
I'll submit an update

Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

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

Also, this looks like it is almost ready to go.

The only thing left is to remove darcs from the broken packages list in pkgs/development/haskell-modules/configuration-hackage2nix.yaml, since this PR fixes it.

@cdepillabout
Copy link
Member

@GrahamcOfBorg build darcs

@cdepillabout
Copy link
Member

This compiled on x86_64 linux, so it's already a positive direction.

If the OSX build happens to fail, then lets fix that up in a future PR.

Thanks for taking the time to fix this!

@cdepillabout cdepillabout merged commit ae1dd8b into NixOS:haskell-updates Apr 18, 2020
@dguibert dguibert deleted the dg/haskell-ghc88-darcs branch April 20, 2020 08:35
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

4 participants