ARM64 macOS 14.2.1 (23C71) build (MacPorts) fails due to missing GLib::canonicalize_filename
Summary:
macOS arm64 compile of 1.4 development version fails, possibly but not certainly because of an out of date gtkmm-2.4
in MacPorts. No online source mentions this issue, so I'm reporting it here. It's also possible that the gtkmm-2.4
version requirement should be changed to 2.64.
Steps to reproduce:
-
Updated the repository to the latest commit, and with the submodules, as recommended in the compile instructions:
git clone --recurse-submodules https://gitlab.com/inkscape/inkscape.git ./inkscape
-
To configure and compile, I use a lightly edited script recommended on the same wiki page, attached here: example_cmake_script.sh
-
ninja
Then, two files return an error on compile. The error indicates that my system has a glibmm
that does not include this function, or that my cmake
pipeline does not know where to look for the library.
What happened?
Compile fails on inkscape/src/ui/dialog/export.cpp
and inkscape/src/ui/dialog/export-batch.cpp
. The explanation is: error: no member named 'canonicalize_filename' in namespace 'Glib'
. Failures of this type have been happening for months. I waited to see if perhaps a MacPorts library update would fix the issue, but nothing yet.
glib
has had support for canonicalize_filename
since 2.64 (though, perhaps importantly, gtk.org claims it's been available since 2.58).
uname -a
yields:
Darwin <my machine name> 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
port installed | grep -i glib
yields:
dbus-glib @0.112_0 (active)
glib-networking @2.66.0_0 (active)
glib2-devel @2.78.3_1+quartz (active)
glibmm-2.4 @2.62.0_0+quartz (active)
glibmm-devel @2.78.0_0+quartz (active)
json-glib @1.8.0_0 (active)
From the GNOME documentation, we know that "glibmm-2.4
and glibmm-2.68
are different parallel-installable ABIs", so it should not be a problem to have both installed. But if version 2.62 of glibmm-2.4
lacks the canonicalize_filename
function -- note the discrepancy in the two references above -- then the compile should fail, because glibmm-2.4
would be too old.
xcodebuild -version
returns:
Xcode 15.2
Build version 15C500b
grep -Ir canonicalize_filename ./
returns three instances of this function call:
.//ui/dialog/export.cpp: return Glib::canonicalize_filename(Glib::build_filename(directory, Glib::filename_from_utf8(name)), orig);
.//ui/dialog/export-batch.cpp: return Glib::canonicalize_filename(path.raw(), doc_path);
.//path-prefix.cpp: inkscape_datadir = g_canonicalize_filename(inkscape_datadir, nullptr);
The third instance of canonicalize_filename
is a version check for Glib 2.58:
#if GLIB_CHECK_VERSION(2,58,0)
inkscape_datadir = g_canonicalize_filename(inkscape_datadir, nullptr);
#endif
It's possible that this version check should check for 2.64 and not 2.58. Relatedly, the DefineDependsandFlags.cmake
file also requires version 2.58.
What should have happened?
Compile should complete, or else the cmake
configuration should fail because at least one of the system libraries is too old.
Sample attachments:
Version info
1.4 developer; current codebase as of 19-Jan-2024