Fixes ↓
```
nix-repl> pkgsCross.x86_64-freebsd.pkgsBuildHost.gobject-introspection
error: Don't know how to run x86_64-unknown-freebsd executables.
```
The unwrapped already doesn't error
```
nix-repl> pkgsCross.x86_64-freebsd.pkgsBuildHost.gobject-introspection-unwrapped
«derivation /nix/store/xq4q4vigy2glmfng2h6bbr4sysyk8ipz-gobject-introspection-1.82.0.drv»
```
7b1cffdd2e/pkgs/development/libraries/gobject-introspection/default.nix (L114)
It's caused by `depsTargetTargetPropagated = [ overridenTargetUnwrappedGir ];` in the wrapper
In `graphene` there is
`PATH=${python3.withPackages (pp: [ pp.pygobject3 pp.tappy ])}/bin:$PATH patchShebangs tests/introspection.py`
Which causes the `Don't know` error in `pkgsCross.x86_64-freebsd.pkgsBuildHost.graphene`
because `python3` and `pygobject3` will be from `pkgsHostTarget`
and then `pygobject3` has `gobject-introspection` from `pkgsHostTarget`
and then that `gobject-introspection` will have `pkgsCross.x86_64-freebsd.pkgsCross.x86_64-freebsd.buildPackages.pkgsTargetTarget.gobject-introspection.gobject-introspection` in `depsTargetTargetPropagated`
To test that importing the python library `gi` works without `depsTargetTargetPropagated`
```nix
let
pkgs =
(import ./. {
crossSystem = (import ./lib).systems.examples.aarch64-multiplatform;
# On `master` uncomment this and comment `propagatedBuildInputs` below and you'll get
# error: Don't know how to run x86_64-unknown-freebsd executables.
#crossSystem = (import ./lib).systems.examples.x86_64-freebsd;
overlays = [
(_: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(_: pprev: {
pygobject3-test = pprev.pygobject3.overrideAttrs {
propagatedBuildInputs = [
pprev.pycairo
(prev.gobject-introspection.overrideAttrs { depsTargetTargetPropagated = [ ]; })
];
};
})
];
})
];
}).pkgs;
pyr = pkgs.pkgsBuildHost.python3Packages.python.withPackages (pp: [ pp.pygobject3-test ]);
in
pkgs.pkgsBuildBuild.runCommand "test" { } ''
"${pyr.interpreter}" -c "import gi" && touch "$out"
''
```
In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
https://gitlab.gnome.org/GNOME/gobject-introspection/-/compare/1.76.1...1.78.1
NEWS look okay.
* Update the GIR data
* Add GObject as a dependency for the Cairo GIR
* Update regression test suite
* Support different prefix for finding GIR data
* Add GI_GIR_PATH environment variable for controlling GIR paths
The build system changes are suspect – `gir_dir_prefix` is assumed to be relative,
but it takes the value from `datadir` option, which is not generally relative.
Though, currently, the variable is not stringly concatenated anywhere
other than in a code path where its value comes from eponymous option,
which is documented as “Intermediate prefix for gir installation under ${prefix}”,
so it can probably be assumed to be relative there.
Changelog-reviewed-by: Bobby Rong <rjl931189261@126.com>
Changelog-reviewed-by: Jan Tojnar <jtojnar@gmail.com>
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
so we can propagate the dev output
during the build of i3ipc-glib with strictDeps enabled i noticed that
gobject-introspection was not being detected and it was due to
gobject-introspection path not being in the PKG_CONFIG_PATH variable
this commit makes gobject-introspection get detected when build==host
the wrong path was used in gir files because the format of objdump is
different from ldd so the regex in gobject-introspection doesn't work
https://gitlab.gnome.org/GNOME/gobject-introspection/-/blob/main/giscanner/shlibs.py#L42-57
<namespace name="GLib"
shared-library="/nix/store/pak6rr8wdnbwa1iq2ldvg8pa8zahl3r1-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0/lib/libgobject-2.0.so.0,/nix/store/pak6rr8wdnbwa1iq2ldvg8pa8zahl3r1-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0/lib/libglib-2.0.so.0"
objdump
gobject-introspection> NEEDED libgmodule-2.0.so.0
gobject-introspection> NEEDED libglib-2.0.so.0
ldd
gobject-introspection> libgmodule-2.0.so.0 => /nix/store/ngm1wbwms13c2crsvrah2ypfj0b2yii5-glib-2.73.2/lib/libgmodule-2.0.so.0 (0x00007ffff7d6e000)
gobject-introspection> libglib-2.0.so.0 => /nix/store/ngm1wbwms13c2crsvrah2ypfj0b2yii5-glib-2.73.2/lib/libglib-2.0.so.0 (0x00007ffff7c32000)
i should probably move to use the wrapper when host != build and do the
canExecute things inside the wrapper.nix
then i could use gobject-introspection-unwrapped in it even when
host == build
void also adds gobject-introspection to makeDepends when its gir build
helper is used
Commit msg of 767e0880d4
> gobject-introspection: replace prelink-rtld with objdump -p
>
> g-i internally processes the output with regexes, and seems
> happy with what objdump is printing. It only needs to resolve
> the library name as passed to the linker to the library file name.
> Also recursive resolution (that ldd is doing and objdump is not)
> is not necessary.
Additional context section of https://github.com/NixOS/nixpkgs/issues/183071
> prelink is dropped by openembedded, support for prelink is removed from glibc,
> and itself is effectively abandoned by the upstream (yocto project).
> I think we may as well drop it rather than fix it.
> However gobject-introspection now relies on it as a runtime linker for use in cross compilation, we have to find an alternative.
broke modemmanager and some of its deps
libqmi-aarch64-unknown-linux-gnu> GISCAN Qmi-1.0.gir
libqmi-aarch64-unknown-linux-gnu> /build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/.libs/Qmi-1.0: error while loading shared libraries: libqmi-glib.so.5: cannot open shared object file: No such file or directory
libqmi-aarch64-unknown-linux-gnu> Command '['/nix/store/wr4mjr9gadvwz6c88fgz4ldzn21sxkpz-qemu-7.0.0/bin/qemu-aarch64', '/build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/.libs/Qmi-1.0', '--introspect-dump=/build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/functions.txt,/build/libqmi-1.30.8/src/libqmi-glib/tmp-introspect2d8e4td2/dump.xml']' returned non-zero exit status 127.
libqmi-aarch64-unknown-linux-gnu> make[4]: *** [/nix/store/jwpcacx8sd4vj0ckk5wxrzn2iwcpp35s-gobject-introspection-aarch64-unknown-linux-gnu-1.72.0-dev/share/gobject-introspection-1.0/Makefile.introspection:156: Qmi-1.0.gir] Error 1