Bug 231969

Summary: graphics/gdk-pixbuf2: Build fails when value of WRKDIRPREFIX matches '^/usr[^/]+(/[^/]+)*$'
Product: Ports & Packages Reporter: Yasuhiro KIMURA <yasu>
Component: Individual Port(s)Assignee: freebsd-gnome mailing list <gnome>
Status: New ---    
Severity: Affects Only Me CC: ajacoutot, gergely.czuczy, riggs
Priority: --- Flags: bugzilla: maintainer-feedback? (gnome)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234784

Description Yasuhiro KIMURA 2018-10-05 01:50:06 UTC
After ports r480951 build fails when value of WRKDIRPREFIX matches '^/usr.+(/.+)*$'.

For example the problem happens when the value is

- /usrabdefg
- /usr.ports.work
- /usraaa/bbb/ccc/ddd/work

but it does not happen when the value is

- Empty (i.e. WRKDIRPREFIX is not set.)
- /work
- /abcusredf
- /usr/aaa/bbb/ccc/ddd/work

Build failure happens as following.

root@rolling-vm-freebsd3[103]# grep WRKDIRPREFIX /etc/make.conf
WRKDIRPREFIX=/usr0/freebsd/ports/work
root@rolling-vm-freebsd3[104]# cd /usr/ports/graphics/gdk-pixbuf2
root@rolling-vm-freebsd3[105]# make
===>  License LGPL20+ accepted by the user
===>   gdk-pixbuf2-2.36.12 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gdk-pixbuf2-2.36.12 for building
===>  Extracting for gdk-pixbuf2-2.36.12
=> SHA256 Checksum OK for gnome/gdk-pixbuf-2.36.12.tar.xz.
===>  Patching for gdk-pixbuf2-2.36.12
===>   gdk-pixbuf2-2.36.12 depends on package: docbook-xsl>0 - found
===>   gdk-pixbuf2-2.36.12 depends on executable: msgfmt - found
===>   gdk-pixbuf2-2.36.12 depends on executable: g-ir-scanner - found
===>   gdk-pixbuf2-2.36.12 depends on executable: xsltproc - found
===>   gdk-pixbuf2-2.36.12 depends on executable: meson - found
===>   gdk-pixbuf2-2.36.12 depends on executable: ninja - found
===>   gdk-pixbuf2-2.36.12 depends on package: pkgconf>=1.3.0_1 - found
===>   gdk-pixbuf2-2.36.12 depends on file: /usr/local/bin/python3.6 - found
===>   gdk-pixbuf2-2.36.12 depends on executable: update-mime-database - found
===>   gdk-pixbuf2-2.36.12 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   gdk-pixbuf2-2.36.12 depends on shared library: libpng.so - found (/usr/local/lib/libpng.so)
===>   gdk-pixbuf2-2.36.12 depends on shared library: libtiff.so - found (/usr/local/lib/libtiff.so)
===>   gdk-pixbuf2-2.36.12 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   gdk-pixbuf2-2.36.12 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so)
===>   gdk-pixbuf2-2.36.12 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   gdk-pixbuf2-2.36.12 depends on shared library: libxml2.so - found (/usr/local/lib/libxml2.so)
===>   gdk-pixbuf2-2.36.12 depends on shared library: libjpeg.so - found (/usr/local/lib/libjpeg.so)
===>  Configuring for gdk-pixbuf2-2.36.12
===>   FreeBSD 10 autotools fix applied to /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/config.rpath
The Meson build system
Version: 0.46.1
Source dir: /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12
Build dir: /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/_build
Build type: native build
Project name: gdk-pixbuf
Native C compiler: cc (clang 6.0.0 "FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)")
Appending CFLAGS from environment: '-O2 -pipe  -fstack-protector -isystem /usr/local/include -fno-strict-aliasing '
Appending LDFLAGS from environment: ' -fstack-protector -L/usr/local/lib '
Appending CPPFLAGS from environment: '-isystem /usr/local/include'
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/local/bin/pkgconf (1.5.3)
Native dependency gio-2.0 found: YES 2.56.1
Has header "unistd.h": YES
Has header "sys/resource.h": YES
Has header "sys/time.h": YES
Library m found: YES
Checking for function "round": YES
Checking for function "lrint": YES
Checking if "sigsetjmp" links: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wformat=2: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wdeclaration-after-statement: YES
Compiler for C supports arguments -Wunused: YES
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wlogical-op: NO
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -Wno-int-conversion: YES
Compiler for C supports arguments -Wno-uninitialized: YES
Compiler for C supports arguments -Wno-discarded-qualifiers: NO
Compiler for C supports arguments -Werror=implicit: YES
Compiler for C supports arguments -Werror=nonnull: YES
Compiler for C supports arguments -Werror=init-self: YES
Compiler for C supports arguments -Werror=main: YES
Compiler for C supports arguments -Werror=missing-braces: YES
Compiler for C supports arguments -Werror=sequence-point: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=trigraphs: YES
Compiler for C supports arguments -Werror=array-bounds: YES
Compiler for C supports arguments -Werror=write-strings: YES
Compiler for C supports arguments -Werror=address: YES
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES
Compiler for C supports arguments -Werror=empty-body: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Native dependency gobject-2.0 found: YES 2.56.1
Native dependency gmodule-no-export-2.0 found: YES 2.56.1
Native dependency shared-mime-info found: YES 1.8
Native dependency libpng16 found: YES 1.6.35
Has header "jpeglib.h": YES
Library jpeg found: YES
Checking for function "jpeg_destroy_decompress": YES
Checking for function "jpeg_simple_progression": YES
Native dependency libtiff-4 found: YES 4.0.9
Configuring config.h using configuration
Configuring gdk-pixbuf-2.0.pc using configuration
Program build-aux/gen-resources.py found: YES (/usr/bin/env python3 /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-resources.py)
Program build-aux/gen-installed-test.py found: YES (/usr/bin/env python3 /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-installed-test.py)
Program build-aux/gen-thumbnailer.py found: YES (/usr/bin/env python3 /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-thumbnailer.py)
Configuring gdk-pixbuf-features.h using configuration
Native dependency glib-2.0 found: YES 2.56.1
Native dependency gobject-introspection-1.0 found: YES 1.56.1
Library X11 found: YES
Configuring gdk-pixbuf-xlib-2.0.pc using configuration
Configuring version.xml using configuration
Native dependency glib-2.0 found: YES 2.56.1
Program xsltproc found: YES (/usr/local/bin/xsltproc)
Build targets in project: 78
Found ninja-1.8.2 at /usr/local/bin/ninja
===>  Building for gdk-pixbuf2-2.36.12
[1/160] /usr/local/bin/glib-genmarshal --prefix _gdk_pixbuf_marshal --output gdk-pixbuf/gdk-pixbuf-marshal.c --body ../gdk-pixbuf/gdk-pixbuf-marshal.list --include-header gdk-pixbuf-marshal.h
INFO: Reading ../gdk-pixbuf/gdk-pixbuf-marshal.list...
[2/160] /usr/local/bin/glib-genmarshal --prefix _gdk_pixbuf_marshal --output gdk-pixbuf/gdk-pixbuf-marshal.h --pragma-once --header ../gdk-pixbuf/gdk-pixbuf-marshal.list
INFO: Reading ../gdk-pixbuf/gdk-pixbuf-marshal.list...
[3/160] /usr/bin/env python3 /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-installed-test.py --testbindir=/usr/local/libexec/installed-tests/gdk-pixbuf-2.0 --testbin=animation tests/animation.test
FAILED: tests/animation.test 
/usr/bin/env python3 /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-installed-test.py --testbindir=/usr/local/libexec/installed-tests/gdk-pixbuf-2.0 --testbin=animation tests/animation.test
env: python3: No such file or directory
[4/160] cc -Igdk-pixbuf/pixops/gdk-pixbuf@pixops@@timescale@exe -Igdk-pixbuf/pixops -I../gdk-pixbuf/pixops -I. -I../ -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_XOPEN_SOURCE -O2 -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -pthread  -MD -MQ 'gdk-pixbuf/pixops/gdk-pixbuf@pixops@@timescale@exe/timescale.c.o' -MF 'gdk-pixbuf/pixops/gdk-pixbuf@pixops@@timescale@exe/timescale.c.o.d' -o 'gdk-pixbuf/pixops/gdk-pixbuf@pixops@@timescale@exe/timescale.c.o' -c ../gdk-pixbuf/pixops/timescale.c
[5/160] /usr/local/bin/python3.6 /usr/local/bin/meson --internal exe /usr0/freebsd/ports/work/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/_build/meson-private/meson_exe_glib-mkenums_984887d5223dc4001278a150e55f0ee7889e4d3d.dat
[6/160] cc -Igdk-pixbuf/pixops/gdk-pixbuf@pixops@@pixops@sta -Igdk-pixbuf/pixops -I../gdk-pixbuf/pixops -I. -I../ -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_XOPEN_SOURCE -O2 -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -fPIC -pthread  -MD -MQ 'gdk-pixbuf/pixops/gdk-pixbuf@pixops@@pixops@sta/pixops.c.o' -MF 'gdk-pixbuf/pixops/gdk-pixbuf@pixops@@pixops@sta/pixops.c.o.d' -o 'gdk-pixbuf/pixops/gdk-pixbuf@pixops@@pixops@sta/pixops.c.o' -c ../gdk-pixbuf/pixops/pixops.c
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/gdk-pixbuf2
root@rolling-vm-freebsd3[106]#
Comment 1 Yasuhiro KIMURA 2018-10-06 05:15:23 UTC
(In reply to Yasuhiro KIMURA from comment #0)

> After ports r480951 build fails when value of WRKDIRPREFIX matches '^/usr.+(/.+)*$'.

This pattern is wrong. Correct one is '^/usr[^/]+(/[^/]+)*$'.
Comment 2 gergely.czuczy 2018-10-21 11:56:54 UTC
I'm also getting this on 13-CURRENT on aarch64:

Failing build line:
cc -Itests/tests@@cve-2015-4491@exe -Itests -I../tests -I. -I../ -Igdk-pixbuf -I../gdk-pixbuf -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_XOPEN_SOURCE -O2 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -pthread -Wpointer-arith -Wformat=2 -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wcast-align -Wmissing-noreturn -Wmissing-format-attribute -fno-strict-aliasing -Wno-int-conversion -Wno-uninitialized -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=empty-body -fvisibility=hidden  -MD -MQ 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o' -MF 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o.d' -o 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o' -c tests/resources.c
cc: error: no such file or directory: 'tests/resources.c'
cc: error: no input files

All config options are unchecked.
Comment 3 gergely.czuczy 2018-10-21 12:07:24 UTC
The complete failing section. Something else is failing as well:

===>  Building for gdk-pixbuf2-2.36.12
[1/72] /usr/local/bin/g-ir-compiler gdk-pixbuf/GdkPixbuf-2.0.gir --output gdk-pixbuf/GdkPixbuf-2.0.typelib
[2/72] /usr/bin/env python3 /usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-resources.py --pixdata=/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/_build/gdk-pixbuf/gdk-pixbuf-pixdata --loaders=/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/_build/gdk-pixbuf/loaders.cache --sourcedir=/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/tests --source ../tests/resources.gresource.xml tests/resources.c
failed to load "/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/tests/icc-profile.png": Couldn?t recognize the image file format for file ?/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/tests/icc-profile.png?
../tests/resources.gresource.xml: Child process exited with code 1.
[3/72] /usr/bin/env python3 /usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/build-aux/gen-resources.py --pixdata=/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/_build/gdk-pixbuf/gdk-pixbuf-pixdata --loaders=/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/_build/gdk-pixbuf/loaders.cache --sourcedir=/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/tests --header ../tests/resources.gresource.xml tests/resources.h
failed to load "/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/tests/icc-profile.png": Couldn?t recognize the image file format for file ?/usr/ports/graphics/gdk-pixbuf2/work/gdk-pixbuf-2.36.12/tests/icc-profile.png?
../tests/resources.gresource.xml: Child process exited with code 1.
[4/72] cc -Itests/tests@@cve-2015-4491@exe -Itests -I../tests -I. -I../ -Igdk-pixbuf -I../gdk-pixbuf -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_XOPEN_SOURCE -O2 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -pthread -Wpointer-arith -Wformat=2 -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wcast-align -Wmissing-noreturn -Wmissing-format-attribute -fno-strict-aliasing -Wno-int-conversion -Wno-uninitialized -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=empty-body -fvisibility=hidden  -MD -MQ 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o' -MF 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o.d' -o 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o' -c tests/resources.c
FAILED: tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o
cc -Itests/tests@@cve-2015-4491@exe -Itests -I../tests -I. -I../ -Igdk-pixbuf -I../gdk-pixbuf -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_XOPEN_SOURCE -O2 -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -pthread -Wpointer-arith -Wformat=2 -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wcast-align -Wmissing-noreturn -Wmissing-format-attribute -fno-strict-aliasing -Wno-int-conversion -Wno-uninitialized -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=empty-body -fvisibility=hidden  -MD -MQ 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o' -MF 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o.d' -o 'tests/tests@@cve-2015-4491@exe/meson-generated_.._resources.c.o' -c tests/resources.c
cc: error: no such file or directory: 'tests/resources.c'
cc: error: no input files
ninja: build stopped: subcommand failed.
*** Error code 1
Comment 4 Thomas Zander freebsd_committer 2019-01-09 14:12:34 UTC
(In reply to gergely.czuczy from comment #3)

This one is not related to the WRKDIRPRFIX issue, but a concurrency problem. Have a look at bug #234784. I have described a workaround that happened to work on my machine.