Skip to content

treewide: fix packages that use cmake strict deps when cmake strict deps works#324545

Merged
SomeoneSerge merged 30 commits intoNixOS:masterfrom
paparodeo:treewide-strict-deps-fixes
Jul 27, 2024
Merged

treewide: fix packages that use cmake strict deps when cmake strict deps works#324545
SomeoneSerge merged 30 commits intoNixOS:masterfrom
paparodeo:treewide-strict-deps-fixes

Conversation

@paparodeo
Copy link
Contributor

@paparodeo paparodeo commented Jul 4, 2024

Description of changes

strict deps doesn't quite work for cmake as it (effectively) pulls in buildInputs into the PATH (precisely, it makes find_program discover executables form buildInputs via CMAKE_PREFIX_PATH). this change uses a fix for cmake #318226 so this doesn't happen and then fixes the packages that set strict deps but broke with the fixed cmake.

there were a couple of lomiri packages where i just disabled strict deps due to how cmake would package scripts, it seemed to want to locate them in the PATH and then package them. I could've just added them to nativeBuildInputs but i didn't -- there are only 2 packages and marked by disable strict deps in the title.

kdePackages.* are fixed by #329977

packages were found using:

cmake-strict-deps.nix
nix-instantiate --show-trace --eval --strict --json -A devs - <<EOF
{
  paths ? (import ./pkgs/top-level/release-attrpaths-superset.nix { }).paths,
  pkgs ? (import ./. { }),
}:

let
  inherit (pkgs) lib;
  inherit (builtins) currentSystem tryEval;

  usesCmake =
    let
      hasCmakeNativeBuildInputs =
        p: p ? nativeBuildInputs && lib.lists.any (x: x == pkgs.cmake) p.nativeBuildInputs;

      usesCmake' =
        p:
        p != null
        && p.strictDeps or false
        && !(p.meta.broken or false)
        && lib.meta.availableOn p currentSystem
        && hasCmakeNativeBuildInputs p;
    in
    path: (tryEval (usesCmake' (lib.attrByPath path null pkgs))).value;
in
{
  devs = map (f: lib.concatStringsSep "." f) (lib.filter usesCmake paths);
}
EOF

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.

@ofborg ofborg bot added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 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 Jul 4, 2024
@paparodeo paparodeo changed the base branch from master to staging July 4, 2024 13:11
@paparodeo paparodeo changed the base branch from staging to master July 6, 2024 02:58
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 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 Jul 6, 2024
@paparodeo paparodeo mentioned this pull request Jul 6, 2024
13 tasks
paparodeo added 17 commits July 25, 2024 07:19
dbus-test-runner is executed and thus required in nativeCheckInputs
move python3 from buildInputs to nativeBuildInputs
move python3 from buildInputs to nativeBuildInputs
move flex from buildInputs to nativeBuildInputs
move swig4 from buildInputs to nativeBuildInputs
requires wayland-scanner (wayland) in nativeBuildInputs
move python3 to nativeBuildInputs
add qtdeclarative to nativeBuildInputs
add lttng-ust to nativeBuildInputs
add qtdeclarative to nativeBuildInputs
add qtdeclarative to nativeBuildInputs
add qtdeclarative to natvieBuildInputs
add lttng-ust to nativeBuildInputs
build searches for executables in path to install in script. this
doesn't work with strict deps
add qtdeclarative to nativeBuildInputs
configure phase looks for executables to be used in the runtime which is
not compatible with strictDeps.
paparodeo added 13 commits July 25, 2024 07:19
move python3 from buildInputs to nativeBuildInputs
add python3 and protobuf to nativeBuildInputs
move perl to nativeBuildInputs
move python3 to nativeBuildInputs
add wxGTK32 to nativeBuildInputs
add python3Packages.numpy to nativeBuildInputs
add protobuf to nativeBuildInputs
add flex & bison to nativeBuildInputs
move swig to nativeBuildInputs
add python3 to nativeBuildInputs
add wxGTK32 to nativeBuildInputs
add wayland-scanner to nativeBuildInputs
add python3Packages.python to nativeBuildInputs
@paparodeo paparodeo marked this pull request as ready for review July 25, 2024 07:28
@SomeoneSerge SomeoneSerge self-requested a review July 26, 2024 11:15
Comment on lines +43 to +46
= [ cmake python3 ]
++ (lib.optional enableGui wrapQtAppsHook);
buildInputs
= [ boostPython python3 eigen python3Packages.apycula ]
= [ boostPython eigen python3Packages.apycula ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Yea I think these should use python3Packages and python3Packages.python but I'll submit this separately

@SomeoneSerge SomeoneSerge merged commit 63cc38b into NixOS:master Jul 27, 2024
@paparodeo paparodeo deleted the treewide-strict-deps-fixes branch July 27, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants