'File could not be found' compiling from a tarball

Hi, I’m trying to compile glibmm from a tarball. I’ve done these steps:

meson setup ..
meson compile
meson install --prefix=PREFIX_DIR..

There is something weird goes on. The first time I attempt to compile glibmm, I get stuck at this step:

[1876/1879] Generating examples/settings_schemas with a custom command

Which never finishes. Aborting and trying to compile again, I get this:

C:\Program Files\Microsoft Visual Studio\18\Community>meson compile -C C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/builds/glibmm -j16
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: "C:\Program Files\Meson\ninja.EXE" -C C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/builds/glibmm -j 16
ninja: Entering directory `C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/builds/glibmm'
[2/5] Generating subprojects/mm-common/libstdc++.tag with a custom command
Did not check status of subprojects/mm-common/libstdc++.tag because network is disabled.
[4/5] Generating subprojects/libsigcplusplus/docs/docs/reference/html_and_tag with a custom command
ASSERT: "ifn!=nullptr" in E:\doxygen.git\src\tagreader.cpp (1826)
...
ASSERT: "ifn!=nullptr" in E:\doxygen.git\src\tagreader.cpp (1826)
[5/5] Generating subprojects/libsigcplusplus/docs/docs/reference/devhelp with a custom command

Which looks like a success (?) But then, when trying to install:

C:\Program Files\Microsoft Visual Studio\18\Community>meson install -C C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/builds/glibmm --destdir=C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out
ninja: Entering directory `C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\builds\glibmm'
[2/5] Generating subprojects/mm-common/libstdc++.tag with a custom command
Did not check status of subprojects/mm-common/libstdc++.tag because network is disabled.
[3/3] Generating subprojects/libsigcplusplus/docs/docs/manual/manual_xmllint with a custom command
Installing subprojects\mm-common\skeletonmm.tar.xz to C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\share/doc/mm-common
Installing subprojects\mm-common\libstdc++.tag to C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\share/mm-common/doctags
Installing subprojects\libsigcplusplus\sigc++\sigc-3.0-0.dll to C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\bin
Installing subprojects/libsigcplusplus/sigc++/sigc-3.0.lib to C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\lib
Installing subprojects\libsigcplusplus\sigc++\sigc-3.0-0.pdb to C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\bin
Installing subprojects\libsigcplusplus\docs/docs/reference\libsigc++-3.0.tag to C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\share/doc/libsigc++-3.0/reference

ERROR: File 'subprojects\\libsigcplusplus\\docs/docs/manual\\html' could not be found

I don’t know much about building glibmm on Windows, but I’ll try to give you some hints.

You install glibmm from a tarball. But it looks like mm-common and libsigc++
are built as subprojects, meaning they are built from git clones.

I can’t explain why examples/settings_schemas hangs. If, for instance, glib-compile-schemas
is not found, it should stop with an error message.

The error with the missing libsigcplusplus/docs/docs/manual is less of a mystery,
although I would have expected an error message when libsigc++ was built.
libsigc++'s README.md file says

The manual is a DocBook 5.0 document. These packages are recommended when building
the manual (can have other names in other distros):
 - docbook5-xml (Ubuntu and Debian) or docbook5-schemas (Fedora)
 - docbook-xsl (Ubuntu and Debian) or docbook-style-xsl (Fedora)

It may be possible to build without these packages, but it will be slow and error prone.

I don’t know if these packages are available on Windows. I’d recommend you don’t
try to build libsigc++'s manual: meson configure -Dsigc++-3.0:build-manual=false

Probably it’s not examples/settings_schemas that hangs. It’s probably the build
of the libsigc++ manual that takes a very long time. It can take several minutes
(and then maybe fail) if the docbook packages are not installed.
ninja usually executes several jobs in parallel. The last printed line does not
always show which job is being executed.

A minor adjustment: it’s not -Dsigc+±3.0, it is -Dlibsigcplusplus. On the other hand, I’m now getting a different error:

..\..\..\..\Users\AITOR\Documents\Projects\inkscape-msvc-deps\src\glibmm-2.68.2\subprojects\libsigcplusplus\meson.build:157:2: ERROR: Command `"C:\Program Files\Meson\meson.exe" runpython C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\bin\mm-common-get --force C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/src/glibmm-2.68.2/subprojects/libsigcplusplus/untracked/build_scripts C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/src/glibmm-2.68.2/subprojects/libsigcplusplus/untracked/docs/docs` failed with status 2.

A full log can be found at C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\builds\glibmm\meson-logs\meson-log.txt

I got an email from GNOME Discourse with this error message:

Documents\Projects\inkscape-msvc-deps\src\glibmm-2.68.2\subprojects\libsigcplusplus\sigc++\meson.build:88:23: ERROR: Could not find Windows resource compiler

libsigcplusplus\sigc++\meson.build:88 contains

sigc_res = windows.compile_resources(sigc_rc)

The description at Windows module says

The resource compiler executable used is the first which exists from the following list:

  1. The windres executable given in the [binaries] section of the cross-file
  2. The RC environment variable
  3. The WINDRES environment variable
  4. The resource compiler which is part of the same toolset as the C or C++ compiler in use.

When I press the Visit Topic button in the email, I find a different error message:

..\..\..\..\Users\AITOR\Documents\Projects\inkscape-msvc-deps\src\glibmm-2.68.2\subprojects\libsigcplusplus\meson.build:157:2: ERROR: Command `"C:\Program Files\Meson\meson.exe" runpython C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\bin\mm-common-get --force C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/src/glibmm-2.68.2/subprojects/libsigcplusplus/untracked/build_scripts C:/Users/AITOR/Documents/Projects/inkscape-msvc-deps/src/glibmm-2.68.2/subprojects/libsigcplusplus/untracked/docs/docs` failed with status 2.

libsigcplusplus\meson.build:157 contains

  run_command(mm_common_get, '--force', script_dir,
    project_source_root / 'untracked' / 'docs' / 'docs',
    check: true,
  )

My guess is that the mm-common-get command does not find the files that it shall copy.
With the command at C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\bin\mm-common-get
the files shall probably exist at C:\Users\AITOR\Documents\Projects\inkscape-msvc-deps\out\share\mm-common.
The value of pkgdatadir in bin/mm-common-get determines where mm-common-get
searches for the files to copy.

Thanks for doing the detailed analysis. I prefer to debug the issue myself from now on. Thanks!!

WORKAROUND: maintainer-mode somehow was being set to true, which it should never be when compiling from a tarball. I manually patched the script and set it to false, but a more elegant fix should be in order.

Probably had something to do with my local cache.