Bug 246997

Summary: graphics/mesa-dri: configure failed without wayland
Product: Ports & Packages Reporter: Ivan Rozhuk <rozhuk.im>
Component: Individual Port(s)Assignee: freebsd-x11 (Nobody) <x11>
Status: Closed FIXED    
Severity: Affects Many People CC: danfe, driesm, madpilot, manu, mbeis, mfechner, o.hushchenkov, ohartmann, rozhuk.im, zeising
Priority: --- Flags: bugzilla: maintainer-feedback? (x11)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Specify platform based on the option
none
Specify platform in mesa-dri and mesa-libs based on options.
none
Proper platform options
none
better platform none

Description Ivan Rozhuk 2020-06-05 09:52:46 UTC
I have no wayland in system and unset option in mesa port, but get:

Using 'PKG_CONFIG' from environment with value: 'pkgconf'
Found pkg-config: /usr/local/bin/pkgconf (1.6.3)
Found CMake: /usr/local/bin/cmake (3.17.3)
Build-time dependency wayland-scanner found: NO (tried pkgconfig and cmake)

meson.build:1317:2: ERROR: Dependency "wayland-scanner" not found, tried pkgconfig and cmake

A full log can be found at /tmp/ports/usr/ports/graphics/mesa-dri/work/mesa-19.0.8/_build/meson-logs/meson-log.txt
===>  Script "configure" failed unexpectedly.
Please report the problem to x11@FreeBSD.org [maintainer] and attach the
"/tmp/ports/usr/ports/graphics/mesa-dri/work/mesa-19.0.8/_build/meson-logs/meson-log.txt"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
Comment 1 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-05 10:04:52 UTC
I see the problem, platforms defaults to auto which contain wayland.
I'll send a patch in a few minutes.
Comment 2 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-05 10:15:30 UTC
Created attachment 215245 [details]
Specify platform based on the option

Could you try this patch ?
Comment 3 Niclas Zeising freebsd_committer freebsd_triage 2020-06-05 14:18:01 UTC
*** Bug 247000 has been marked as a duplicate of this bug. ***
Comment 4 Niclas Zeising freebsd_committer freebsd_triage 2020-06-05 14:39:30 UTC
*** Bug 247002 has been marked as a duplicate of this bug. ***
Comment 5 Alexey Dokuchaev freebsd_committer freebsd_triage 2020-06-05 14:41:32 UTC
I've patched out 'wayland' myself (essentially identical as suggested patch), but the build still fails for me on 11.3/i386:

src/util/libmesa_util.a(crc32.c.o): In function `util_hash_crc32':
crc32.c:(.text+0x19): undefined reference to `crc32'
src/util/libmesa_util.a(disk_cache.c.o): In function `cache_put':
disk_cache.c:(.text+0xef3): undefined reference to `deflateInit_'
disk_cache.c:(.text+0xf42): undefined reference to `deflate'
disk_cache.c:(.text+0xfc7): undefined reference to `deflateEnd'
disk_cache.c:(.text+0x1098): undefined reference to `deflateEnd'
src/util/libmesa_util.a(disk_cache.c.o): In function `disk_cache_get':
disk_cache.c:(.text+0x1453): undefined reference to `inflateInit_'
disk_cache.c:(.text+0x146a): undefined reference to `inflate'
disk_cache.c:(.text+0x147b): undefined reference to `inflateEnd'
Comment 6 Niclas Zeising freebsd_committer freebsd_triage 2020-06-05 14:47:08 UTC
(In reply to Alexey Dokuchaev from comment #5)

I think you need ports r538015 as well.
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2020-06-05 14:48:36 UTC
Created attachment 215249 [details]
Specify platform in mesa-dri and mesa-libs based on options.

As I noted in bug #247000 it looks like bot mesa-dri and mesa-libs require similar patches.

I'm having success building both mesa-libs and mesa-dri with this revised patch.

The build is still running so I'll require a little time before being able to run test the resulting binaries.
Comment 8 Alexey Dokuchaev freebsd_committer freebsd_triage 2020-06-05 15:03:29 UTC
(In reply to Niclas Zeising from comment #6)
> I think you need ports r538015 as well.
I do have it, and it looks like it's related to "ld.lld: error: undefined symbol: __atomic_load_8", not {de,in}flate* functions.
Comment 9 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-05 15:07:14 UTC
(In reply to Alexey Dokuchaev from comment #5)

This is another issue where libz isn't added by meson.
I'm working on that.
Comment 10 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-05 15:08:01 UTC
(In reply to Guido Falsi from comment #7)

Yeah that's what I said on #freebsd-xorg, that mesa-libs also needs this.
Will try your patch in a few and commit if that works.
Comment 11 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-05 15:34:52 UTC
*** Bug 247006 has been marked as a duplicate of this bug. ***
Comment 12 commit-hook freebsd_committer freebsd_triage 2020-06-05 16:19:22 UTC
A commit references this bug:

Author: manu
Date: Fri Jun  5 16:18:59 UTC 2020
New revision: 538032
URL: https://svnweb.freebsd.org/changeset/ports/538032

Log:
  mesa*: Always use LLD

  LLD is already used in 12 and 13 but we still use ld.bfd by default on 11
  and for some unknown reason some mesa libs fails to build with it since the
  meson switch.

  PR:		246997
  Approved by:	zeising (x11@ implicit)

Changes:
  head/graphics/mesa-dri/Makefile.common
Comment 13 Helge Oldach 2020-06-05 18:01:33 UTC
I am still getting the same "wayland-scanner" error. Kind of confusing - is it expected that the LLD related commit has any impact?
Comment 14 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-05 19:22:08 UTC
Created attachment 215281 [details]
Proper platform options

Add a patch to define which platform options we want to compile
Each options are translated into -Dplatform=
Add a dependency on PLATFORM_WAYLAND to WAYLAND option.
Comment 15 Emmanuel Vadot freebsd_committer freebsd_triage 2020-06-06 08:55:01 UTC
Created attachment 215288 [details]
better platform

Add another IMPLIES for WAYLAND.
Comment 16 Matthias Fechner freebsd_committer freebsd_triage 2020-06-06 09:09:23 UTC
I can confirm that this patch fixed the problem:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=215288
Comment 17 Ivan Rozhuk 2020-06-06 16:57:47 UTC
Build and install without wayland* options - OK.
Comment 18 Guido Falsi freebsd_committer freebsd_triage 2020-06-06 19:19:22 UTC
I confirm that I'm running fine with the latest port version with WAYLAND disabled.
Comment 19 commit-hook freebsd_committer freebsd_triage 2023-12-12 08:19:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3297c00fc866830ecdb0b1c0b9e95f059669b279

commit 3297c00fc866830ecdb0b1c0b9e95f059669b279
Author:     Matthew Seaman <matthew@FreeBSD.org>
AuthorDate: 2023-12-12 08:12:57 +0000
Commit:     Matthew Seaman <matthew@FreeBSD.org>
CommitDate: 2023-12-12 08:12:57 +0000

    databases/py-dbt-core: chase devel/py-pathspec update

    Widen the version restriction required by the py-dbt-core port --
    changes to py-pathspec are non-breaking.  Maintainer confirms that
    only the port Makefile needs updating, so omitting adding several
    patch files as in the original PR here:
    https://bugs.freebsd.org/bugzilla/attachment.cgi?id=246997

    PR:             246997
    Approved by:    Pat Maddox (maintainer)

 databases/py-dbt-core/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)