SwiftGtk: Building on Apple Silicon (arm64) and Linux 64-bit ARM (aarch64) fails
When trying to build on Apple M1, there are some problems.
Running run-gir2swift.sh does not find the gir files at all.
Output is
Everything is already up-to-date
Girs located at
Generating Swift Wrapper for Atk ... Cannot open '/GLib-2.0.gir': No such file or directory
Cannot open '/GObject-2.0.gir': No such file or directory
Cannot open '/Atk-1.0.gir': No such file or directory
[...]
Note the empty string printed as gir location.
If I manually set the gir path by changing https://github.com/rhx/gir2swift/blob/cdd15b3e0c81470ff1f48e8ec00fbb8e4797f227/gir2swift-generation-driver.sh#L161 from
GIR_PATH=$(gir_path_arg-gir-names "$ALL_GIR_NAMES")
to
GIR_PATH=/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/
the output changes to
Everything is already up-to-date
Girs located at /opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0
Building gir2swift
Generating Swift Wrapper for Atk ... Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Atk-1.0.gir': No such file or directory
/swift-gtk/.build/checkouts/SwiftAtk/gir2swift-manifest.sh: line 21: Sources/Atk/*-*.swift: No such file or directory
mv: rename Sources/Atk/*-*.swift.out to Sources/Atk/*-*.swift: No such file or directory
Generating Swift Wrapper for Cairo ...
Generating Swift Wrapper for GIO ...
Generating Swift Wrapper for GLib ... /swift-gtk/.build/checkouts/SwiftGLib/gir2swift-manifest.sh: line 21: ${src}: ambiguous redirect
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
/swift-gtk/.build/checkouts/SwiftGLib/gir2swift-manifest.sh: line 25: ${src}: ambiguous redirect
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
Generating Swift Wrapper for GModule ...
Generating Swift Wrapper for GLibObject ... /swift-gtk/.build/checkouts/SwiftGObject/gir2swift-manifest.sh: line 21: ${src}: ambiguous redirect
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
Generating Swift Wrapper for Gdk ... Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/GdkPixbuf-2.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Pango-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/PangoCairo-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Gdk-3.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/GdkPixbuf-2.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Pango-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/PangoCairo-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Gdk-3.0.gir': No such file or directory
Generating Swift Wrapper for GdkPixbuf ... Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/GdkPixbuf-2.0.gir': No such file or directory
Generating Swift Wrapper for Pango ... Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Pango-1.0.gir': No such file or directory
/swift-gtk/.build/checkouts/SwiftPango/gir2swift-manifest.sh: line 21: Sources/Pango/*-*.swift: No such file or directory
mv: rename Sources/Pango/*-*.swift.out to Sources/Pango/*-*.swift: No such file or directory
Generating Swift Wrapper for PangoCairo ... Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Pango-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/PangoCairo-1.0.gir': No such file or directory
Generating Swift Wrapper for Gtk ... Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Atk-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Gdk-3.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/GdkPixbuf-2.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Pango-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/PangoCairo-1.0.gir': No such file or directory
Cannot open '/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/Gtk-3.0.gir': No such file or directory
/swift-gtk/gir2swift-manifest.sh: line 30: ${src}: ambiguous redirect
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
Postprocessing Wrapper for *-*.swift Postprocessing Wrapper for Gtk-3.0.swift
meaning that GLib-2.0.gir and GObject-2.0.gir can now be found, but Atk-1.0.gir and others not.
This is correct, as the directory /opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0/, where my gir files seem to be located, only contains:
DBus-1.0.gir
DBusGLib-1.0.gir
GIRepository-2.0.gir
GL-1.0.gir
GLib-2.0.gir
GModule-2.0.gir
GObject-2.0.gir
Gio-2.0.gir
Vulkan-1.0.gir
cairo-1.0.gir
fontconfig-2.0.gir
freetype2-2.0.gir
gir-1.2.rnc
libxml2-2.0.gir
win32-1.0.gir
xfixes-4.0.gir
xft-2.0.gir
xlib-2.0.gir
xrandr-1.3.gir
There seem to be some different gir related problems:
- gir directory is not detected correctly (should be
/opt/homebrew/Cellar/gobject-introspection/1.66.1_1/share/gir-1.0) - Some .gir files are not available, although the corresponding brew packages are installed. For example
Atk-1.0.giris missing.
My impression is, that problem 1 is related to the build scripts and problem 2 more a problem of homebrew not generating all gir files on arm64.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (15 by maintainers)
I can confirm this. On Apple m1, I managed to start an ubuntu VM using vmcli. The resulting Linux kernel identifies itself as
Here,
./run-gir2swift.shruns without error butbuild.shfails with: