Skip to content

haskell: export build flags as a shell variable#463887

Merged
wolfgangwalther merged 1 commit intoNixOS:haskell-updatesfrom
lf-:jade/push-ytlqkrmwkvtq
Dec 26, 2025
Merged

haskell: export build flags as a shell variable#463887
wolfgangwalther merged 1 commit intoNixOS:haskell-updatesfrom
lf-:jade/push-ytlqkrmwkvtq

Conversation

@lf-
Copy link
Member

@lf- lf- commented Nov 22, 2025

This is useful so that you can call Setup build on other targets e.g. for code generation while still having the same flags.

The context that led me to write this patch is that we have HIE file generation in an overlay at work and I was packaging Glean, which requires a code gen component get built, and it was building twice due to the hie flags not getting propagated to the Setup build commands I was running manually. I had to do some silliness with old.buildFlags in nix language rather than just using a shell variable, which seemed a little silly.

I've sent off a build up to haskellPackages.aeson to confirm this isn't blatantly broken.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

This is useful so that you can call `Setup build` on other targets e.g.
for code generation while still having the same flags.

The context that led me to write this patch is that we have HIE file
generation in an overlay at work and I was packaging Glean, which
requires a code gen component get built, and it was building twice due
to the hie flags not getting propagated to the Setup build commands I
was running manually.
@lf- lf- requested a review from maralorn November 22, 2025 00:21
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: haskell General-purpose, statically typed, purely functional programming language labels Nov 22, 2025
@wolfgangwalther
Copy link
Contributor

Let's target haskell-updates with that, so we get a bit more visibility when we decide to merge it.

@lf- lf- changed the base branch from staging to haskell-updates December 12, 2025 03:32
@nixpkgs-ci nixpkgs-ci bot closed this Dec 12, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Dec 12, 2025
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

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

Diff LGTM.

We currently don't have a big rebuild on haskell-updates, yet, so we should wait with merging until we do.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Dec 17, 2025
@wolfgangwalther wolfgangwalther added this pull request to the merge queue Dec 26, 2025
Merged via the queue into NixOS:haskell-updates with commit 916a35c Dec 26, 2025
80 of 86 checks passed
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: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants