Bug 252355 - sysutils/garcon: fail to build
Summary: sysutils/garcon: fail to build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-xfce (Nobody)
Depends on:
Reported: 2021-01-02 19:04 UTC by Ivan Rozhuk
Modified: 2021-01-04 12:04 UTC (History)
3 users (show)

See Also:
madpilot: maintainer-feedback+
madpilot: merge-quarterly+

build log (57.48 KB, text/plain)
2021-01-03 04:02 UTC, Ivan Rozhuk
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2021-01-02 19:04:35 UTC
CPPFLAGS="-I/usr/local/include -DNDEBUG" CFLAGS="-O2 -pipe -O3 -pipe -funroll-loops -DSTRIP_FBSDID -D_FORTIFY_SOURCE=2 -mretpoline  -fstack-protector-strong -fno-strict-aliasing  -fdebug-prefix-map=/tmp/ports/usr/ports/sysutils/garcon/work/garcon-0.8.0=." LDFLAGS="-fstack-protector-strong  -Wl,--as-needed -Wl,-O1" CC="cc" PKG_CONFIG="pkgconf" GI_HOST_OS="" DLLTOOL="false" CC="cc" /usr/local/bin/g-ir-scanner  --add-include-path=. --warn-all -DGARCON_COMPILATION --symbol-prefix=g_ --symbol-prefix=garcon_ --c-include=garcon/garcon.h --namespace=Garcon --nsversion=1.0 --libtool="/bin/sh ../libtool"  --include=GObject-2.0 --include=GLib-2.0 --include=Gio-2.0 --include=Libxfce4util-1.0 --pkg-export=garcon-1   --library=libgarcon-1.la  --cflags-begin -I.. -DGARCON_COMPILATION -DGARCON_VERSION_API=\"1\" -DG_LOG_DOMAIN=\"garcon\" -DSYSCONFIGDIR=\"/usr/local/etc/xdg\"  --cflags-end  garcon-config.c garcon-marshal.c garcon-menu-element.c garcon-menu-separator.c garcon-menu-directory.c garcon-menu-item-action.c garcon-menu-item-pool.c garcon-menu-item-cache.c garcon-environment.c garcon-menu.c garcon-menu-item.c garcon-menu-node.c garcon-menu-tree-provider.c garcon-menu-merger.c garcon-menu-parser.c garcon.h garcon-config.h garcon-marshal.h garcon-menu-element.h garcon-menu-separator.h garcon-menu-directory.h garcon-menu-item-action.h garcon-menu-item-pool.h garcon-menu-item-cache.h garcon-environment.h garcon-menu.h garcon-menu-item.h garcon-menu-node.h garcon-menu-tree-provider.h garcon-menu-merger.h garcon-menu-parser.h libgarcon-1.la Makefile --output Garcon-1.0.gir
Couldn't find include 'Libxfce4util-1.0.gir' (search path: '['.', '/usr/local/share', 'gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0']')
gmake[5]: *** [/usr/local/share/gobject-introspection-1.0/Makefile.introspection:156: Garcon-1.0.gir] Error 1
Comment 1 Guido Falsi freebsd_committer 2021-01-02 19:23:01 UTC
Hi, I need some more information:

- revision of the ports tree

- please provide the full log of the failed build

- are you building in poudriere or on live system?

- are you using any custom option?
Comment 2 Guido Falsi freebsd_committer 2021-01-02 19:27:00 UTC
ANyway from the log snippet you provided I suspect you should rebuild x11/libxfce4util.

But have you updated all your xfce ports? Because I just committed the xfce 4.16 update and xfce ports will have to be updated together.
Comment 3 Ivan Rozhuk 2021-01-03 04:02:00 UTC
Created attachment 221219 [details]
build log
Comment 4 Ivan Rozhuk 2021-01-03 04:09:13 UTC
- latest port tree
- live system
- yes, many options customized for system and ports

find /tmp/ports/usr/ports/ -name "*ibxfce4util*.gir"
find /usr/local/ -name "*ibxfce4util*.gir"
shows that I have no this file.
All ports updated now, except garcon.

only NLS option is set.
Comment 5 Olivier Duchateau 2021-01-03 07:28:38 UTC
(In reply to rozhuk.im from comment #4)

If Libxfce4util-1.0.gir is missing, set GIR option in x11/libxfce4util (by default it is enabled).
Comment 6 Ivan Rozhuk 2021-01-03 07:32:32 UTC
(In reply to Olivier Duchateau from comment #5)

This action will not prevent other users from same error.
Comment 7 Guido Falsi freebsd_committer 2021-01-03 10:06:08 UTC
(In reply to rozhuk.im from comment #6)

Ok, I see the issue.

So garcon depends on a file that is installed only if another port is compiled with a specific option, that is enabled by default.

ports don't have any method to enforce options of dependencies, and there are a few instances of ports which are going to break if it's dependencies have non standard options. Sometimes it's unavoidable.

If a software requires a specific feature from a dependency and you disable it that software simply cannot work. Unluckily we don't have a feature to mark it BROKEN conditionally on dependencies options either, so the outcome you see is expected behaviour.

--- pedantic mode on

In general asking a user to just keep the default option enabled is acceptable in the ports tree, and the expectation to be able to disable any option in any port and not cause some other port to break is not supported

-- pedantic mode off

However it looks like garcon also grew an introspection option that can be disabled, so adding a "GIR" option there is possible.

I garcon did not have such an option there would have been no solution to your problem and the only way to prevent such an error would have been to simply remove the GIR option and make it mandatory for all it's dependencies.

I'm going to test a patch making GIR optional for garcon too.
Comment 8 Olivier Duchateau 2021-01-03 11:20:15 UTC
(In reply to Guido Falsi from comment #7)

Just for record, Garcon depends of libxfce4util, it is specified in this line [1].

Disable introspection for xfce4-conf, libxfce4util and libxfce4menu it is bad idea. Because they are core libraries.

- xfce4-notes-plugin is written in Vala, so it depends of these libraries (and even in git snapshot)
- devel release of Catfish now uses introspection of Xfconf (I have a branch, which also uses Libxfce4util, especially for gettext)
- I submitted patch (long time ago) for the xfce4-screensaver settings, in order to use introspection too (instead of Popen method) 

We can disable introspection of Garcon, but not others libraries. You need it, if you want to write (from scratch) an editor menu or new applications laucher.

I'm sad, introspection of Garcon is not "put forward" by upstream, because it already exists menu-libre.

[1] https://gitlab.xfce.org/xfce/garcon/-/blob/master/garcon/Makefile.am#L171
Comment 9 Ivan Rozhuk 2021-01-03 11:24:44 UTC
(In reply to Olivier Duchateau from comment #8)

If gir is highly required than probably better remove option from libxfce4util and always build it.
Comment 10 Olivier Duchateau 2021-01-03 12:46:42 UTC
(In reply to rozhuk.im from comment #9)

Maybe not.

In some gnome@ and desktop@ ports, there is test (e.g. x11-toolkits/pango [1]). We can add new target in order to check existence of introspection file.

[1] https://github.com/freebsd/freebsd-ports/blob/master/x11-toolkits/pango/Makefile#L49
Comment 11 Guido Falsi freebsd_committer 2021-01-03 17:32:14 UTC
Checking dependency options is not supported by the ports tree and I think it is dangerous and unwarranted to add hacks to work it in certain ports.

Anyway, in this case, garcon does have a configure flag to enable and disable gir support. So I'm adding a GIR option to it too.

There is no way to really prevent users from setting contrasting options which will cause something to break. The fact an option could cause some other port to break if disabled is not enough to warrant removing it. Maybe some user is not interested in that extra port and does not care if it breaks. If the upstream provides the option to disable gir support, why should we prevent it?

Anyway I also noticed that garcon builds git files itself if gir support is explicitly enabled and doesn't when it's not disabled. For some reason it gets confused with autodetection when it's dependencies don't include git support.

So adding a GIR option to garcon makes it "more complete".

I'm almost done with such a patch, I'll commit it later after some more testing.
Comment 12 Guido Falsi freebsd_committer 2021-01-03 18:07:46 UTC
I will also merge this to the new quarterly.
Comment 13 Olivier Duchateau 2021-01-03 18:21:07 UTC
With the latest release of xfce4-screensaver (4.16.0) GIR files of xfce4-conf and libxfce4util are mandatory!
Comment 14 Guido Falsi freebsd_committer 2021-01-03 18:42:49 UTC
(In reply to Olivier Duchateau from comment #13)

> With the latest release of xfce4-screensaver (4.16.0) GIR files of xfce4-conf
> and libxfce4util are mandatory!

Only if one wants to use that. If it strictly requires GIR and the other ports are compiled without GIR it will fail to build. This is how the ports system work. There is no provision in the ports infrastructure to avoid this. Anything that we put in place would be an hack.

Anyway I can add some check that marks the port BROKEN in such a case.
Comment 15 commit-hook freebsd_committer 2021-01-04 08:54:30 UTC
A commit references this bug:

Author: madpilot
Date: Mon Jan  4 08:54:01 UTC 2021
New revision: 560269
URL: https://svnweb.freebsd.org/changeset/ports/560269

  Correctly wrap Gobject Introspection support in an option for garcon.

  PR:		252355
  Submitted by:	rozhuk.im@gmail.com
  MFH:		2021Q1

Comment 16 Guido Falsi freebsd_committer 2021-01-04 08:56:17 UTC
Committed patch to correctly support Gobject Introspection in the port and enabling disabling it.

As a tangential issue, xfce4-screensaver compiles fine also when GIR support is disabled in it's dependencies.
Comment 17 commit-hook freebsd_committer 2021-01-04 08:58:31 UTC
A commit references this bug:

Author: madpilot
Date: Mon Jan  4 08:57:55 UTC 2021
New revision: 560272
URL: https://svnweb.freebsd.org/changeset/ports/560272

  MFH: r560269

  Correctly wrap Gobject Introspection support in an option for garcon.

  PR:		252355
  Submitted by:	rozhuk.im@gmail.com

_U  branches/2021Q1/
Comment 18 Ivan Rozhuk 2021-01-04 12:04:21 UTC
Now port is updated without errors, thanks!