Bug 269869 - www/chromium Build fails
Summary: www/chromium Build fails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-chromium (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-28 05:07 UTC by jnaughto
Modified: 2023-03-27 20:30 UTC (History)
4 users (show)

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


Attachments
patch reposting (846 bytes, patch)
2023-02-28 23:25 UTC, Tatsuki Makino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jnaughto 2023-02-28 05:07:20 UTC
Running FreeBSD 12.4 on an amd64 system, and attempting to compile Chromium.   Compile fails with:

FAILED: obj/third_party/wayland/wayland_cursor/os-compatibility.o
./../third_party/wayland/src/cursor/os-compatibility.c:127:7: warning: implicit declaration of function 'memfd_create' is invalid in C99 [-Wimplicit-function-declaration]
        fd = memfd_create("wayland-cursor", MFD_CLOEXEC | MFD_ALLOW_SEALING);
             ^
../../third_party/wayland/src/cursor/os-compatibility.c:127:38: error: use of undeclared identifier 'MFD_CLOEXEC'
        fd = memfd_create("wayland-cursor", MFD_CLOEXEC | MFD_ALLOW_SEALING);
                                            ^
../../third_party/wayland/src/cursor/os-compatibility.c:127:52: error: use of undeclared identifier 'MFD_ALLOW_SEALING'
        fd = memfd_create("wayland-cursor", MFD_CLOEXEC | MFD_ALLOW_SEALING);
                                                          ^
../../third_party/wayland/src/cursor/os-compatibility.c:135:13: error: use of undeclared identifier 'F_ADD_SEALS'
                fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
                          ^
../../third_party/wayland/src/cursor/os-compatibility.c:135:26: error: use of undeclared identifier 'F_SEAL_SHRINK'
                fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
                                       ^
../../third_party/wayland/src/cursor/os-compatibility.c:135:42: error: use of undeclared identifier 'F_SEAL_SEAL'
                fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
                                                       ^
1 warning and 5 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/chromium
*** Error code 1
Comment 1 Tatsuki Makino 2023-02-28 23:25:47 UTC
Created attachment 240492 [details]
patch reposting

This is due to the use of the bundle libwayland.
https://cgit.freebsd.org/ports/commit/www/chromium?id=230cf3bad636e34e916bcba192aa5934d8fc5211

I will post the patch I posted to the mailing list here as well.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-03-01 05:07:03 UTC
A commit in branch main references this bug:

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

commit beba79ea0400605b719e3ac7961bab51533159d5
Author:     Robert Nagy <rnagy@FreeBSD.org>
AuthorDate: 2023-02-28 09:35:39 +0000
Commit:     Robert Nagy <rnagy@FreeBSD.org>
CommitDate: 2023-03-01 05:06:28 +0000

    www/{chromium,ungoogled-chromium}: unbreak on FreeBSD < 13.0

    support for memfd_create has been introduced in 13.0 so disable
    it on older releases

    PR:             269869
    Reviewed by:    rene (mentor)

 .../files/patch-third__party_wayland_include_config.h    | 16 ++++++++++++++--
 .../files/patch-third__party_wayland_include_config.h    | 16 ++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)
Comment 3 Tatsuki Makino 2023-03-01 05:20:28 UTC
(In reply to commit-hook from comment #2)

After my several attempts at it, it seems that __FreeBSD_version is not defined in third_party/wayland/include/config.h.
So, my patch includes <osreldate.h> (/usr/include/osreldate.h) near it.

Also, it's a minor detail, but some versions of 13.0 are also affected, so it's __FreeBSD_version < 1300048 :)
Comment 4 Tatsuki Makino 2023-03-01 05:28:24 UTC
(In reply to Tatsuki Makino from comment #3)

One more thing.
__FreeBSD__ < 13 or __FreeBSD__ >= 13  can be used there.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-03-01 13:12:48 UTC
A commit in branch main references this bug:

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

commit bf43457463908bd882fc20677eeae81de09506d7
Author:     Robert Nagy <rnagy@FreeBSD.org>
AuthorDate: 2023-03-01 05:43:17 +0000
Commit:     Robert Nagy <rnagy@FreeBSD.org>
CommitDate: 2023-03-01 13:06:40 +0000

    www/*chromium: add missing osreldate.h header tighten the version check

    PR:             269869
    Approved by:    rene (mentor)
    Submitted by:   Tatsuki Makino <tatsuki_makino hotmail com>

 .../files/patch-third__party_wayland_include_config.h     | 15 +++++++++------
 .../files/patch-third__party_wayland_include_config.h     | 15 +++++++++------
 2 files changed, 18 insertions(+), 12 deletions(-)
Comment 6 jnaughto 2023-03-05 04:25:05 UTC
I can confirm the patch works.  I've finished compiling chromium-110.0.5481.177 on FreeBSD 12.4.

Cheers

Jason Naughton
Comment 7 Dave Hayes 2023-03-27 20:06:24 UTC
Any chance to get this patch backported to the 2023Q1 branch? It's not on there currently, and thus the chromium build is broken relative to this branch.
Comment 8 Tatsuki Makino 2023-03-27 20:30:45 UTC
(In reply to Dave Hayes from comment #7)

We still have a few more days of 12.3-RELEASE support left, so I hope that will be changed after that is ended... :)