Repository navigation
Description
I try to build gtk+ 3.24.14 under msys2 system on Windows with following command:
meson --prefix=/home/User/gtk_libs/compile/outputs/x86_64-pc-mingw32 --buildtype=release ---Dpkg_config_path=/home/User/gtk_libs/compile/outputs/x86_64-pc-mingw32/lib/pkgconfig -Ddefault_library=shared -Dwin32_backend=true -Dbuiltin_immodules=yes /home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+ /home/User/gtk_libs/libs/gtk+
As you can see I use separate build directory
Next I call:
ninja -C /home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+ install
which fails with error:
ninja: fatal: CreateProcess: The parameter is incorrect.
(is the command line too long?)
If I build gtk+ directly in source directory all works fine.
As I can see in generated build.ninja file there is a command with 39000+ symbols length:
COMMAND = "C:/msys64/mingw64/bin/meson" "--internal" "exe" "--capture" "gtk/gtktypebuiltins.c" "--" "C:/msys64/mingw64/bin/glib-mkenums.EXE" "--template" "C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtktypebuiltins.c.template" "C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtk.h" ...
Most part of this huge command is paths to header files:
"C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtkborder.h"
"C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtkbox.h"
"C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtkbuilder.h"
"C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtkbuildable.h"
"C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtkbutton.h"
"C:/msys64/home/User/gtk_libs/compile/intermediates/x86_64-pc-mingw32/gtk+/../../../../libs/gtk+/gtk/gtkcalendar.h"
...
If I run this command directly in console it gives Argument list too long error
This command is generated from rule in gtk/meson.build:
gtktypebuiltins = gnome.mkenums('gtktypebuiltins',
sources: gtk_public_headers + gtk_deprecated_headers + a11y_headers,
c_template: 'gtktypebuiltins.c.template',
h_template: 'gtktypebuiltins.h.template',
install_dir: join_paths(gtk_includedir, 'gtk-3.0/gtk'),
install_header: true)
The source of this problem is
d5f7ba8 which converts all relative paths to absolute in gnome.mkenums and can cause generation of too long command to execute. After I removed in build.CustomTarget(output, state.subdir, custom_kwargs, absolute_paths=True) parameter absolute_paths=True - all builds fine.
Activity
nirbheek commentedon Mar 1, 2020
I opened #4966 to fix this a year ago, but I forgot about it. I'm not sure why we use absolute paths; would have to check
git blame.AlexanderplUs commentedon Mar 1, 2020
Absolute paths are added because of #973 as I can see.
dg0yt commentedon Mar 29, 2022
I came here from research on microsoft/vcpkg#22201 (comment) (gtk3, but there seems to be a similiar issue with gtk4).
IIUC there is a the generated command line length is too long for Windows since meson switched to absolute paths.
With many tools, such problems are avoided with response files. AFAIU
gnome.mkenumsis a wrapper forglib-mkenums.https://mesonbuild.com/Gnome-module.html#gnomemkenums
And
glib-mkenumsdoes support a response file when "passed as the sole argument":https://developer-old.gnome.org/gobject/stable/glib-mkenums.html
Is this something which could be implemented?
Disclaimer: Nearly no knowledge of meson, gnome, gtk.
eli-schwartz commentedon Mar 29, 2022
Yes, absolutely. There's a PR which predates this ticket, and tried to implement it here: #4966
Unfortunately the codebase changed and it "needs to be rewritten from scratch" so it got closed.
It definitely needs to be done, we just need someone to do the work.
talregev commentedon Apr 13, 2022
Any news?
heftig commentedon Aug 26, 2024
This hit GStreamer today. https://gitlab.freedesktop.org/daniel.pendse/gstreamer/-/jobs/62727051
Error
ndufresne commentedon Oct 2, 2024
Building GTK is broken in GStreamer/Windows CI whenever someone have a long enough use name, its hitting more and more.
I see you can put the params in a file, was that attempted before ?
dg0yt commentedon Oct 3, 2024
#6710 (comment)
pgsancho commentedon Oct 3, 2024
Same here
gnome.mkenums: Use rspfiles on Windows when possible
gnome.mkenums: Use rspfiles on Windows when possible
gnome.mkenums: Use rspfiles on Windows when possible
gnome.mkenums: Use rspfiles on Windows when possible
9 remaining items
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.mkenums: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
gnome.mkenums: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible
eabase commentedon Aug 20, 2025
Why is this closed?
Has it been fixed?
pingback:
nirbheek commentedon Aug 31, 2025
Yes, gnome.mkenums now uses response files on Windows when the command is long: #14391
Version 1.8.3 and newer support it.
gnome.mkenums: Use rspfiles on Windows when possible
gnome.generate_gir: Use rspfiles on Windows when possible