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

haskellPackages: update hackage #339272

Open
wants to merge 71 commits into
base: master
Choose a base branch
from
Open

haskellPackages: update hackage #339272

wants to merge 71 commits into from

Conversation

sternenseemann
Copy link
Member

This Merge

This PR is the regular merge of the haskell-updates branch into master.

This branch is being continually built and tested by hydra at https://hydra.nixos.org/jobset/nixpkgs/haskell-updates. You may be able to find an up-to-date Hydra build report at cdepillabout/nix-haskell-updates-status.

We roughly aim to merge these haskell-updates PRs at least once every two weeks. See the @NixOS/haskell team calendar for who is currently in charge of this branch.

haskellPackages Workflow Summary

Our workflow is currently described in pkgs/development/haskell-modules/HACKING.md.

The short version is this:

  • We regularly update the Stackage and Hackage pins on haskell-updates (normally at the beginning of a merge window).
  • The community fixes builds of Haskell packages on that branch.
  • We aim at at least one merge of haskell-updates into master every two weeks.
  • We only do the merge if the mergeable job is succeeding on hydra.
  • If a maintained package is still broken at the time of merge, we will only merge if the maintainer has been pinged 7 days in advance. (If you care about a Haskell package, become a maintainer!)

More information about Haskell packages in nixpkgs can be found in the nixpkgs manual.


This is the follow-up to #335932. Come to #haskell:nixos.org if you have any questions.

No new version of stackage at this time (2024-09-03)!

This commit has been generated by maintainers/scripts/haskell/update-hackage.sh
and maintainers/scripts/haskell/regenerate-hackage-packages.sh.
marcin-serwin and others added 8 commits September 3, 2024 19:47
fixed auto-update, http2, network-control, network-run and time-manager
by choosing different version.
fixed dejafu and tasty-coverage by jailbreaking.
fixed bsb-http-chunked, hinotify and warp by disabling test suite.
This commit has been generated by maintainers/scripts/haskell/regenerate-hackage-packages.sh
@collinarnett
Copy link

One thing I noticed with one of the new packages tiktoken is that it requires base64_1_0 instead of base64. Not sure how to contribute but I thought I would give a heads up while I'm testing using it before this pr gets merged.

@maralorn
Copy link
Member

maralorn commented Sep 7, 2024

@collinarnett are you sure this is not fixable by using doJailbreak? (you can Ctrl+F this in the nixpkgs manual or in our configuration-common.nix file in nixpkgs.) The first release of tiktoken is 7 months after the release of base64, so I assume they just never tried to compile it with an earlier version.

@collinarnett
Copy link

collinarnett commented Sep 7, 2024

I just tried it with doJailbreak and it breaks.

[1/0/4 built, 0.0 MiB DL] building tiktoken-1.0.3direnv: ([/nix/store/1mrvvx2ygfyfz8sn3gg5f3qidvd9s8j1-direnv-2.34.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
error: builder for '/nix/store/mk0j2969fp6rsszzi4vfqxmqkbsqi9gx-tiktoken-1.0.3.drv' failed with exit code 1;
       last 25 log lines:
       > No pkg-config found
       > Using runghc version 9.6.5 found on system at:
       > /nix/store/hzdv2lb4sr83cbnx4c3fi6idpimvwab7-ghc-9.6.5/bin/runghc-9.6.5
       > Using strip version 2.41 found on system at:
       > /nix/store/md6hh4rrcrf99nssvcam3qaqs3skj086-gcc-wrapper-13.2.0/bin/strip
       > Using tar found on system at:
       > /nix/store/4m4vnjdy44s4sb8hlv4qsph492zz3rly-gnutar-1.35/bin/tar
       > No uhc found
       > Running phase: buildPhase
       > Preprocessing library for tiktoken-1.0.3..
       > Building library for tiktoken-1.0.3..
       > [1 of 2] Compiling Paths_tiktoken   ( dist/build/autogen/Paths_tiktoken.hs, dist/build/Paths_tiktoken.o, dist/build/Paths_tiktoken.dyn_o )
       > [2 of 2] Compiling Tiktoken         ( src/Tiktoken.hs, dist/build/Tiktoken.o, dist/build/Tiktoken.dyn_o )
       >
       > src/Tiktoken.hs:109:19: error: [GHC-76037]
       >     Not in scope: ‘Base64.Encoding.decodeBase64Untyped’
       >     NB: the module ‘Data.ByteString.Base64’ does not export ‘decodeBase64Untyped’.
       >     Suggested fix:
       >       Perhaps use one of these:
       >         ‘Base64.Encoding.decodeBase64’ (imported from Data.ByteString.Base64),
       >         ‘Base64.Encoding.decodeBase64Lenient’ (imported from Data.ByteString.Base64),
       >         ‘Base64.Encoding.encodeBase64’ (imported from Data.ByteString.Base64)
       >     |
       > 109 |     token <- case Base64.Encoding.decodeBase64Untyped base64Bytes of
       >     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       For full logs, run 'nix log /nix/store/mk0j2969fp6rsszzi4vfqxmqkbsqi9gx-tiktoken-1.0.3.drv'.
error: 1 dependencies of derivation '/nix/store/iild3js51yv77mp29rk2zmdrklai7akw-ghc-9.6.5-with-packages.drv' failed to build
error: 1 dependencies of derivation '/nix/store/r21kjqdmf6cg91pcz07008zrlaab4jpl-ghc-shell-for-packages-0-env.drv' failed to build

In the repo's flake they explicitly override base64 to version 1.0 as well here. https://github.com/Gabriella439/tiktoken/blob/2e66d1e29acf66f08959f86080d53b07bccb5ae4/flake.nix#L18C1-L22C23

@maralorn
Copy link
Member

maralorn commented Sep 7, 2024

Thank you. If you want you can open a PR which does this override in configuration-common.nix with a comment explaining that at least base64 1.0 is required, but LTS 22 contains an older version. Then you can drop tiktoken from a file called broken.yaml and run maintainers/scripts/haskell/regenerate-hackage-packages.sh.

maralorn and others added 5 commits September 7, 2024 22:44
This is easy in comparison since these tools won't end up in GHC's
settings nor need to be available at runtime, so we can use
the *_FOR_BUILD environment variables.

It is important to add buildCC to depsBuildBuild to engage the
stdenv/wrapper script machinery properly.

Co-authored-by: sternenseemann <[email protected]>
1. Explicitly set WITH_TERMINFO. We usually match GHC's behavior well,
   but it is better to tie the Nix option to make explicitly.
   Unfortunately, the same is very complicated to achieve with
   hadrian (iirc).
2. Disable enableTerminfo if we are cross-compiling. This matches
   the behavior of GHC's build system, so we'll have to match it now.
   It also reduces the ncurses-related headache a bit.
3. Stop passing --with-curses* flags. Unfortunately, GHC does not
   account for the fact that different platforms need different ncurses
   libraries. This is somewhat migitated by the fact that ncurses is
   only ever needed for the build platform if we are cross compiling,
   but I seem to remember it leaking into the final GHC somehow.
   A more reliable alternative is relying on the cc/ld wrapper scripts,
   as they'll always pull out the correct ncurses out of the environment
   when GHC's build system passes -lcurses.
4. Unconditionally add ncurses to depsBuildBuild. Stage0 unconditionally
   builds terminfo (maybe the stage1 compiler needs it?), so we need to
   make sure that ncurses for the build platform is available.

Co-authored-by: sternenseemann <[email protected]>
github-actions bot and others added 4 commits September 19, 2024 00:15
We reuse the targetLibs logic for this since it is more or less the same
story. However, the terminfo library is only built when GHC is neither a
cross-compiler nor being cross-compiled. Therefore ncurses (if used)
will only ever come from pkgsHostTarget. In the other cases ncurses is
still passed via depsBuildBuild for the stage1 compiler.

This commit tries to resolve the problem that the package-db doesn't
include library and include dirs of ncurses for the terminfo package,
causing library loading and linking problems in downstream packages,
e.g. dhall-docs and dhall-toml. This problem was introduced in
4b00fbf. With this in mind, not passing
--with-curses-* – as long as the terminfo package isn't built – seems
fine.
That's a bit cleaner and more robust in case this will be backported to
9.6.7 (should it happen).
@sternenseemann
Copy link
Member Author

sternenseemann commented Sep 19, 2024

pkgsCross.riscv64.haskell.compiler.ghc8107 has apparently regressed… that's what you get for not adding the job right away…

FTR this is the failure:

"inplace/bin/hsc2hs" '--cc=gcc' '--ld=gcc'  --cross-safe -I/nix/store/gq9dvrlkhl9j13g68grbx51zfk11ilcy-gmp-with-cxx-riscv64-unknown-linux-gnu-6.3.0-dev/include --cflag=-Wall   --cflag=-Dx86_64_HOST_ARCH --cflag=-Dlinux_HOST_OS --cflag=-D__GLASGOW_HASKELL__=810 '--cflag=-Wall' '--cflag=-Ilibraries/ghci/dist-boot/build/./autogen' '--cflag=-I/nix/store/zaj9airx5rb5sg2kpcv9gdf7j7libiml-libffi-riscv64-unknown-linux-gnu-3.3-dev/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/unix-2.7.2.2/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/unix-2.7.2.2/dist-install/build/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/time-1.9.3/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/time-1.9.3/dist-install/build/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/bytestring-0.10.12.0/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/bytestring-0.10.12.0/dist-install/build/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/base-4.14.3.0/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/base-4.14.3.0/dist-install/build/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/dist-install/build/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/include' '--cflag=-I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/dist-install/build/include' '--cflag=-Werror=unused-but-set-variable' '--cflag=-Wno-error=inline'  --cflag=-Ilibraries/ghci/dist-boot/build/./autogen --cflag=-include --cflag=libraries/ghci/dist-boot/build/./autogen/cabal_macros.h   libraries/ghci/./GHCi/InfoTable.hsc -o libraries/ghci/dist-boot/build/GHCi/InfoTable.hs
compiling libraries/ghci/dist-boot/build/GHCi/FFI_hsc_make.c failed (exit code 1)
rsp file was: "libraries/ghci/dist-boot/build/GHCi/hsc2hscall9864-0.rsp"
command was: gcc -c libraries/ghci/dist-boot/build/GHCi/FFI_hsc_make.c -o libraries/ghci/dist-boot/build/GHCi/FFI_hsc_make.o -I/nix/store/gq9dvrlkhl9j13g68grbx51zfk11ilcy-gmp-with-cxx-riscv64-unknown-linux-gnu-6.3.0-dev/include -Wall -Dx86_64_HOST_ARCH -Dlinux_HOST_OS -D__GLASGOW_HASKELL__=810 -Wall -Ilibraries/ghci/dist-boot/build/./autogen -I/nix/store/zaj9airx5rb5sg2kpcv9gdf7j7libiml-libffi-riscv64-unknown-linux-gnu-3.3-dev/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/unix-2.7.2.2/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/unix-2.7.2.2/dist-install/build/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/time-1.9.3/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/time-1.9.3/dist-install/build/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/bytestring-0.10.12.0/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/bytestring-0.10.12.0/dist-install/build/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/base-4.14.3.0/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/base-4.14.3.0/dist-install/build/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/dist-install/build/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/include -I/nix/store/rlad69w7gmlprvj8i4bbhmrn25jd67qs-ghc-binary-8.10.7/lib/ghc-8.10.7/dist-install/build/include -Werror=unused-but-set-variable -Wno-error=inline -Ilibraries/ghci/dist-boot/build/./autogen -include libraries/ghci/dist-boot/build/./autogen/cabal_macros.h -I/build/ghc-8.10.7/inplace/lib/include/
error: In file included from /nix/store/zaj9airx5rb5sg2kpcv9gdf7j7libiml-libffi-riscv64-unknown-linux-gnu-3.3-dev/include/ffi.h:58,
                 from FFI.hsc:9:
/nix/store/zaj9airx5rb5sg2kpcv9gdf7j7libiml-libffi-riscv64-unknown-linux-gnu-3.3-dev/include/ffitarget.h:36:2: error: #error "libffi was configured for a RISC-V target but this does not appear to be a RISC-V compiler."
   36 | #error "libffi was configured for a RISC-V target but this does not appear to be a RISC-V compiler."
      |  ^~~~~

compiler/ghc.mk:307: compiler/stage1/build/.depend-v.haskell: No such file or directory
make[1]: *** [libraries/ghci/ghc.mk:3: libraries/ghci/dist-boot/build/GHCi/FFI.hs] Error 1

This doesn't seem to have worked in the last weeks at all which makes me think this could be related to the downgrade of libffi from 3.4 -> 3.3 for GHC 8.10.7. Will need to try and confirm that.

sternenseemann added a commit to AlexandreTunstall/nixpkgs that referenced this pull request Sep 19, 2024
In NixOS#339272, an elusive regression was found where the stage 2 binaries
held a reference to the boot compiler in their rpath. This issue only
affected GHC 9.6 versions built on aarch64-linux.

For still unknown reason, this issue goes away when using a source built
GHC instead of the binary GHC we derive from upstream's bindists.
Knowing more would be great, obviously, but at least this issue goes
away with GHC 9.8.*…

Co-authored-by: sternenseemann <[email protected]>
In #339272, an elusive regression was found where the stage 2 binaries
held a reference to the boot compiler in their rpath. This issue only
affected GHC 9.6 versions built on aarch64-linux.

For still unknown reason, this issue goes away when using a source built
GHC instead of the binary GHC we derive from upstream's bindists.
Knowing more would be great, obviously, but at least this issue goes
away with GHC 9.8.*…

Co-authored-by: sternenseemann <[email protected]>
This is a safeguard against a problem we had with 9.6. Unfortunately,
since the cc wrapper emits `-L` and `-rpath` flags based on platform
config (e.g. aarch64-unknown-linux), not platform role (e.g. build),
stdenv itself doesn't prevent ghc from being linked against the boot
compiler when building a native or cross-compiling GHC (since host ==
build).

With disallowedReferences, the build will fail if such a problem is
re-introduced.
perl is only needed in some situations as a build time dependency to run
build scripts. The final GHC doesn't require perl.
The stage0 ghc is build->build since it builds the stage1 compiler which
has build for its host platform (i.e. is build->target relative to the
entire GHC derivation).

Also annotate a bit more around the use of pkgsBuildBuild and the boot
compiler and make it more explicit where it comes from in the
derivation.
@sternenseemann sternenseemann linked an issue Sep 20, 2024 that may be closed by this pull request
1 task
@sternenseemann
Copy link
Member Author

GHC 8.10.7 on aarch64-linux has a similar issue to GHC 9.6 used to have: It retains a reference on the stage0 compiler.

@sternenseemann
Copy link
Member Author

9.10.1 failures we see sometimes are due to: https://gitlab.haskell.org/ghc/ghc/-/issues/25153

sternenseemann and others added 4 commits September 23, 2024 18:44
Some GHC bindists have a normal `$out/lib` directory which contains
symlinks to all core libs. Because it is a normal lib directory, the
bintools setup hook will pick up on it and cause ld to pass the
appropriate -L and -rpath flags. We do not want this to happen,
especially in the case of the stage2 compiler. Not only will the final
ghc have an unnecessary reference (and thus increased closure size) to
the binary ghc, but the extra libraries in the rpath mess with the rts
and cause e.g. segfaults in GHCi.

Unfortunately, there is no way to prevent this. It is a fundamental flaw
in the cc and bintools wrappers that they do not actually distinguish
between the roles of dependencies (build, host, target). Instead
the mangleVar* function will translate the dependencies split up by
roles into platforms. This means that the wrappers can't distinguish
between depsBuildBuild and depsHostTarget (== buildInputs) when natively
compiling. As long as we are natively compiling the wrappers will put
the stage0 ghc (be it in depsBuildBuild, nativeBuildInputs etc.) into
the linker flags of the final ghc.

The solution is to sidestep the issue. We just had ghc in depsBuildBuild
to have it added to PATH. GHC itself will pass the appropriate linker
flags if necessary. To avoid the setup hooks picking up on the GHC
libraries we just don't put it into depsBuildBuild or any other
dependency list. Since the GHC build system accepts the GHC binary via
an absolute path, we don't even need to add the stage0 GHC to PATH.
This seems to be a build time only dependency as there is no
corresponding settings entry.
Ideally we don't want to use bintools.bintools and also not really
encode knowledge of what is wrapped and what not in our GHC derivation.
Unfortunately, not all tools are part of the wrapper derivation as well.
This should be gradually improved (e.g. in the case of the darwin tools
and strip).
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.

Update request: haskellPackages.xmonad-contrib 0.18.0 → 0.18.1
9 participants