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

stdenv and base packages: fix with __structuredAttrs enabled #263773

Draft
wants to merge 48 commits into
base: staging
Choose a base branch
from

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.

@globin globin changed the title stdenv: fix with __structuredAttrs enabled stdenv and base packages: fix with __structuredAttrs enabled Oct 27, 2023
@globin globin requested a review from a user October 27, 2023 23:33
@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Oct 28, 2023
@@ -54,14 +54,14 @@ stdenv.mkDerivation (finalAttrs: {
# with LD_LIBRARY_PATH environment variable.
(substituteAll {
src = ./absolute_shlib_path.patch;
inherit nixStoreDir;
env = { inherit nixStoreDir; };
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
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 6.topic: python 6.topic: qt/kde 6.topic: rust 6.topic: stdenv Standard environment 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants