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

WIP: gobject-introspection: Support cross #88222

Open
wants to merge 3 commits into
base: master
from

Conversation

@Ericson2314
Copy link
Member

Ericson2314 commented May 20, 2020

Motivation for this change

The idea is to build the python tools separate from the C bits, and the python tools are run natively (including C extension module, in particular), but the C bits are either the installed library, or tools that must be run with an emulator (during cross compilation) and in both cases are non-native.

I need to still need to wrap the two together for downstream consumption, and I am also debating exactly how I'd like to do that.

CC @jtojnar @samueldr

Upstream issue: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/337
Upstream PR: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/224

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@jtojnar
Copy link
Contributor

jtojnar commented May 20, 2020

Where do docs fit into this #87904?

@Ericson2314
Copy link
Member Author

Ericson2314 commented May 20, 2020

@jtojnar Those look perfectly compatible for me :), We could build them with the python stuff or the C stuff. If you merge your PR I'll be happy to rebase mine on top.

@matthewbauer
Copy link
Member

matthewbauer commented May 21, 2020

Do all dependents of gobject-introspection need exe_wrapper?

When cross compiling nixos, I ended up having to disable gobject-introspection, vala, and gtk-docs. It ends up working pretty well, since you're already building everything from scratch, and I've never encountered a point where I need any of the 3 (matthewbauer@f33e8c3). Annoyingly there are a few things that you have to patch to disable introspection correctly.

@Ericson2314
Copy link
Member Author

Ericson2314 commented May 21, 2020

The exe wrapper is sadly mandatory for anything generating typelibs (compiled gir files), but anything purely consuming them at runtime doesn't need the exe wrapper: it just links girepository like any other C library.

I would like to split up the package (different wrappers around specific outputs from the two underlying builds) to reflect this.

@matthewbauer
Copy link
Member

matthewbauer commented May 21, 2020

The exe wrapper is sadly mandatory for anything generating typelibs (compiled gir files), but anything purely consuming them at runtime doesn't need the exe wrapper: it just links girepository like any other C library.

Well I would be kind of surprised if you needed the emulator at runtime - it would be the cross compiled architecture :)

Meson could just provide exe_wrapper everywhere for consistency. qemu-user at least has few dependencies.

nixStoreDir = config.nix.storeDir or builtins.storeDir;
inherit (darwin) cctools;
};

gobject-introspection-py-tools = gobject-introspection-full-classic.override {

This comment has been minimized.

Copy link
@Mic92

Mic92 May 22, 2020

Contributor

Can you explain the when to use what? It's not clear from the commit message.

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 May 25, 2020

Author Member

Well I think I'll need to make a wrapper package so this isn't actually used directly. But the idea is (whether directly or via some wrapper) than the py tools are need when generating new gir files and type libs when building some C library, and aren't needed by the programs in python etc that just consume typelibs.

This comment has been minimized.

Copy link
@matthewbauer

matthewbauer May 25, 2020

Member

I don’t think we should make that distinction if it’s not made by gobject introspection. IIUC things that consume gir also produce gir without much distinction.

This comment has been minimized.

Copy link
@Ericson2314

Ericson2314 May 25, 2020

Author Member

That's fine, but we will need the wrapper anyways to combine the build platform py tools with host platform everything else.

@nagisa nagisa mentioned this pull request May 26, 2020
2 of 10 tasks complete
@jtojnar jtojnar mentioned this pull request Jun 1, 2020
@Ericson2314 Ericson2314 force-pushed the Ericson2314:gobject-introspection-split branch from 7d6ea7d to 9ffa327 Jun 14, 2020
@ofborg ofborg bot requested review from hedning, jtojnar and worldofpeace Jun 14, 2020
Ericson2314 added 3 commits Apr 26, 2020
This is from the Yocto Project, and contains maintainence to the
original work + newer cross features. (There separate brances for each
to distinguish.)
@Ericson2314 Ericson2314 force-pushed the Ericson2314:gobject-introspection-split branch from 9ffa327 to 278bf51 Jun 14, 2020
primeos added a commit to primeos/nixos-pinebook-pro that referenced this pull request Jun 26, 2020
Let's assume that NIX_PATH is already setup correctly (the channel
nixos-19.09 might not exist anyway).
Note: The cross-compilation of the full image currently depends on [0].

[0]: NixOS/nixpkgs#88222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.