Cabal patches fail to apply to 3.10.3
Benjamin-McRae-Tracsis opened this issue · 2 comments
Describe the bug
In our company's build system we use haskell.nix. When trying to use nix build
after updating our resolver to resolver: nightly-2024-06-03
, the build command fails when trying to apply the patch. I believe we use stack2cabal
to generate the relevant cabal and cabal freeze files.
It looks to be an identical failure to #2174. I've had a look at the changes to that PR and I can't see anything relevant to fixing this.
- Build system:
x86_64-linux
- GHC version: GHC 9.8.2
- Haskell.nix version (or commit) used:
"rev": "338ba9a7eb9f3cdae4cf4d996d3bb354ed3e54d5",
Pinning the Cabal version in our packages (with - Cabal-3.10.2.0
) results in a succesful build.
Here is an example log:
$ nix log /nix/store/5anrbb3d7rjby4mhhp2qgnqvczsvysqk-Cabal-lib-Cabal-3.10.3.0.drv^*
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/xy13x97igjlis6hmil6c170zdprj58y4-Cabal-3.10.3.0.tar.gz
source root is Cabal-3.10.3.0
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file Cabal-3.10.3.0/src/Distribution/ZinzaPrelude.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/mxjxws8k94ki70wi59dakcnxmwqy1z0h-Cabal-3.6.0.0-drop-pkg-db-check.diff
patching file src/Distribution/Simple/GHCJS.hs
Hunk #1 succeeded at 255 (offset -1 lines).
Hunk #2 succeeded at 730 (offset -1 lines).
applying patch /nix/store/yianjwpnddf1lx3v1f0xlv47829ybkll-Cabal-3.6.0.0-no-final-checks.diff
patching file src/Distribution/Simple.hs
Hunk #1 succeeded at 552 (offset -71 lines).
Hunk #2 succeeded at 565 (offset -72 lines).
applying patch /nix/store/63r3qkxch0wkc6fzgk28jnvpxq4l5x05-9220.patch
patching file src/Distribution/Simple/Configure.hs
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file src/Distribution/Simple/Configure.hs.rej
patching file src/Distribution/Simple/Setup.hs
This is the patch that is being applied I think: https://github.com/input-output-hk/haskell.nix/blob/3af53828dfcf7117e1ee385a583a916fe4d72253/overlays/patches/Cabal/9220.patch
Expected behavior
A patch which cannot be applied is not applied, and the build succeeds.
Additional context
I'm not knowledgeable about nix, but I'm happy to acquiesce to poking around and gathering more information if directed.
What version of haskell.nix?
This issue should have been fixed be8337e#diff-95d1c2abe48a35296ef2512178831f8f6a1abd1c8953023b147eb0c01dcd6986R47
I'm sorry to have wasted your time, looks like we were using a fork of haskell.nix that was behind; the fork only added 9.8 (which you now have support for) and adds -f
to the hpack calls (which we may not need), so we've switched over to iohk's haskell.nix and things are working relatively smoothly again.
Thank you for your time.