Skip to content

gnome.mkenums generates huge command which causes command line too long error #6710

Open
@AlexanderplUs

Description

@AlexanderplUs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions