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

atk: Fix buildInputs vs nativeBuildInputs #88979

Closed
wants to merge 1 commit into from

Conversation

nagisa
Copy link
Contributor

@nagisa nagisa commented May 26, 2020

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 and mesa, both dependencies of atk, fail to cross-compile. See #88961 #88959 and https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/344.

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.

cc @Ericson2314 @7c6f434c

Copy link
Contributor

@NickHu NickHu left a 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

@veprbl veprbl added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label May 26, 2020
Comment on lines +21 to +22
gobject-introspection
glib
Copy link
Contributor

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).

Copy link
Contributor Author

@nagisa nagisa May 26, 2020

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.

Copy link
Contributor Author

@nagisa nagisa May 26, 2020

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.

Copy link
Contributor

@jtojnar jtojnar May 26, 2020

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.

Copy link
Contributor

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?

Copy link
Member

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.

@nagisa nagisa closed this May 26, 2020
@nagisa nagisa deleted the nagisa/buildinputs-atk branch May 26, 2020 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants