Skip to content

stdenv and base packages: fix with __structuredAttrs enabled#263773

Draft
globin wants to merge 48 commits intoNixOS:stagingfrom
globin:structured-attrs-staging
Draft

stdenv and base packages: fix with __structuredAttrs enabled#263773
globin wants to merge 48 commits intoNixOS:stagingfrom
globin:structured-attrs-staging

Conversation

@globin
Copy link
Member

@globin globin commented Oct 27, 2023

Description of changes

This fixes stdenv with __structuredAttrs enabled.

Test build:

nix-build -E 'with import ./. { config.structuredAttrsByDefault = true; }; hello'
  • makeFlags is a bash array and cannot be appended to as done in glibc's preConfigure.
  • env vars may only be strings and have to be in env to be exported
  • substituteAll only reads and substitutes exported variables

This is the first part of a number of PRs that intend to make nixpkgs forward-compatible with __structuredAttrs enabled globally.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 23.11 Release Notes (or backporting 23.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
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) label Oct 27, 2023
@globin globin changed the title stdenv: fix with __structuredAttrs enabled stdenv and base packages: fix with __structuredAttrs enabled Oct 27, 2023
@globin globin force-pushed the structured-attrs-staging branch from cf2b34a to 49208af Compare October 27, 2023 14:38
@globin globin requested a review from a user October 27, 2023 23:33
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 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. labels Oct 28, 2023
@globin globin force-pushed the structured-attrs-staging branch from f6d08f3 to 6bf9eb6 Compare October 28, 2023 11:45
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Oct 28, 2023
@globin globin force-pushed the structured-attrs-staging branch from dc1b261 to eea4b0b Compare October 28, 2023 12:37
@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Oct 28, 2023
Copy link
Member

Choose a reason for hiding this comment

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

You did a change in substitute-all.nix so this should be unnecessary now

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks missed that one while rebasing!

@globin globin force-pushed the structured-attrs-staging branch 2 times, most recently from 7de48e9 to f94dca8 Compare October 29, 2023 21:05
@globin globin force-pushed the structured-attrs-staging branch from f94dca8 to eb6b8b6 Compare October 30, 2023 11:19
@github-actions github-actions bot added 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. labels Oct 30, 2023
@globin
Copy link
Member Author

globin commented Oct 30, 2023

I think this is a good point, where I'll leave this PR and continue with follow-ups based on this:

  • set of base packages upon stdenv works, including: systemd, nginx, postgresql, sway
  • rust/perl/python language infrastructure generally works for an adequate number of packages

Next steps will probably be around go/ruby language infrastructure and "leafier" packages.

I've tried to make sure to not break anything with structuredAttrs kept off, although there are some larger changes, if any are controversial I can exclude them for now, to get this merged more easily.

@globin globin marked this pull request as draft October 30, 2023 16:53
@globin
Copy link
Member Author

globin commented Oct 30, 2023

Found an issue with pytestFlagsArray which has been used different than all other *Array variables, which makes backward-compatibility difficult to achieve, might be a better option to break this option and fix it properly right away.

@wegank wegank mentioned this pull request Nov 18, 2023
13 tasks
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: stdenv Standard environment 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-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 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. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants