Skip to content

compilers/ghc/common-hadrian: expand flags for structuredAttrs#472517

Closed
SFrijters wants to merge 1 commit intoNixOS:stagingfrom
SFrijters:ghc-hadrian-structuredattrs
Closed

compilers/ghc/common-hadrian: expand flags for structuredAttrs#472517
SFrijters wants to merge 1 commit intoNixOS:stagingfrom
SFrijters:ghc-hadrian-structuredattrs

Conversation

@SFrijters
Copy link
Member

@SFrijters SFrijters commented Dec 19, 2025

Otherwise we lose all flags apart from the first.

This results in a __structuredAttrs = true; build trying to find xelatex while it is not available.

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.

@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 Dec 19, 2025
@SFrijters SFrijters changed the base branch from master to staging December 19, 2025 21:39
@nixpkgs-ci nixpkgs-ci bot closed this Dec 19, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Dec 19, 2025
@sternenseemann
Copy link
Member

Commit message should probably read haskell.compiler: … or something if you mention hadrianFlags it should be clear enough what it refers to.

@SFrijters SFrijters force-pushed the ghc-hadrian-structuredattrs branch from eead43f to 68c9b2e Compare December 20, 2025 22:06
@SFrijters
Copy link
Member Author

I based the commit message prefix on a previous commit that touched the same file, but I've updated this one to something better.


# We need to go via the bindist for installing
hadrian $hadrianFlags "''${hadrianFlagsArray[@]}" binary-dist-dir
hadrian "''${hadrianFlags[@]}" "''${hadrianFlagsArray[@]}" binary-dist-dir
Copy link
Member

Choose a reason for hiding this comment

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

We need those to be space split.

Suggested change
hadrian "''${hadrianFlags[@]}" "''${hadrianFlagsArray[@]}" binary-dist-dir
hadrian ''${hadrianFlags[@]} "''${hadrianFlagsArray[@]}" binary-dist-dir

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, Stage1 still successfully starts building for __structuredAttrs.

Copy link
Contributor

Choose a reason for hiding this comment

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

One of the main selling points of structuredAttrs is the "native" support for spaces - so this change seems very much backwards to me.

Instead, we should add the quotes back and then enable __structuredAttrs = true for this file. This will give us the correct behavior consistently.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be my preferred solution also, but then I think we should also revisit #470435 for consistency, where setting __structuredAttrs = true was not welcomed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, we'll run into the same discussion for generic-builder.nix in haskell-modules.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would be my preferred solution also, but then I think we should also revisit #470435 for consistency, where setting __structuredAttrs = true was not welcomed.

The difference in that PR was, that the code would behave correctly both with and without structuredAttrs. The "consistent" pattern here is: Only add _structuredAttrs = true when it actually makes a difference. It does here, because we can't easily treat both cases. Ofc it's possible, but we'd have to add the same code as in many of the setup-hooks with concatTo etc. - but that'd be overkill for here, where we actually control the derivation. Thus, __structuredAttrs = true is the preferred solution here, from my perspective.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, we'll run into the same discussion for generic-builder.nix in haskell-modules.

We will, but since the builder is used for many more different packages, it might make sense to just implement it in a more robust way, that supports both cases, similar to the setup hooks I mentioned earlier.

@SFrijters SFrijters force-pushed the ghc-hadrian-structuredattrs branch from 68c9b2e to 2f79de9 Compare December 20, 2025 22:57
@SFrijters
Copy link
Member Author

To be replaced by #475546 .

@SFrijters SFrijters closed this Jan 19, 2026
@SFrijters SFrijters deleted the ghc-hadrian-structuredattrs branch January 23, 2026 10:45
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants