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

partition-manager: 3.0.1 -> 3.3.1 #40895

Merged
merged 1 commit into from May 22, 2018
Merged

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented May 21, 2018

Motivation for this change

The 3.0.1 build was broken (see the Hydra build from
https://hydra.nixos.org/build/74368257 for further reference).

Because of the missing utillinux build input the package fails fairly
early:

-- Checking for module 'blkid'
--   No package 'blkid' found
CMake Error at /nix/store/9hmhxgj4jk6jmxihgavj6gm0p759misc-cmake-3.10.2/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found

Additionally partition-manager was broken on non-KDE desktops (none+i3
in my case) as the plugins from libsForQt5.kpmcore couldn't be found
in QT_PLUGIN_PATH unless it's installed in
environment.systemPackages or with nix-env -iA libsForQt5.kpmcore.
This has been fixed by adding a wrapper in the postInstall hook which
prefixes the QT_PLUGIN_PATH with the plugin path from kpmcore used
for the build.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: partition-manager

Partial log (click to expand)

Wrapping program /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1/bin/.partitionmanager-wrapped
Wrapping program /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1/bin/partitionmanager
shrinking RPATHs of ELF executables and libraries in /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1
shrinking /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1/bin/..partitionmanager-wrapped-wrapped
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1/bin
patching script interpreter paths in /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1
checking for references to /build in /nix/store/ip45a4mq6206c29pg94zlkixrnlyw44k-partitionmanager-3.3.1...
postPatchMkspecs
postPatchMkspecs

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: partition-manager

Partial log (click to expand)

Wrapping program /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1/bin/partitionmanager
Wrapping program /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1/bin/.partitionmanager-wrapped
shrinking RPATHs of ELF executables and libraries in /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1
shrinking /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1/bin/..partitionmanager-wrapped-wrapped
strip is /nix/store/jk6j4lh9v5mvjdbdc35sj0zffhhf6s56-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1/bin
patching script interpreter paths in /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1
checking for references to /build in /nix/store/pm3243lgpx9yw5cdyn7jrf0f3x2ciyjk-partitionmanager-3.3.1...
postPatchMkspecs
postPatchMkspecs

nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook ];

# refer to kpmcore for the use of eject
buildInputs = [ eject libatasmart utillinux makeWrapper ];
Copy link
Contributor

Choose a reason for hiding this comment

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

makeWrapper belongs in nativeBuildInputs.

propagatedBuildInputs = [ kconfig kcrash kinit kpmcore ];

postInstall = ''
wrapProgram "$out/bin/partitionmanager" --prefix QT_PLUGIN_PATH : "${kpmcore}/lib/qt-5.${lib.versions.minor qtbase.version}/plugins"
Copy link
Contributor

Choose a reason for hiding this comment

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

With this, the program is wrapped twice: once by wrapGAppsHook (why, it's a KDE app?) and once by makeWrapper. Looks quite ugly. Any chance you can make it work with only one wrapper?

@Ma27
Copy link
Member Author

Ma27 commented May 22, 2018

makeWrapper belongs in nativeBuildInputs.

thanks, missed that 👍

With this, the program is wrapped twice: once by wrapGAppsHook (why, it's a KDE app?) and once by makeWrapper. Looks quite ugly. Any chance you can make it work with only one wrapper?

I'm admittedly not sure, that's been introduced in be7b7d9.
I'll see what happens when removing wrapGAppsHook, but you're absolutely right, nested wrappers are quite ugly.

@Ma27
Copy link
Member Author

Ma27 commented May 22, 2018

It seems as we can't (or shouldn't) drop wrapGAppsHook (which was added in favor of the KDE hooks in the commit I linked above).
When removing this hook from nativeBuildInputs the following happens:

kf5.kxmlgui: cannot find .rc file "partitionmanagerui.rc" for component "partitionmanager"
"Using backend plugin: pmlibpartedbackendplugin (1)"
"Scanning devices..."
getting smart status failed for  "/dev/nvme0n1" :  Operation not supported
blkid: unknown file system type  ""  on  "/dev/nvme0n1p1"
"Device found: Unknown"
"Partition ‘/dev/nvme0n1p3’ is not properly aligned (last sector: 1000215182, modulo: 655)."
"Scan finished."
[1]    17597 segmentation fault  sudo ./result/bin/partitionmanager

This happens even when using sudo (although partition-manager supports a restricted non-sudo mode). After looking at the shell script in pkgs/build-support/setup-hook/wrap-gapps-hook.sh it seems as it also sets variables like XDG_DATA_DIRS. If I get the code correctly the hook can be used for non-Gnome apps as done in be7b7d9 for most of the KDE apps.

Unfortunately I don't know too much about the wrappers, so unless you have an idea how to simplify this I'd suggest to keep it for now as this repairs the build at least and makes the package functional again :-)

The `3.0.1` build was broken (see the Hydra build from
https://hydra.nixos.org/build/74368257 for further reference).

Because of the missing `utillinux` build input the package fails fairly
early:

```
-- Checking for module 'blkid'
--   No package 'blkid' found
CMake Error at /nix/store/9hmhxgj4jk6jmxihgavj6gm0p759misc-cmake-3.10.2/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
```

Additionally `partition-manager` was broken on non-KDE desktops (none+i3
in my case) as the plugins from `libsForQt5.kpmcore` couldn't be found
in `QT_PLUGIN_PATH` unless it's installed in
`environment.systemPackages` or with `nix-env -iA libsForQt5.kpmcore`.
This has been fixed by adding a wrapper in the `postInstall` hook which
prefixes the `QT_PLUGIN_PATH` with the plugin path from `kpmcore` used
for the build.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: partition-manager

Partial log (click to expand)

Wrapping program /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1/bin/.partitionmanager-wrapped
Wrapping program /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1/bin/partitionmanager
shrinking RPATHs of ELF executables and libraries in /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1
shrinking /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1/bin/..partitionmanager-wrapped-wrapped
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1/bin
patching script interpreter paths in /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1
checking for references to /build in /nix/store/bwc55ipc3bd4shx6d02lyjv5cnvjisha-partitionmanager-3.3.1...
postPatchMkspecs
postPatchMkspecs

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: partition-manager

Partial log (click to expand)

Wrapping program /nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1/bin/.partitionmanager-wrapped
shrinking RPATHs of ELF executables and libraries in /nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1
shrinking /nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1/bin/..partitionmanager-wrapped-wrapped
strip is /nix/store/jk6j4lh9v5mvjdbdc35sj0zffhhf6s56-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1/bin
patching script interpreter paths in /nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1
checking for references to /build in /nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1...
postPatchMkspecs
postPatchMkspecs
/nix/store/f11m2zxf1mw4krlil7s2ymj9kd4h8fkl-partitionmanager-3.3.1

@xeji
Copy link
Contributor

xeji commented May 22, 2018

I don't know much about wrapGAppsHook either, so let's keep the double wrapper for now.

@xeji xeji merged commit a8a6d26 into NixOS:master May 22, 2018
@Ma27 Ma27 deleted the fix-partition-manager branch May 22, 2018 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants