Bug 287429 - security/{libsecret,gnome-keyring}: account for struct cmsgcred after switch to meson
Summary: security/{libsecret,gnome-keyring}: account for struct cmsgcred after switch ...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL: https://gitlab.gnome.org/GNOME/libsec...
Keywords: regression
: 287512 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-06-10 17:16 UTC by Ale
Modified: 2025-06-13 21:41 UTC (History)
9 users (show)

See Also:
vishwin: maintainer-feedback+


Attachments
Fix build (1.44 KB, patch)
2025-06-10 19:50 UTC, Olivier Duchateau
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ale 2025-06-10 17:16:07 UTC
[ 43% 65/149] cc -Iegg/libegg.a.p -Iegg -I../egg -I. -I.. -I../build -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/gio-unix-2.0 -fdiagnostics-color=never -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -pipe -Wno-incompatible-function-pointer-types -fstack-protector-strong -fno-strict-aliasing -fPIC -pthread -D_GNU_SOURCE -MD -MQ egg/libegg.a.p/egg-unix-credentials.c.o -MF egg/libegg.a.p/egg-unix-credentials.c.o.d -o egg/libegg.a.p/egg-unix-credentials.c.o -c ../egg/egg-unix-credentials.c
FAILED: egg/libegg.a.p/egg-unix-credentials.c.o 
cc -Iegg/libegg.a.p -Iegg -I../egg -I. -I.. -I../build -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/gio-unix-2.0 -fdiagnostics-color=never -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -pipe -Wno-incompatible-function-pointer-types -fstack-protector-strong -fno-strict-aliasing -fPIC -pthread -D_GNU_SOURCE -MD -MQ egg/libegg.a.p/egg-unix-credentials.c.o -MF egg/libegg.a.p/egg-unix-credentials.c.o.d -o egg/libegg.a.p/egg-unix-credentials.c.o -c ../egg/egg-unix-credentials.c
../egg/egg-unix-credentials.c:145:3: warning: call to undeclared function 'set_local_creds'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  145 |                 set_local_creds(sock, 0);
      |                 ^
../egg/egg-unix-credentials.c:233:74: error: use of undeclared identifier 'fd'
  233 |                 fprintf (stderr, "unable to set LOCAL_CREDS socket option on fd %d\n", fd);
      |                                                                                        ^
1 warning and 1 error generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make: stopped in /usr/ports/security/libsecret

$ uname -Kvm
FreeBSD 14.3-STABLE d7837cac6 STARLESS amd64 1403500
Comment 1 Olivier Duchateau 2025-06-10 19:50:57 UTC
Created attachment 261160 [details]
Fix build

This patch fixes build stage
Comment 2 Ivan Rozhuk 2025-06-10 20:02:58 UTC
fd -> sock
Comment 3 Charlie Li freebsd_committer freebsd_triage 2025-06-10 20:41:42 UTC
This is not it. Based on how security/gnome-keyring builds, from which this code was yanked from, it should be following the HAVE_CMSGCRED path since we have cmsgcred in <sys/socket.h>.
Comment 4 Olivier Duchateau 2025-06-10 21:14:24 UTC
(In reply to Charlie Li from comment #3)

There is same problem in security/gnome-keyring >= 48.x
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-06-10 21:24:57 UTC
A commit in branch main references this bug:

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

commit cbae1dc4de452e8f2f15830a8d26de35c5abca6e
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2025-06-10 20:48:02 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2025-06-10 21:23:35 +0000

    security/libsecret: fix build by accounting for cmsgcred

    The relevant errored code comes directly from security/gnome-keyring,
    which builds successfully there because its configure process
    properly detects and accounts for cmsgcred in <sys/socket.h>. In
    porting the code here, the relevant configure checks did not make
    it in, so the build goes down a code path not intended for us,
    hitting the error. Temporarily define the cmsgcred preprocessor
    variable as part of MESON_ARGS until upstream takes appropriate
    action in meson.build.

    Reported by: Ale <discipline[at]tiscali[dot]it>
    PR: 287429

 security/libsecret/Makefile | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
Comment 6 Charlie Li freebsd_committer freebsd_triage 2025-06-10 21:41:08 UTC
Marking as in progress instead of fixed since this is a temporary stopgap.

(In reply to Olivier Duchateau from comment #4)
At least they have the detection logic in meson.build, but forgot the conf.set() line(s) that would make the preprocessor variable visible.
Comment 7 Ivan Rozhuk 2025-06-11 01:18:00 UTC
[ 96% 146/149] valac -C --pkg gio-2.0 --pkg glib-2.0 --pkg gio-unix-2.0 --pkg gio-2.0 --target-glib 2.44 --pkg glib-2.0 --color=never --directory libsecret/test-vala-lang.p --basedir ../libsecret libsecret/libsecret-1.vapi libsecret/mock-service-0.vapi ../libsecret/test-vala-lang.vala
FAILED: libsecret/test-vala-lang.p/test-vala-lang.c 
valac -C --pkg gio-2.0 --pkg glib-2.0 --pkg gio-unix-2.0 --pkg gio-2.0 --target-glib 2.44 --pkg glib-2.0 --color=never --directory libsecret/test-vala-lang.p --basedir ../libsecret libsecret/libsecret-1.vapi libsecret/mock-service-0.vapi ../libsecret/test-vala-lang.vala
../libsecret/test-vala-lang.vala:22.18-22.43: error: `Secret.attributes_validate' is not available in libsecret-1 0.20.5. Use libsecret-1 >= 0.21.2
   22 |     bool valid = Secret.attributes_validate (schema, attributes);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~                      
Compilation failed: 1 error(s), 0 warning(s)
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2025-06-11 01:28:23 UTC
(In reply to Ivan Rozhuk from comment #7)
On live system remove old version before build new.
Comment 9 Ivan Rozhuk 2025-06-11 02:17:47 UTC
I was hope that project has knob to disable tests build, but it is not.
Comment 10 bsd 2025-06-11 05:44:11 UTC
(In reply to Vladimir Druzenko from comment #8)
For portmaster user (maybe portupgrade as well, not verified), upgrade sequence (for now) should be

pkg delete -f libsecret-0.20.5_3
portmaster security/libsecret

Maybe it should be noted in UPGRADING...
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2025-06-13 21:41:29 UTC
*** Bug 287512 has been marked as a duplicate of this bug. ***