Bug 251509

Summary: Mk/Uses/gnome.mk: USE_GNOME_IMPL does not propagate :build etc, creating bogus dependencies
Product: Ports & Packages Reporter: Val Packett <val>
Component: Ports FrameworkAssignee: freebsd-x11 (Nobody) <x11>
Status: Closed FIXED    
Severity: Affects Only Me CC: manu, ports-bugs, val, zeising
Priority: --- Flags: bugzilla: maintainer-feedback? (x11)
Version: Latest   
Hardware: Any   
OS: Any   

Description Val Packett 2020-12-01 18:46:05 UTC
graphics/libdrm has this:

MANPAGES_USE=		GNOME=libxslt:build

Obviously the intention is to use libxslt only during the build.

Now, gnome.mk has:

libxslt_USE_GNOME_IMPL=	libxml2

and the way these implications are handled is (minus the unknown check):

. for component in ${USE_GNOME:C/^([^:]+).*/\1/}
_USE_GNOME+=	${${component}_USE_GNOME_IMPL} ${component}
. endfor

Oops, the :build flag is lost (literally deleted by the :C/../../ and never handled), not propagated, so we basically have USE_GNOME=libxml2 — so this ends up in the pkg +MANIFEST:

  "deps": {
    "libpciaccess": {
      "origin": "devel/libpciaccess",
      "version": "0.16"
    },
    "libxml2": {
      "origin": "textproc/libxml2",
      "version": "2.9.10_1"
    }
  },
 
But libdrm does not actually depend on libxml2 at runtime!!

---

How I noticed this is that poudriere fails to install anything that depends on libdrm:

===>   mesa-devel-20.3.b.786 depends on package: libva>0 - not found
===>   Installing existing package /packages/All/libva-2.9.1.tzst
[unrelenting.technology] Installing libva-2.9.1...
[unrelenting.technology] `-- Installing libXfixes-5.0.3_2...
[unrelenting.technology] `-- Extracting libXfixes-5.0.3_2: .......... done
[unrelenting.technology] `-- Installing libdrm-2.4.103,1...
[unrelenting.technology] |   `-- Installing libpciaccess-0.16...
[unrelenting.technology] |   | `-- Installing pciids-20201025...
[unrelenting.technology] |   | `-- Extracting pciids-20201025: ..... done
[unrelenting.technology] |   `-- Extracting libpciaccess-0.16: ......... done
pkg-static: Missing dependency 'libxml2'


…granted, it *shouldn't* fail, it should find the libxml2 dependency, which of course *was* added to RUN_DEPENDS at the port level, so something went wrong in poudriere for me here. but I'm glad it did, because idk if anyone would've found that issue otherwise.
Comment 1 Niclas Zeising freebsd_committer freebsd_triage 2020-12-01 20:01:34 UTC
To be honest, this looks like a bug in gnome.mk rather than libdrm.
Comment 2 Val Packett 2020-12-02 01:05:14 UTC
(In reply to Niclas Zeising from comment #1)

Yes – that's why the title begins with gnome.mk :)

I wonder how bugzilla decided to assign to x11. First word of the text also counts, not just the title?
Comment 3 Emmanuel Vadot freebsd_committer freebsd_triage 2021-11-19 15:13:29 UTC
pkg info -d libdrm
libdrm-2.4.108,1:
	libpciaccess-0.16
Seems fixed.