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

python3.pkgs.pygobject3: propagate gobject-introspection setup hook and glib #308488

Draft
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented May 2, 2024

Description of changes

Previously, if a package just depended on GLib (or other bindings shipped with gobject-introspection), wrapper was not needed since ${gobject-introspection}/lib/girepository-1.0 is implicitly on typelib path. Now that GLib bindings were moved to glib package, ${glib}/lib/girepository-1.0 must be added to GI_TYPELIB_PATH by the wrapper (or gobject-introspection setup hook for build time).

This broke packages like power-profile-daemon at runtime and python3.pkgs.pydbus at build time.

While we cannot sensibly propagate wrapping, we can at least fix the build time issues by propagating glib and the g-i setup hook.


I believe it should be possible to use pygobject3 without GLib bindings in theory, so propagating glib is not exactly correct. But since all practical projects will probably need GLib or GObject anyway, it might still be a a good idea to propagate glib from pygobject3.

We probably want to propagate gobject-introspection.setupHook from pygobject3 all the time because without the environment variables set by the setup hook, no bindings will be available.

I do not think we do not want to propagate gobject-introspection since it now just contains typelibs for bunch of third-party libraries (e.g. cairo, fontconfig, xrandr…) which are not needed most of the time, the old libgirepository (which is usually only linked against) and build tools (needed for producing bindings, not for consuming them).


If pygobject3 goes to buildInputs ((0,1)), gobject-introspection.setupHook should go to depsBuildBuildPropagated ((-1,-1)) in pygobject3 to result in (-1,0) (nativeBuildInputs) in dependents, and glib should go to depsHostHostPropagated ((0,0)), if we want it in (0,1) (buildInputs). We cannot propagate setupHook attribute directly, since it is not a package, though.

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.05 Release Notes (or backporting 23.05 and 23.11 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.

Will be fixed less invasively in next commit.

This reverts commit dd897ed.
…nd glib

Previously, if a package just depended on GLib (or other bindings shipped with gobject-introspection), wrapper was not needed since `${gobject-introspection}/lib/girepository-1.0` is implicitly on typelib path. Now that GLib bindings were moved to `glib` package, `${glib}/lib/girepository-1.0` must be added to `GI_TYPELIB_PATH` by the wrapper (or `gobject-introspection` setup hook for build time).

This broke packages like `power-profile-daemon` at runtime and `python3.pkgs.pydbus` at build time.

While we cannot sensibly propagate wrapping, we can at least fix the build time issues by propagating `glib` and the g-i setup hook.

---

I believe it should be possible to use `pygobject3` without `GLib` bindings in theory, so propagating `glib` is not exactly correct. But since all practical projects will probably need `GLib` or `GObject` anyway, it might still be a a good idea to propagate `glib` from `pygobject3`.

We probably want to propagate `gobject-introspection.setupHook` from `pygobject3` all the time because without the environment variables set by the setup hook, no bindings will be available.

I do not think we do not want to propagate `gobject-introspection` since it now just contains typelibs for bunch of third-party libraries (e.g. cairo, fontconfig, xrandr…) which are not needed most of the time, the old libgirepository (which is usually only linked against) and build tools (needed for producing bindings, not for consuming them).

---

If `pygobject3` goes to `buildInputs` (`(0,1)`), `gobject-introspection.setupHook` should go to `depsBuildBuildPropagated` (`(-1,-1)`) in `pygobject3` to result in `(-1,0)` (`nativeBuildInputs`) in dependents, and `glib` should go to `depsHostHostPropagated` (`(0,0)`), if we want it in `(0,1)` (`buildInputs`). We cannot propagate `setupHook` attribute directly, since it is not a package, though.
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.

2 participants