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

udisks2: 2.1.6 → 2.7.6 #35551

Closed
wants to merge 5 commits into from
Closed

udisks2: 2.1.6 → 2.7.6 #35551

wants to merge 5 commits into from

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Feb 25, 2018

Motivation for this change

Closes: #34999

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

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘libblockdev-2.16’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/development/libraries/libblockdev/default.nix:34 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/39z361hf6i97k0w8sr1x76b7flfs8hk1-udisks-2.7.6-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/xyf6iy5dzflj7da4xxri51mrm5j44ars-udisks-2.7.6-dev
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/xyf6iy5dzflj7da4xxri51mrm5j44ars-udisks-2.7.6-dev/lib 
patching script interpreter paths in /nix/store/xyf6iy5dzflj7da4xxri51mrm5j44ars-udisks-2.7.6-dev
checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/xyf6iy5dzflj7da4xxri51mrm5j44ars-udisks-2.7.6-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/4nd4d4mq7qf2s29gn130d4y2ipj7rjxq-udisks-2.7.6-devdoc
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/4nd4d4mq7qf2s29gn130d4y2ipj7rjxq-udisks-2.7.6-devdoc
checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/4nd4d4mq7qf2s29gn130d4y2ipj7rjxq-udisks-2.7.6-devdoc...

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

patching script interpreter paths in /nix/store/4jfjdsz1nqdm5bgb3mbffds8vi42lb83-udisks-2.7.6-dev
checking for references to /build in /nix/store/4jfjdsz1nqdm5bgb3mbffds8vi42lb83-udisks-2.7.6-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/00430bi6jmyvx23gv9i2x3y9x5aqfhhy-udisks-2.7.6-devdoc
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/00430bi6jmyvx23gv9i2x3y9x5aqfhhy-udisks-2.7.6-devdoc
checking for references to /build in /nix/store/00430bi6jmyvx23gv9i2x3y9x5aqfhhy-udisks-2.7.6-devdoc...
/nix/store/kh0m0fdb5mv96wvwq2z8qnx1cds5qk28-libblockdev-2.16
/nix/store/m5pzqv4mj7mwajhg90kwcmvb2v22y7jn-libbytesize-1.2
/nix/store/4s35xcgr4bafj7rmmw0s4k09hzxfik8f-udisks-2.7.6
/nix/store/794sz6v3whzjvlp2wz1qbc51hi96299x-volume_key-0.3.9

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘libblockdev-2.16’ in /private/var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/development/libraries/libblockdev/default.nix:34 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

patching script interpreter paths in /nix/store/82k0p8f4002wb6l33pqzcnvs20icg2qk-udisks-2.7.6-dev
checking for references to /build in /nix/store/82k0p8f4002wb6l33pqzcnvs20icg2qk-udisks-2.7.6-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/354h8rxis6iblda2n7v99z16vlmhdaqp-udisks-2.7.6-devdoc
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/354h8rxis6iblda2n7v99z16vlmhdaqp-udisks-2.7.6-devdoc
checking for references to /build in /nix/store/354h8rxis6iblda2n7v99z16vlmhdaqp-udisks-2.7.6-devdoc...
/nix/store/kh0m0fdb5mv96wvwq2z8qnx1cds5qk28-libblockdev-2.16
/nix/store/m5pzqv4mj7mwajhg90kwcmvb2v22y7jn-libbytesize-1.2
/nix/store/4gkrags8w32bv1ki09sl418z6m4sl2wf-udisks-2.7.6
/nix/store/794sz6v3whzjvlp2wz1qbc51hi96299x-volume_key-0.3.9

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/7yjvxxmy1m5bpd9m7mxv3ka8qmqjhavv-udisks-2.7.6-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/wk8azxfxi1k7xln0qfjzf8lnjz9d2ls7-udisks-2.7.6-dev
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/wk8azxfxi1k7xln0qfjzf8lnjz9d2ls7-udisks-2.7.6-dev/lib 
patching script interpreter paths in /nix/store/wk8azxfxi1k7xln0qfjzf8lnjz9d2ls7-udisks-2.7.6-dev
checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/wk8azxfxi1k7xln0qfjzf8lnjz9d2ls7-udisks-2.7.6-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/917ln25vv6z0jyq2cbnn154cdli7nr2g-udisks-2.7.6-devdoc
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/917ln25vv6z0jyq2cbnn154cdli7nr2g-udisks-2.7.6-devdoc
checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/917ln25vv6z0jyq2cbnn154cdli7nr2g-udisks-2.7.6-devdoc...

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 26, 2018

@flokli Your commit worked great, except that you forgot to add dosfstools to the PATH. I added it and changed it back to force-path.patch, and was able to successfully format a flash drive. You should be able to cherry-pick jtojnar/udisks2-2.7.6 onto flokli/udisks^.

We will need to carefully inspect if we caught all the offenders, including libblockdev ones.

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘libblockdev-2.16’ in /private/var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/development/libraries/libblockdev/default.nix:34 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

patching script interpreter paths in /nix/store/h5cb0zsphgbwj49r247n517r1x4lp2ai-udisks-2.7.6-dev
checking for references to /build in /nix/store/h5cb0zsphgbwj49r247n517r1x4lp2ai-udisks-2.7.6-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/msjs9sr75iw5fps9frgk3y9q6l9l9bg4-udisks-2.7.6-devdoc
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/msjs9sr75iw5fps9frgk3y9q6l9l9bg4-udisks-2.7.6-devdoc
checking for references to /build in /nix/store/msjs9sr75iw5fps9frgk3y9q6l9l9bg4-udisks-2.7.6-devdoc...
/nix/store/pb31wmcspq8lm2y4w4c6zmc7031lmw5y-libblockdev-2.16
/nix/store/m5pzqv4mj7mwajhg90kwcmvb2v22y7jn-libbytesize-1.2
/nix/store/k31znya5vicp7ly3zsf3c9msy8hmyx0p-udisks-2.7.6
/nix/store/fqxldbcq6aj80bjwphwmx8dd5mw62v8f-volume_key-0.3.9

@flokli
Copy link
Contributor

flokli commented Feb 26, 2018

Oh wow, the missing dosfstools totally explains why I was still having problems with mkfs.vfat, thanks for finding this :-)

I quickly skimmed over libblockdev, filesystem-specific tools are configured in src/plugins/fs/ (we should have all those covered, and all g_spawn_* calls have G_SPAWN_SEARCH_PATH set, so calling udisks with the currect assembled PATH should be enough).

Whats still missing is other parts in which libblockdev related to the block devices itself:

  • mdadm
  • lvm2 (dmsetup, vgcreate and friends)
  • bcache-tools (make-bcache)
  • multipath-tools

Those could simply added to the path. I'm still not sure on whether to prefer patching via @path@ or the use of wrapProgram, but thats personal preference ;-)

There's also src/plugins/s390.c with hardcoded paths (filed upstream PR at storaged-project/libblockdev#326).
We currently lack the userspace tools dasdfmt,chccwdev (https://github.com/ibm-s390-tools/s390-tools), dasd_cio_free, zfcp_cio_free (might be symlinks to device_cio_free, so I'm unsure about packaging those. Any z Systems NixOS users around? :-D

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/b00rd7yh2n439aq8wf3ddzrx409c7j45-udisks-2.7.6-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/py93c8lmapk8bq5yqm6dcd6ll44a331f-udisks-2.7.6-dev
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/py93c8lmapk8bq5yqm6dcd6ll44a331f-udisks-2.7.6-dev/lib 
patching script interpreter paths in /nix/store/py93c8lmapk8bq5yqm6dcd6ll44a331f-udisks-2.7.6-dev
checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/py93c8lmapk8bq5yqm6dcd6ll44a331f-udisks-2.7.6-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/as8v2wd0k79cvncwbhlwj3m07lppkpz3-udisks-2.7.6-devdoc
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/as8v2wd0k79cvncwbhlwj3m07lppkpz3-udisks-2.7.6-devdoc
checking for references to /tmp/nix-build-udisks-2.7.6.drv-0 in /nix/store/as8v2wd0k79cvncwbhlwj3m07lppkpz3-udisks-2.7.6-devdoc...

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 26, 2018

I'm still not sure on whether to prefer patching via @path@ or the use of wrapProgram, but thats personal preference ;-)

I have had my own share of problems with wrappers so my perspective is little skewed. I agree that it is cleaner than the force-path.patch hack.

The optimal solution would be changing each individual executable in the source code to absolute path but of course that is laborious, and unless udisk calls the executables repeatedly, getting rid of PATH look-up overhead is not worth the trouble. However, for the libblockdev, which does not have a daemon, we will have to do that anyway, if we want to allow usage outside of udisks.

Maybe we could make the paths ./configureable and try to upstream it?

@jfrankenau
Copy link
Member

@jtojnar, while you are at it, could you include storaged-project/udisks@f639f67 and storaged-project/udisks@293aa9b in the systemd service specification of the matching udisks2 module? Thank you.

@jtojnar
Copy link
Contributor Author

jtojnar commented Mar 12, 2018

I will not have time to finish this anytime soon. Anyone want to take this over?

@dtzWill
Copy link
Member

dtzWill commented Mar 27, 2018

This works (on top of recent staging changes) w/musl, with the following change:

dtzWill@3fd44d9

Which can probably be reduced to just building libblockdev with --without-dm (and drop dmraid dep) which upstream says is okay/reasonable if we're only using libblockdev as a dependency of udisks2.
(See commit message for links to this)

@jtojnar jtojnar mentioned this pull request Apr 3, 2018
8 tasks
@flokli flokli mentioned this pull request Jun 8, 2018
8 tasks
@flokli
Copy link
Contributor

flokli commented Jun 8, 2018

@jtojnar, while you are at it, could you include storaged-project/udisks@f639f67 and storaged-project/udisks@293aa9b in the systemd service specification of the matching udisks2 module? Thank you.

That's included in udisks-2.7.6, which is in #41723.

@xeji
Copy link
Contributor

xeji commented Jun 10, 2018

Continued in #41723 , closing.

@xeji xeji closed this Jun 10, 2018
flokli added a commit to flokli/nixpkgs that referenced this pull request Jun 11, 2018
@jtojnar jtojnar deleted the udisks2-2.7.6 branch July 15, 2018 16:15
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

6 participants