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

glib: add bin output for gvfs executables #38486

Merged
merged 5 commits into from Aug 31, 2018
Merged

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Apr 5, 2018

this fixes gvfs in caja (mate desktop)

Motivation for this change
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.

@Mic92
Copy link
Member Author

Mic92 commented Apr 5, 2018

cc @johannesloetzsch

@Mic92 Mic92 added the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 5, 2018
@Mic92 Mic92 requested a review from jtojnar April 5, 2018 20:22
@dezgeg
Copy link
Contributor

dezgeg commented Apr 5, 2018

Note that there is a related FIXME comment in someplace else: https://github.com/Mic92/nixpkgs/blob/ef73fa9c095eee8a337c172998e2fd6719100ff1/pkgs/desktops/gnome-3/core/gnome-session/default.nix#L32

Does this perhaps fix that issue as well? If so, the no longer correct ${glib.dev}/bin should be fixed in that file.

@Mic92
Copy link
Member Author

Mic92 commented Apr 5, 2018

Good point. Maybe gvfs binaries also should be patched to always have gio in $PATH

@Mic92 Mic92 changed the title glib: bin/gio is required by gvfs executables WIP: glib: bin/gio is required by gvfs executables Apr 5, 2018
@jtojnar
Copy link
Contributor

jtojnar commented Apr 5, 2018

@dezgeg IIRC, the comment refers to gsettings program.


To put the issue into context, glib has three types of binaries:

  • Ones needed during builds like glib-mkenums
  • Ones needed after installation like glib-compile-schemas
  • System utilities gio or gsettings

Optimally, they would be in separate packages but since glib is monolithic, we should use different outputs.

@@ -106,12 +106,15 @@ stdenv.mkDerivation rec {
DETERMINISTIC_BUILD = 1;

postInstall = ''
# needed by gvfs binaries
mkdir -p $out/bin
mv $dev/bin/gio $out/bin
Copy link
Contributor

Choose a reason for hiding this comment

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

I think bin output would be a best place for system utilities like gio and gsettings.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jtojnar can you help with what is needed when?

/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gio
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gio-querymodules
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gapplication
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gdbus
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/glib-compile-resources
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/glib-mkenums
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gdbus-codegen
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gobject-query
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gresource
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gtester
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gsettings
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/glib-gettextize
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/glib-compile-schemas
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/glib-genmarshal
/nix/store/zylnjb0wljm7abn96jk5jv59lj1lmb7l-glib-2.56.0-dev/bin/gtester-report

@jtojnar
Copy link
Contributor

jtojnar commented Apr 5, 2018

  • gapplication – used to start D-Bus-activatable applications, sometimes used in Exec keys in destktop files as a fallback (see description of DBusActivatable), maybe it should be always be in user environment?
  • gdbus – used for running some services (in my /nix/store I found it in xdg-utils which use it inside Flatpak and in gnome3.tracker, the latter should probably be patched), maybe some people may want to use it access D-Bus from shell scripts
  • gio – replaces gvfs-* commands, some users might want to install them either for scripts or manual usage
  • gdbus-codegen, glib-compile-resources, glib-genmarshal, glib-mkenums – used during build
  • glib-gettextize – developers use it for adding gettext support to autotools projects? is it even necessary with gettext 0.19? glib gettext m4 macros are definitely discouraged in favour of uptsream ones
  • gtester, gtester-report – used for running tests (during build? by some autotools macro? meson has its own test runner)
  • gio-querymodules, glib-compile-schemas – usually run after installation to rebuild caches
  • gobject-query – no idea
  • gresource – debugging gresource files created glib-compile-resources?
  • gsettings – editing of GSettings from CLI, some users might want it even if it does not work very well with Nix

Based on their usefulness in scripts, I think gapplication, gdbus, gio and gsettings should go to bin, the rest to dev.

this fixes gvfs in caia (mate desktop)
@Mic92 Mic92 changed the title WIP: glib: bin/gio is required by gvfs executables glib: add bin output for gvfs executables Apr 5, 2018
--replace libglib-2.0.0.dylib ${glib}/lib/libglib-2.0.0.dylib \
--replace libgmodule-2.0.0.dylib ${glib}/lib/libgmodule-2.0.0.dylib \
--replace libgobject-2.0.0.dylib ${glib}/lib/libgobject-2.0.0.dylib
--replace libglib-2.0.so.0 ${glib.out}/lib/libglib-2.0.so.0 \
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use stdenv.lib.getLib for greater accuracy?

@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
++ optional doCheck ./skip-timer-test.patch
++ [ ./schema-override-variable.patch ];

outputs = [ "out" "dev" "devdoc" ];
outputs = [ "bin" "out" "dev" "devdoc" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Though I am not sure if the bin output should be the primary one. cc @vcunat

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that's correct. The intention is anybody can write ${pkgs.foo}/bin/bar in their systemd unit scripts or whatever and have it work.

Copy link
Member

Choose a reason for hiding this comment

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

Probably. So far we've only broken the convention for glibc AFAIK.

Copy link
Member

@vcunat vcunat Apr 8, 2018

Choose a reason for hiding this comment

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

but beware of all the old code using ${glib}/lib/ and similar paths

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: glib

The following builds were skipped because they don't evaluate on x86_64-darwin: gtkd

Partial log (click to expand)

strip is /nix/store/0fzpxnsanc02i4jsb1yhchjp4p62b2n3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/2w8qk31qzfzxf4fxjp055bf2x6vljpji-glib-2.56.0/lib
patching script interpreter paths in /nix/store/2w8qk31qzfzxf4fxjp055bf2x6vljpji-glib-2.56.0
strip is /nix/store/0fzpxnsanc02i4jsb1yhchjp4p62b2n3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/04pjbj4hrq2r2f0ljypzy5r5is5azb4b-glib-2.56.0-dev/lib  /nix/store/04pjbj4hrq2r2f0ljypzy5r5is5azb4b-glib-2.56.0-dev/bin
patching script interpreter paths in /nix/store/04pjbj4hrq2r2f0ljypzy5r5is5azb4b-glib-2.56.0-dev
/nix/store/04pjbj4hrq2r2f0ljypzy5r5is5azb4b-glib-2.56.0-dev/bin/gdbus-codegen: interpreter directive changed from "/usr/bin/env /nix/store/fqsrb5whxc3w7cvvk4yw6z8pralx2q5l-python-2.7.14/bin/python" to "/nix/store/fqsrb5whxc3w7cvvk4yw6z8pralx2q5l-python-2.7.14/bin/python"
/nix/store/04pjbj4hrq2r2f0ljypzy5r5is5azb4b-glib-2.56.0-dev/bin/glib-gettextize: interpreter directive changed from " /bin/sh" to "/nix/store/x030a63qdilnv02pkivfjg44pdxsh5km-bash-4.4-p19/bin/sh"
strip is /nix/store/0fzpxnsanc02i4jsb1yhchjp4p62b2n3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/i4s8ay3pgdkdmz7qdkjn6rjs5r3nid9k-glib-2.56.0-devdoc

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: glib

The following builds were skipped because they don't evaluate on aarch64-linux: gtkd

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/4x8lkdk5qg8hvm8q0s8c382517wv9pxq-glib-2.56.0-dev/lib  /nix/store/4x8lkdk5qg8hvm8q0s8c382517wv9pxq-glib-2.56.0-dev/bin
patching script interpreter paths in /nix/store/4x8lkdk5qg8hvm8q0s8c382517wv9pxq-glib-2.56.0-dev
/nix/store/4x8lkdk5qg8hvm8q0s8c382517wv9pxq-glib-2.56.0-dev/bin/glib-gettextize: interpreter directive changed from " /bin/sh" to "/nix/store/3gg2p6n4kv2f0lsxd41f5iz1ivkbzyzr-bash-4.4-p19/bin/sh"
/nix/store/4x8lkdk5qg8hvm8q0s8c382517wv9pxq-glib-2.56.0-dev/bin/gdbus-codegen: interpreter directive changed from "/usr/bin/env /nix/store/14z9xiiwdnks1pivrv2hml9cflwq2iw3-python-2.7.14/bin/python" to "/nix/store/14z9xiiwdnks1pivrv2hml9cflwq2iw3-python-2.7.14/bin/python"
checking for references to /build in /nix/store/4x8lkdk5qg8hvm8q0s8c382517wv9pxq-glib-2.56.0-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/1qqmiyq1kq9lfxn1q7c3r1iin51086pl-glib-2.56.0-devdoc
strip is /nix/store/3zq400fri5dv7d30lpxlqm2v9y1iis6j-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/1qqmiyq1kq9lfxn1q7c3r1iin51086pl-glib-2.56.0-devdoc
checking for references to /build in /nix/store/1qqmiyq1kq9lfxn1q7c3r1iin51086pl-glib-2.56.0-devdoc...
/nix/store/yr6hpdlksn9r1ga6j7zrjsn0axf03kxk-glib-2.56.0-bin

@dezgeg
Copy link
Contributor

dezgeg commented Apr 6, 2018

Another bin/ path that needs fixing besides the gnome-session one mentioned above:

pkgs/desktops/gnome-3/apps/gnome-documents/default.nix:    substituteInPlace $out/bin/gnome-documents --replace gapplication "${glib.dev}/bin/gapplication"

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: glib, gtkd

Partial log (click to expand)

peas/Engine.d
install -m 644 peasd-3.pc /nix/store/dyvjm17f7jsrvfgk4gvsyh69s974vbzw-gtkd-3.6.5/share/pkgconfig
install -m 644 libpeasd-3.a /nix/store/dyvjm17f7jsrvfgk4gvsyh69s974vbzw-gtkd-3.6.5/lib/
glibPreFixupPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/dyvjm17f7jsrvfgk4gvsyh69s974vbzw-gtkd-3.6.5
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/dyvjm17f7jsrvfgk4gvsyh69s974vbzw-gtkd-3.6.5/lib
patching script interpreter paths in /nix/store/dyvjm17f7jsrvfgk4gvsyh69s974vbzw-gtkd-3.6.5
checking for references to /build in /nix/store/dyvjm17f7jsrvfgk4gvsyh69s974vbzw-gtkd-3.6.5...

@vcunat vcunat changed the base branch from master to staging August 30, 2018 16:23
Using explicit output feels more flaky in case we e.g. move the binary.
(No strong opinion on my side, feel free to revert if you think so.)
@GrahamcOfBorg GrahamcOfBorg added 6.topic: GNOME GNOME desktop environment and its underlying platform 8.has: documentation labels Aug 30, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: glib

The following builds were skipped because they don't evaluate on aarch64-linux: gtkd, tlaplus

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/ql79km8ciw5sa41vw33xkq0j8hlijah5-glib-2.56.0-dev/lib  /nix/store/ql79km8ciw5sa41vw33xkq0j8hlijah5-glib-2.56.0-dev/bin
patching script interpreter paths in /nix/store/ql79km8ciw5sa41vw33xkq0j8hlijah5-glib-2.56.0-dev
/nix/store/ql79km8ciw5sa41vw33xkq0j8hlijah5-glib-2.56.0-dev/bin/glib-gettextize: interpreter directive changed from " /bin/sh" to "/nix/store/fqm2x6kiay1q4vg7pqp4wp17bdijlyc3-bash-4.4-p23/bin/sh"
/nix/store/ql79km8ciw5sa41vw33xkq0j8hlijah5-glib-2.56.0-dev/bin/gdbus-codegen: interpreter directive changed from "/usr/bin/env /nix/store/imv54r70hay2sjrbjiw9l5hhmq3zdkkx-python-2.7.15/bin/python" to "/nix/store/imv54r70hay2sjrbjiw9l5hhmq3zdkkx-python-2.7.15/bin/python"
checking for references to /build in /nix/store/ql79km8ciw5sa41vw33xkq0j8hlijah5-glib-2.56.0-dev...
shrinking RPATHs of ELF executables and libraries in /nix/store/7bnjbgvw45p2rqb7li7ahdhbplw64ndx-glib-2.56.0-devdoc
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/7bnjbgvw45p2rqb7li7ahdhbplw64ndx-glib-2.56.0-devdoc
checking for references to /build in /nix/store/7bnjbgvw45p2rqb7li7ahdhbplw64ndx-glib-2.56.0-devdoc...
/nix/store/v9wslscl816142znahn4mvk4c30c3m8f-glib-2.56.0-bin

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: glib, gtkd, tlaplus

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/rdm2kvvgrz6pi4qvx5zmkny2njkgcgdn-libgit2-0.26.6/lib
patching script interpreter paths in /nix/store/rdm2kvvgrz6pi4qvx5zmkny2njkgcgdn-libgit2-0.26.6
checking for references to /build in /nix/store/rdm2kvvgrz6pi4qvx5zmkny2njkgcgdn-libgit2-0.26.6...
cannot build derivation '/nix/store/2hbpr45s6r423ks47fjavmqwrw0r5ldf-cargo-1.27.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/rz4sprk351yciw0yvrllrd55rpzhnabp-librsvg-2.42.4.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/p3q5cv1fk7pb95izwbhg9i1rrgf7b05i-icon-naming-utils-0.8.90.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5nn2zyrd7lwmyzfc9qx524ywcja90rqm-adwaita-icon-theme-3.28.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/42rdh9l5pykxn5n9j6hnnm0bv6mkflki-libpeas-1.22.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/9vql8msjxwsm3q874ma2f9n9slk3r7db-gtkd-3.8.3.drv': 13 dependencies couldn't be built
error: build of '/nix/store/9vql8msjxwsm3q874ma2f9n9slk3r7db-gtkd-3.8.3.drv', '/nix/store/gwdkrabvhl6ipayc64868bmj2mmjdy5s-tlaplus-1.5.6.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-darwin (full log)

Attempted: glib, tlaplus

The following builds were skipped because they don't evaluate on x86_64-darwin: gtkd

Partial log (click to expand)

cannot build derivation '/nix/store/grnmrx9w9036hg55yap667p3p7m1vq96-tlaplus-1.5.6.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/czb5hf8a3w65y6p60y7hkrpjb3ssqlzd-hook.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/3wzzyksiw064ybr4ywsppv341iyzvwjn-flex-2.6.4.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/4ncnjraw61v3kh7vyz4z4vj0xrzydr09-bootstrap_cmds-dev-tools-7.0.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/1y4rlvpf7bfmhbrkhpq0ajbccqvld4kz-xnu-osx-10.11.6.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/l8za43cgn4wci8qm2csd0p0rh5wak5ap-IOKit-osx-10.11.6.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/81vzs4w9r3xwf04v80lnq5lhw13lcsqh-configd-osx-10.8.5.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/s98m4rvmhc88frr80ddmffjwafrbzldm-python-2.7.15.drv': 9 dependencies couldn't be built
cannot build derivation '/nix/store/3drb39sc88614yrkfr23fg6z4dha4k8x-glib-2.56.0.drv': 6 dependencies couldn't be built
error: build of '/nix/store/3drb39sc88614yrkfr23fg6z4dha4k8x-glib-2.56.0.drv', '/nix/store/grnmrx9w9036hg55yap667p3p7m1vq96-tlaplus-1.5.6.drv' failed

@vcunat vcunat merged commit 80b25db into NixOS:staging Aug 31, 2018
vcunat added a commit that referenced this pull request Aug 31, 2018
@Mic92
Copy link
Member Author

Mic92 commented Aug 31, 2018

Thanks for finishing that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants