Invalid, Meson-generated, valac arguments break the build

Bug #1698256 reported by Dan S.
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
simple-scan (Ubuntu)
Triaged
Critical
Unassigned

Bug Description

I'm trying to build simple-scan according to the README file (on Arch). With colord, packagekit, and webp installed, Meson is building invalid args for the main build step, which prevents the project from building.

The build declaration (meson.build) generates a Python list of vala_args. The list of args looks OK getting passed into executable(). However, the auto-generated build.ninja is missing the required -D(efine) flags. As a result, it treats some of defines as filenames, and crashes.

Vala/Meson/Ninja are new to me, so I'm not sure if the problem is with the build file, or the Meson generator, or what.

# ./src/meson.build
# If all three packages are installed, they're built into the Python list. Somehow, the -D flags disappear during build generation
vala_args = [ '--pkg=posix', '--vapidir=' + meson.current_source_dir () ]
dependencies = [ glib_dep, gtk_dep, zlib_dep, cairo_dep, gdk_pixbuf_dep, gusb_dep, sane_dep ]
if colord_dep.found ()
    vala_args += [ '-D', 'HAVE_COLORD' ]
    dependencies += colord_dep
endif
if packagekit_dep.found ()
    vala_args += [ '-D', 'HAVE_PACKAGEKIT' ]
    dependencies += packagekit_dep
endif
if webp_dep.found () and (not colord_dep.found () or webpmux_dep.found ()) # Webpmux only required if colord
    vala_args += [ '-D', 'HAVE_WEBP' ]
    dependencies += [ webp_dep, webpmux_dep ]
endif

simple_scan = executable ('simple-scan',
                          [ 'config.vapi',
                            'app-window.vala',
                            'authorize-dialog.vala',
                            'book.vala',
                            'book-view.vala',
                            'page.vala',
                            'page-view.vala',
                            'preferences-dialog.vala',
                            'simple-scan.vala',
                            'scanner.vala',
                            'screensaver.vala',
                            'autosave-manager.vala' ] + resources,
                          dependencies: dependencies,
                          vala_args: vala_args,
                          c_args: [ '-DVERSION="@0@"'.format (meson.project_version ()),
                                    '-DGETTEXT_PACKAGE="simple-scan"',
                                    '-DLOCALE_DIR="@0@"'.format (localedir),
                                    '-DICON_DIR="@0@"'.format (icondir),
                                    '-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE' ],
                          link_args: [ '-lm' ],
                          install: true )

# ./build/build.ninja
# Snippet of the bad build step. Note the -D flag is missing (at the end)
build src/simple-scan@exe/app-window.c src/simple-scan@exe/authorize-dialog.c src/simple-scan@exe/book.c src/simple-scan@exe/book-view.c src/simple-scan@exe/page.c src/simple-scan@exe/page-view.c src/simple-scan@exe/preferences-dialog.c src/simple-scan@exe/simple-scan.c src/simple-scan@exe/scanner.c src/simple-scan@exe/screensaver.c src/simple-scan@exe/autosave-manager.c: vala_COMPILER ../src/config.vapi ../src/app-window.vala ../src/authorize-dialog.vala ../src/book.vala ../src/book-view.vala ../src/page.vala ../src/page-view.vala ../src/preferences-dialog.vala ../src/simple-scan.vala ../src/scanner.vala ../src/screensaver.vala ../src/autosave-manager.vala
 ARGS = -C --debug --pkg libwebpmux --pkg libwebp --pkg packagekit-glib2 --pkg colord --pkg sane-backends --pkg gusb --pkg gdk-pixbuf-2.0 --pkg cairo --pkg zlib --pkg gtk+-3.0 --target-glib '$ 2.38' --pkg glib-2.0 -d src/simple-scan@exe --gresources=../src/simple-scan.gresource.xml --pkg=posix --vapidir=/home/dan/Projects/simple-scan/src HAVE_COLORD HAVE_PACKAGEKIT -D HAVE_WEBP

Revision history for this message
Dan S. (dan4launchpad) wrote :

I upgraded to the newly released Meson build 0.41.1 (from 0.40.1), and this isn't a problem anymore...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in simple-scan (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I had the same issue. I'm assuming a regression in Meson, but I haven't checked.

Changed in simple-scan (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Critical
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.