Skip to content

Conversation

@hamishmack
Copy link
Collaborator

@hamishmack hamishmack commented Jul 24, 2025

Updates to nixpkgs-2511 and latest haskell.nix.

Changes:

  • Update nixpkgs from 2505 to 2511
  • Update haskell.nix to latest (2025-12-09)
  • Fix head.hackage repository hash in tool-map.nix
  • Re-enable macOS and Linux platforms in workflow

@angerman
Copy link
Collaborator

This superceeds #222

Switch from nixpkgs-2505 to nixpkgs-2511, updating haskell.nix
and all related inputs to their latest versions.
The JS backend builds fail due to a hash mismatch in the
head.hackage.ghc.haskell.org fixed-output derivation in haskell.nix:
  specified: sha256-5gKLigkUTkkABGG8B9zNq8NKRIHv97K9No4kTLK/GyQ=
  got:       sha256-AO/vHIMSIBwjbp5GY561SmnPr5qTTyBt9ruy8D3lKZI=

This filters out all *-js-* shells from hydraJobs while keeping them
available in devShells for local development.

TODO: Remove this filter once upstream haskell.nix fixes the hash.
@angerman angerman changed the title Update haskell.nix and use nixpkgs-2505 Update haskell.nix and use nixpkgs-2511 Dec 10, 2025
Both JS and Windows cross-compilation builds use head.hackage which
has a stale hash in the current haskell.nix. Filter both from
hydraJobs until upstream fixes the issue.
Update the head.hackage repository hash in tool-map.nix to the
current value. This fixes the JS and Windows cross-compilation
builds that were failing due to hash mismatch.

Remove the temporary filter that excluded JS/Windows builds from
hydraJobs since the root cause is now fixed.
The -env jobs previously used recursive-nix to run `nix print-dev-env`
inside a derivation, but this fails on remote builders with:
  "recursive-nix is not supported yet by external derivation builders"

This commit replaces that approach with Import From Derivation (IFD):
- Read the mkShell output directly at evaluation time via builtins.readFile
- Filter out the self-referencing $out variable to break circular deps
- Embed the environment content directly in the wrapper script

The mkShell output already contains "declare -x VAR=value" lines which
is exactly what's needed. This approach:
- Avoids the recursive-nix requirement entirely
- Still includes all runtime dependencies (GHC, cabal, tools, etc.)
- Works on remote builders without special configuration
The previous IFD approach forced cross-platform builds during evaluation,
which could cause issues when Hydra evaluates on x86_64-linux but needs
to evaluate aarch64-darwin shells.

This new approach reads the mkShell output at build time using cat,
avoiding both:
- IFD which forces builds during evaluation
- recursive-nix which is not supported on remote builders

The shell is now a normal build dependency, and its output (containing
"declare -x VAR=value" lines) is read at build time to construct the
wrapper script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants