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
atk: Fix buildInputs vs nativeBuildInputs #88979
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
gobject-introspection | ||
glib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not look right to me. gobject-introspection
is used during build for generating the GIR and glib
is probably used for glib-mkenums
or something else during the build (it was specifically added in ebdd644).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These not being available for target triple were causing the configure stage to fail, as such:
atk> WARNING: Could not detect glib version, assuming 2.54. You may get build errors if your glib is older.
atk> atk/meson.build:138:2: ERROR: dependency gobject-introspection-1.0 not found:
atk> Package gobject-introspection-1.0 was not found in the pkg-config search path.
atk> Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
atk> to the PKG_CONFIG_PATH environment variable
atk> No package 'gobject-introspection-1.0' found
Meson logs reveal that it is looking at targets’ pkg-config for gobject-introspection.
It might be the case that these two dependencies for both target and host are necessary, that the package being built has a buggy build definition etc, but I am unable to really verify that complete _cross-_compilation works with this change because there are a number of dependencies that fail to build before it.
That said, glib
is already present in propagatedBuildInputs
so moving glib
from native to plain buildInputs
is indeed superfluous.
I guess its better to close this for now and revisit once gobject-introspection crossbuild works at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it may be indeed a buggy meson file. I hacked around it a little to get configure to pass and during building it starts invoking executables from the target's gobject-introspection. I’ll take my bug upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Could not detect glib version" message comes from Meson itself, most likely from gnome.genmarshal
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/mesonbuild/meson/blob/14a0f18d2a177d53e8175741bdb9de093241e4a4/mesonbuild/modules/gnome.py#L68-L75 looks reasonable. Maybe something to do with the recent pkg-config cross changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a depsBuildBuild = [ pkg-config ];
(or pkgsBuildBuild.pkg-config
without splicing) to be able to resolve native pkg-config deps.
Motivation for this change
This should supposedly make cross-compilation proceed past the configure stage. Otherwise it fails because the library dependencies meant to be for target were in
nativeBuildInputs
.The cross-compilation still does not work, however, because
gobject-introspection
andmesa
, both dependencies of atk, fail to cross-compile. See #88961 #88959 and https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/344.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)cc @Ericson2314 @7c6f434c