Bug 257091 - graphics/cairo: cairo-1.17.4 failed to build
Summary: graphics/cairo: cairo-1.17.4 failed to build
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-10 05:16 UTC by crypt47
Modified: 2022-04-11 12:11 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (desktop)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description crypt47 2021-07-10 05:16:20 UTC
build with pourdrie, failed during install stage:

Making install in micro
/usr/bin/make  install-am
make[4]: "/wrkdirs/usr/ports/graphics/cairo/work/cairo-1.17.4/Makefile" line 1525: warning: duplicate script for target "recheck" ignored
make[4]: "/wrkdirs/usr/ports/graphics/cairo/work/cairo-1.17.4/Makefile" line 1164: warning: using previous script for "recheck" defined here
make[5]: "/wrkdirs/usr/ports/graphics/cairo/work/cairo-1.17.4/Makefile" line 1525: warning: duplicate script for target "recheck" ignored
make[5]: "/wrkdirs/usr/ports/graphics/cairo/work/cairo-1.17.4/Makefile" line 1164: warning: using previous script for "recheck" defined here
====> Compressing man pages (compress-man)
===========================================================================
=======================<phase: package        >============================
===>  Building package for cairo-1.17.4,3
pkg-static: Unable to access file /wrkdirs/usr/ports/graphics/cairo/work/stage/usr/local/libdata/pkgconfig/cairo-glx.pc:No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/cairo
=>> Cleaning up wrkdir
===>  Cleaning for cairo-1.17.4,3
Comment 1 crypt47 2021-07-10 05:23:36 UTC
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_SET+=GLIB
OPTIONS_FILE_SET+=X11
OPTIONS_FILE_SET+=XCB
OPTIONS_FILE_SET+=OPENGL
OPTIONS_FILE_UNSET+=GLESV2
Comment 2 crypt47 2021-07-10 05:30:15 UTC
with

OPTIONS_FILE_UNSET+=OPENGL
OPTIONS_FILE_SET+=GLESV2

builds fine.
Comment 3 crypt47 2021-07-10 08:34:18 UTC
found a more recent report

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256800
Comment 4 Ghost 2021-07-10 11:14:53 UTC
pkg cluster with the unmodified options cannot reproduce:
http://beefy16.nyi.freebsd.org/data/130amd64-default/6e40bf8661e0/logs/cairo-1.17.4,3.log
http://www.ipv6proxy.net/go.php?u=http%3A%2F%2Fbeefy16.nyi.freebsd.org%2Fdata%2F130amd64-default%2F6e40bf8661e0%2Flogs%2Fcairo-1.17.4%2C3.log&b=0&f=norefer

In your case, the pkg-plist entry check
%%OPENGL%%%%X11%%libdata/pkgconfig/cairo-glx.pc
fails because you have X11 on for graphics/cairo, but cairo-glx.pc
does not build. In most cases, this is caused by a GL provider
(libglvnd and/or mesa-*) built without X11. Ports framework doesn't
check the required provider OPTIONS for consumers.

What are you trying to achieve, a headless server or a desktop?

OPTIONS_FILE_* seems to be obscure (an old/deprecated way of setting
OPTIONS?). Consider "OPTIONS_(UN)SET+=" for global and foo_bar_(UN)SET+=
(category/port -> category_port) for per port OPTIONS, e.g.:

OPTIONS_SET+=   FOO
OPTIONS_UNSET+= BAR
foo_bar_SET+=   BAZ
foo_bar_UNSET+= BZZ

Can you post your poudriere log file?
Comment 5 tech-lists 2021-12-20 18:27:21 UTC
The problem is still happening, if the defaults are used

The workaround is to unset OPENGL and to set GLESV2.

the make.conf:

MAKE_JOBS_NUMBER=4
WITH_CCACHE_BUILD=YES
CCACHE_DIR=/var/cache/ccache
WITH_MANCOMPRESS=YES
OPTIONS_UNSET+=DEBUG INFO CUPS BITMAPS SCDAEMON WKS_SERVER
OPTIONS_SET+=OPTIMIZED_CFLAGS CPU_OPTS OPENMP GMP LZO LZ4 ZSTD BROTLI
OPTIONS_SET+=DOCS DOXYGEN EXAMPLES MANPAGES MAN LARGE_RSA NLS GSSAPI_NONE SUID_GPG LIBSECRET
OPTIONS_SET+=METALINK PCRE2 TAINTWARN
DEFAULT_VERSIONS+=ImageMagick=7
LICENSES_ACCEPTED+=GPLv2+ MSPAT PDFlib

context is a headless rpi4b running main-n251742-cfca19c28e5
Comment 6 bsd 2022-04-09 05:58:49 UTC
(In reply to Evgeniy Khramtsov from comment #4)

Accidentally, I came through this issue as well. I think the problem is in graphics/libglvnd default option X11 value is OFF, while in graphics/cairo the same option is ON. I use generally default options with minor modifications (like DOCS OFF for ports I am not interested in more than just build-and-forget manner).
Comment 7 bsd 2022-04-09 06:15:09 UTC
(In reply to bsd from comment #6)

Another explanation in my case may be that default is ON, but somehow erroneously was reset locally. Is there any possibility to check option value in some dependent port?
Comment 8 Adriaan de Groot freebsd_committer freebsd_triage 2022-04-10 19:40:07 UTC
Closing 257091 and 251058 because they seem to be related mis-configurations of ports. graphics/libglvnd and graphics/cairo both have option X11, default on, and Mesa builds with PLATFORM_X11. You need to have sufficiently-consistent ports options, and the current framework has no way of checking or enforcing sensible providers-options in consuming ports.

Note comments from 251058 (mostly from Jan Beich):
- relevant review has landed
- radio button can be switched off (it isn't an OPTIONS_SINGLE)

If there are specific settings (options, set in `make.conf`) that should make sense, but fail to build, then please open another PR with explicit and detailed steps to reproduce (e.g. "start with a fresh 12.3 VM, portsnap fetch extract, then use this make.conf, build graphics/cairo with BATCH=1 and notice it failing like-so")
Comment 9 Ghost 2022-04-11 12:11:16 UTC
$ env -S P="/usr/ports" C="graphics/cairo" D="/tmp" BATCH=yes sh
$ make -C "$P/$C" WRKDIR="$D/$(basename $C)" extract && cd "$D"/$(basename $C)/*
$ rg -l 'cairo-glx.pc' | sort
configure
doc/public/Makefile.in
src/Makefile.am.features
src/Makefile.in
src/Makefile.win32.features

cairo builds cairo-glx.pc if use_glx is defined to yes:

$ rg --regexp 'ac_config_files.*cairo-glx.pc' -A 3 -B 2 configure
29900-					if test "x$use_glx" = xyes; then :
29901-  :
29902:		ac_config_files="$ac_config_files src/cairo-glx.pc:src/cairo-features.pc.in"
29903-
29904-
29905-fi

cairo defines use_glx to yes, then redefines it to no if GLX was not found:

$ rg --regexp 'use_glx=yes' -B 3 configure
29729-$as_echo_n "checking for cairo's GLX functions feature... " >&6; }
29730-		echo
29731-
29732:		use_glx=yes

$ rg --regexp 'test.*ac_cv_header_GL_glx_h' -A 4 -B 4 configure
29743-  if test "x$need_glx_functions" = "xyes"; then
29744-    save_CFLAGS="$CFLAGS"
29745-    CFLAGS="$CFLAGS $gl_CFLAGS $gl_NONPKGCONFIG_CFLAGS"
29746-    ac_fn_c_check_header_mongrel "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" "$ac_includes_default"
29747:if test "x$ac_cv_header_GL_glx_h" = xyes; then :
29748-
29749-else
29750-  use_glx="no (GLX headers not found)"
29751-fi

GL/glx.h is provided by graphics/libglvnd when built with X11=on:

$ rg -H 'GL/glx.h' -g '**/pkg-plist' -C0 $P/
/usr/ports/graphics/libglvnd/pkg-plist
%%X11%%include/GL/glx.h

X11 is on by default for graphics/libglvnd:

$ rg 'OPTIONS_DEFAULT' "$P"/graphics/libglvnd
/usr/ports/graphics/libglvnd/Makefile
OPTIONS_DEFAULT=X11

cairo X11=on GL/glx.h dependency is bootlegged via USE_GL which pulls libglvnd:

$ rg OPENGL "$P"/$C
/usr/ports/graphics/cairo/Makefile
41:OPTIONS_RADIO_GL=	OPENGL GLESV2
43:OPTIONS_DEFAULT=OPENGL XCB GLIB X11
52:OPENGL_USES=	gl
53:OPENGL_USE=	gl=egl
54:OPENGL_CONFIGURE_ENABLE=gl egl

/usr/ports/graphics/cairo/pkg-plist
5:%%OPENGL%%include/cairo/cairo-gl.h
34:%%OPENGL%%libdata/pkgconfig/cairo-egl.pc
37:%%OPENGL%%libdata/pkgconfig/cairo-gl.pc
39:%%OPENGL%%%%X11%%libdata/pkgconfig/cairo-glx.pc

$ (cd "$P"/$C ; make -V USE_GL -V LIB_DEPENDS) | xargs -n 1 | rg -i 'egl'
egl
libEGL.so:graphics/libglvnd

One may add *_DEPENDS on glx.h or libGLX.so when graphics/cairo has OPENGL,X11 on to make dependency on libglvnd with X11=on more visible to users (fail in *-depends), but note that Uses/gl.mk doesn't have GLX component defined for USE_GL as of now. The choice may be "uses only header contents" or "uses symbols from libGLX".