Skip to content

haskell.packages.ghc94.{or,four}molu: Disable fixity-th flag#201692

Merged
maralorn merged 1 commit intoNixOS:haskell-updatesfrom
MercuryTechnologies:gabriella/fix_ormolu_ghc9.4
Nov 18, 2022
Merged

haskell.packages.ghc94.{or,four}molu: Disable fixity-th flag#201692
maralorn merged 1 commit intoNixOS:haskell-updatesfrom
MercuryTechnologies:gabriella/fix_ormolu_ghc9.4

Conversation

@Gabriella439
Copy link
Contributor

Context: tweag/ormolu#941

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Note that the actual builds I tested were internal ones that had additional fixes not yet upstreamed into nixpkgs. This is just one of a few fixes we still need to upstream.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Nov 17, 2022
@Gabriella439 Gabriella439 force-pushed the gabriella/fix_ormolu_ghc9.4 branch from 44c3c17 to 524ddeb Compare November 17, 2022 22:52
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 17, 2022
@cdepillabout cdepillabout marked this pull request as draft November 18, 2022 04:48
@cdepillabout cdepillabout changed the base branch from master to haskell-updates November 18, 2022 04:48
@cdepillabout cdepillabout marked this pull request as ready for review November 18, 2022 04:48
@cdepillabout
Copy link
Member

cdepillabout commented Nov 18, 2022

This makes sense to me, lets see if ofborg likes it:

@ofborg build haskell.packages.ghc94.ormolu haskell.packages.ghc94.fourmolu

Also, we generally ask that Haskell-related PRs come into the haskell-updates branch, which is why I changed the base branch.

(Although in this particular instance, I'm not sure if the current haskell-updates branch will be merged in before branch-off. If you're hoping this fix will be included in 22.11, maybe you could send a backport to release-22.11 after branch-off?)

edit: ofborg is failing because the underlying haskell-updates branch needs to be fixed for libs like ghc-lib-parser. Let me try to do that now.

@cdepillabout
Copy link
Member

I fixed the problem on haskell-updates that was causing ofborg to fail to evaluate in 84b4f55 and da038b4.

I then cherry-picked the commit from this PR onto haskell-updates (which is currently #200740) and tried building ormolu and fourmolu, but ormolu failed to build:

$ nix-build -A haskell.packages.ghc94.ormolu
this derivation will be built:
  /nix/store/37gzsldi1rvwm84yqkcdgmb8hm0s4pb1-ormolu-0.3.1.0.drv
building '/nix/store/37gzsldi1rvwm84yqkcdgmb8hm0s4pb1-ormolu-0.3.1.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/l135f94dksp8fwy415s932dxxsalv58q-ghc-9.4.2.
unpacking sources
unpacking source archive /nix/store/s8bc9jssxiirp0ymp02maf12g9fq7k6h-ormolu-0.3.1.0.tar.gz
source root is ormolu-0.3.1.0
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file ormolu-0.3.1.0/tests/Spec.hs
patching sources
Replace Cabal file with edited version from mirror://hackage/ormolu-0.3.1.0/revision/1.cabal.
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/tmp.pWURfhkERR/setup-package.conf.d -j8 +RTS -A64M -RTS -threaded -rtsopts
[1 of 2] Compiling Main             ( Setup.hs, /build/tmp.pWURfhkERR/Main.o )
[2 of 2] Linking Setup
configuring
configureFlags: --verbose --prefix=/nix/store/qcnqqs34x8xqq14cp6bfm4l567cad8wv-ormolu-0.3.1.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/l7mxhg2mzqnd96ai6g0x0prpf33a5ahr-ormolu-0.3.1.0-doc/share/doc/ormolu-0.3.1.0 --with-gcc=gcc --package-db=/build/tmp.pWURfhkERR/package.conf.d --ghc-options=-j8 +RTS -A64M -RTS --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 --bindir=/nix/store/apnr3wgcv78fdzcjqh4f6l16wwqa5fgp-ormolu-0.3.1.0-bin/bin --ghc-options=-haddock -f-fixity-th --extra-lib-dirs=/nix/store/1i5ah27gxx3a3fyjyydfwwzqq8ni33i8-ncurses-6.3-p20220507/lib --extra-lib-dirs=/nix/store/xghl0l2f6byzqvy06ana2y4isqwa7blw-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/ijz81p08bp812q2bvv77lz9qpfzncibd-gmp-with-cxx-6.2.1/lib --extra-lib-dirs=/nix/store/l135f94dksp8fwy415s932dxxsalv58q-ghc-9.4.2/lib
Using Parsec parser
Configuring ormolu-0.3.1.0...
CallStack (from HasCallStack):
  withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
Error: Setup: Encountered missing or private dependencies:
Cabal >=3.4 && <3.5,
ghc-lib-parser >=9.0 && <9.1,
text >=0.2 && <1.3

error: builder for '/nix/store/37gzsldi1rvwm84yqkcdgmb8hm0s4pb1-ormolu-0.3.1.0.drv' failed with exit code 1

fourmolu built fine.

I'm happy with merging this in, but just want to make sure that the intent of this PR wasn't that both ghc94 fourmolu and ormolu build. I'm guessing this is true from

Note that the actual builds I tested were internal ones that had additional fixes not yet upstreamed into nixpkgs. This is just one of a few fixes we still need to upstream.

but just wanted to make sure.

@maralorn
Copy link
Member

Looks good, thank you.

@maralorn maralorn merged commit 88fef9d into NixOS:haskell-updates Nov 18, 2022
@Gabriella439
Copy link
Contributor Author

@cdepillabout: Yeah, this change alone is not enough to fix the build for fourmolu/ormolu

@Gabriella439 Gabriella439 deleted the gabriella/fix_ormolu_ghc9.4 branch November 18, 2022 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants