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: wrap phase running actions of genericBuild into a function #230468

Closed
wants to merge 141 commits into from

Conversation

Ninlives
Copy link
Contributor

@Ninlives Ninlives commented May 7, 2023

Description of changes

Provide a runPhase function which wraps the phase running action of genericBuild. The new function can be used as an interface by nix develop, i.e. nix develop some#flake --build may just call runPhase build, which makes its behavior more consistent with nix build. In preparation of fixing NixOS/nix#6202

Things done

Only tested with nix build nixpkgs#hello (ca-derivations by default when?). If someone has more free computing resources, please help me test the PR.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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.05 Release Notes (or backporting 22.11 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.

Adam Joseph and others added 13 commits April 24, 2023 13:17
This commit adds `mips64el` to the `qemuArch` table.
The icon we were installing is an old one that should not be used these days: https://gitlab.com/wireshark/wireshark/-/merge_requests/10507
And the CMake build script already installs the desktop file and icons in a more proper location since 2.4.0: https://gitlab.com/wireshark/wireshark/-/commit/c27404655650a3648f576663d07394105fd5ef30
The `bootstrapTools.bootstrapTools` attribute, which *unpacks* the
bootstrapFiles, lies about its `system`:

  https://github.com/NixOS/nixpkgs/blob/78963777a40a63333520c5c8f4567b4059b68c4d/pkgs/stdenv/linux/make-bootstrap-tools.nix#L236

Unfortunately because of this, when building `bootstrapTools.*`,
Hydra will try to execute the cross-compiled bootstrapFiles'
`busybox` on the wrong architecture, and fail.

I originally submitted a fix for this, by filtering out the
`.bootstrapTools` attribute, in
NixOS#188339

Unfortunately my fix filtered at the wrong level of the attrset
hierarchy, and neglected to filter the `test` attribute as well.
This PR corrects those mistakes
Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

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

That looks good (although I barely know anything about the intrinsics of stdenv, so don't trust me too much on that).

Wrt NixOS/nix#6202, note however that we probably wouldn't be able to use this for some time as we can't rely on people using a brand new nixpkgs

Failing Hydra build: https://hydra.nixos.org/build/215620971

Applying the patch that upgrades the vendored `pybind11` fixes the
problem.
mweinelt and others added 4 commits May 9, 2023 14:57
nixos/mosquitto: use networkd for tests
Provide a `runPhase` function which wraps the phase running action of
genericBuild. The new function can be used as an interface by `nix
develop`, i.e. `nix develop some#flake --build` may just call `runPhase
build`, which makes its behavior more consistent with `nix build`.
In preparation of fixing NixOS/nix#6202
@Ninlives Ninlives changed the base branch from master to staging May 9, 2023 13:11
@Ninlives
Copy link
Contributor Author

Ninlives commented May 9, 2023

I've edited the commit name and the target branch, please check.

@Ninlives Ninlives changed the title Wrap phase running actions of genericBuild into a function stdenv: wrap phase running actions of genericBuild into a function May 9, 2023
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: ocaml 6.topic: python 6.topic: systemd 6.topic: vim 8.has: module (update) This PR changes an existing module in `nixos/` labels May 9, 2023
@Ninlives
Copy link
Contributor Author

Ninlives commented May 9, 2023

Oops, I messed it up, sorry, will fix it later.

@Artturin
Copy link
Member

Artturin commented May 9, 2023

This is why I said to read CONTRIBUTING.md as it has instructions. Please open a new pr to avoid spamming people

@Artturin Artturin closed this May 9, 2023
@NixOS NixOS locked and limited conversation to collaborators May 9, 2023
@Artturin
Copy link
Member

#230874

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: ocaml 6.topic: python 6.topic: stdenv Standard environment 6.topic: systemd 6.topic: vim 8.has: module (update) This PR changes an existing module in `nixos/` 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.