Skip to content

various: (re-)disable introspection if no emulator#219155

Merged
Artturin merged 12 commits intoNixOS:stagingfrom
alyssais:gobject-introspection-emulator
Mar 4, 2023
Merged

various: (re-)disable introspection if no emulator#219155
Artturin merged 12 commits intoNixOS:stagingfrom
alyssais:gobject-introspection-emulator

Conversation

@alyssais
Copy link
Member

@alyssais alyssais commented Mar 2, 2023

Description of changes

We can cross-compile with gobject-introspection in some cases, but not all, because it requires us to have an emulator for the host platform (which we don't for e.g. Linux → BSD). Recent changes have changed gobject-introspection support in various packages from being native-only to unconditional, which was good for cross setups where we have the emulator as they got g-i support in the cross-compiled packages, but broke cross entirely for setups with no emulator. So we need to partially go back on that, by restricting gobject-introspection to only be enabled for setups where we can actually support it.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.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.

@alyssais alyssais added 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: portability General portability concerns, not specific to cross-compilation or a specific platform labels Mar 2, 2023
@alyssais alyssais requested review from Artturin and Ericson2314 March 2, 2023 12:01
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Mar 2, 2023
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps just use a single withIntrospection flag? The withGtkDoc was only introduced for cross-compilation purposes in the first place. I would like to keep the cross-compilation related changes as minimal as possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was actually introduced to avoid building the documentation on Darwin, and then later modified to also be disabled when cross compiling. So I'm happy to try getting rid of it, but that problem might not have been resolved. We'll have to test.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that should no longer be issue with gi-docgen.

Copy link
Member

@Artturin Artturin Mar 2, 2023

Choose a reason for hiding this comment

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

why glib in nativeBuildInputs here and in tracker

Copy link
Member Author

Choose a reason for hiding this comment

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

at-spi2-core> WARNING: Could not detect glib version, assuming 2.54. You may get build errors if your glib is older.
at-spi2-core> Program glib-genmarshal found: NO
at-spi2-core>
at-spi2-core> atspi/meson.build:76:0: ERROR: Program 'glib-genmarshal' not found or not executable

Copy link
Member

@Artturin Artturin Mar 3, 2023

Choose a reason for hiding this comment

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

can't repro nix build ".#pkgsCross.aarch64-multiplatform.at-spi2-core" ".#at-spi2-core"
nix build ".#pkgsCross.aarch64-multiplatform.tracker" ".#tracker"

x86_64-linux

Copy link
Member

Choose a reason for hiding this comment

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

though i think thats because gir(and maybe something else) is propagating glib

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. It's required when introspection is disabled, which is why it's needed now and not before.

alyssais added 9 commits March 2, 2023 14:41
e.g. when cross compiling from Linux to FreeBSD.
e.g. when cross compiling from Linux to FreeBSD.

Fixes: 2472364 ("gsettings-desktop-schemas: build gir when cross")
e.g. when cross compiling from Linux to FreeBSD.

Fixes: e31262c ("at-spi2-core: make introspection unconditional")
e.g. when cross compiling from Linux to FreeBSD.

Fixes: 1bd8727 ("various: enable gobject-introspection when cross-compiling")
e.g. when cross compiling from Linux to FreeBSD.

Fixes: 1bd8727 ("various: enable gobject-introspection when cross-compiling")
e.g. when cross compiling from Linux to FreeBSD.

Fixes: 1bd8727 ("various: enable gobject-introspection when cross-compiling")
e.g. when cross compiling from Linux to FreeBSD.

We have to get the build libical from pkgsBuildBuild, to avoid picking
up a propagated gobject-introspection host dependency.

Fixes: 1bd8727 ("various: enable gobject-introspection when cross-compiling")
e.g. when cross compiling from Linux to FreeBSD.
alyssais added 2 commits March 2, 2023 14:42
e.g. when cross compiling from Linux to FreeBSD.
e.g. when cross compiling from Linux to FreeBSD.

Fixes: 1bd8727 ("various: enable gobject-introspection when cross-compiling")
@alyssais alyssais force-pushed the gobject-introspection-emulator branch from 6baecdc to 3a59219 Compare March 2, 2023 14:43
@ofborg ofborg bot requested a review from jtojnar March 2, 2023 15:13
e.g. when cross compiling from Linux to FreeBSD.
@alyssais alyssais force-pushed the gobject-introspection-emulator branch from 3a59219 to 0913507 Compare March 2, 2023 15:16
@alyssais
Copy link
Member Author

alyssais commented Mar 2, 2023

Let's test whether we can build the GTK 3 docs on Darwin now:

@ofborg build gtk3

@alyssais
Copy link
Member Author

alyssais commented Mar 2, 2023

One more try because x86_64-darwin hit a Nix bug:

@ofborg build gtk3

@alyssais alyssais requested a review from Artturin March 3, 2023 00:43

depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# provides ical-glib-src-generator that runs during build
libical
Copy link
Member

Choose a reason for hiding this comment

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

why move it to depsBuildBuild

Copy link
Member Author

Choose a reason for hiding this comment

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

Explained in the commit message.

@Artturin Artturin merged commit 77afa1f into NixOS:staging Mar 4, 2023
@alyssais alyssais deleted the gobject-introspection-emulator branch March 9, 2023 19:26
@Artturin Artturin mentioned this pull request Mar 10, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: portability General portability concerns, not specific to cross-compilation or a specific platform 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants