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

treewide: add missing installPhase hooks #333527

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

Sigmanificient
Copy link
Member

@Sigmanificient Sigmanificient commented Aug 9, 2024

Description of changes

This was done throw the following command:

grep -rP "installPhase ="
    | cut -d ':' -f 1 \
    | xargs -i sh -c "grep -P 'runHook\s+preInstall' {} >/dev/null ||
echo '{}'" | python add_missing_hooks.py

with the following script:
https://gist.github.com/Sigmanificient/c68e03d1ad750a83233c6ab05761cbf2

2432 hits, 68 miss are to be dealt with manually

Applying the following:

  installPhase = ''
+  runHook preInstall
+
  ...
+
+  runHook postInstall
'';

for matching:

(?P<decl>installPhase\s+=\s+(?:let(?:(?!\s+in\s+)(?:.|\n))+\s+in\s+)?)
'{2,3}\n?(?P<ident>\s+)?(?P<block>(?:(?!'{2,3};)(?:\n|.)?)+)(?P<quotes>'{2,3});

and (@emilazy suggestion):

- installPhase = "...";
+ installPhase = "runHook preInstall; ...; runHook postInstall";

matching:

(?P<ident>[ ]+)?(?P<decl>installPhase\s+=\s+)"(?P<block>.*)";

Extra edits

Some minor adjustment were done to pass green on the CI:

  • replaced tabs to spaces in pkgs/build-support/dotnet/dotnetenv/build-solution.nix
  • removed stdenv/linux, glibc to avoid rebuilding stdenv

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: python 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: haskell 6.topic: qt/kde 6.topic: kernel The Linux kernel 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: emacs Text editor 6.topic: printing 6.topic: rust 6.topic: ruby 6.topic: vim 6.topic: erlang 6.topic: ocaml 6.topic: fetch 6.topic: steam Steam game store/launcher (store.steampowered.com) 6.topic: stdenv Standard environment 6.topic: nodejs 6.topic: pantheon The Pantheon desktop environment 6.topic: TeX Issues regarding texlive and TeX in general 6.topic: lua 6.topic: testing Tooling for automated testing of packages and modules 6.topic: cinnamon Desktop environment 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: mate The MATE Desktop Environment 6.topic: vscode 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: julia 6.topic: php labels Aug 9, 2024
@github-actions github-actions bot added 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 6.topic: dotnet Language: .NET labels Aug 9, 2024
@Sigmanificient Sigmanificient force-pushed the add-missing-install-hooks branch from ceabcfc to d068e79 Compare August 9, 2024 20:29
@Sigmanificient Sigmanificient force-pushed the add-missing-install-hooks branch from d068e79 to f39945b Compare August 10, 2024 01:27
@Sigmanificient Sigmanificient changed the base branch from master to staging August 10, 2024 01:30
@Sigmanificient Sigmanificient force-pushed the add-missing-install-hooks branch 3 times, most recently from 745690d to f45a9c0 Compare August 13, 2024 19:36
@github-actions github-actions bot removed the 6.topic: stdenv Standard environment label Aug 13, 2024
@Sigmanificient
Copy link
Member Author

Sigmanificient commented Aug 13, 2024

whoops used wrong pr number, dont mind the 2 aboves 😅
(also the one below)

@Sigmanificient Sigmanificient mentioned this pull request Aug 13, 2024
13 tasks
@Sigmanificient Sigmanificient force-pushed the add-missing-install-hooks branch 2 times, most recently from 555004c to e898570 Compare August 18, 2024 12:45
@github-actions github-actions bot removed the 6.topic: emacs Text editor label Aug 18, 2024
@Sigmanificient Sigmanificient force-pushed the add-missing-install-hooks branch 4 times, most recently from c2d39b6 to 178fbcb Compare August 18, 2024 15:15
This was done throw the following command:

grep -rP "installPhase ="
    | cut -d ':' -f 1 \
    | xargs -i sh -c "grep -P 'runHook\s+preInstall' {} >/dev/null ||
echo '{}'" | python add_missing_hooks.py

applying the following script:
https://gist.github.com/Sigmanificient/c68e03d1ad750a83233c6ab05761cbf2

some manuals adjustments were adding (formatting, edge cases)
@Sigmanificient Sigmanificient force-pushed the add-missing-install-hooks branch from 178fbcb to d3be21e Compare August 18, 2024 15:16
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 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 6.topic: cinnamon Desktop environment 6.topic: dotnet Language: .NET 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: erlang 6.topic: fetch 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: haskell 6.topic: julia 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: kernel The Linux kernel 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 6.topic: lua 6.topic: mate The MATE Desktop Environment 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: nodejs 6.topic: ocaml 6.topic: pantheon The Pantheon desktop environment 6.topic: php 6.topic: printing 6.topic: python 6.topic: qt/kde 6.topic: ruby 6.topic: rust 6.topic: steam Steam game store/launcher (store.steampowered.com) 6.topic: testing Tooling for automated testing of packages and modules 6.topic: TeX Issues regarding texlive and TeX in general 6.topic: vim 6.topic: vscode 8.has: documentation This PR adds or changes documentation 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.

2 participants