Closed Bug 1444953 Opened 7 years ago Closed 7 years ago

FreeBSD build broke: incomplete type 'union semun'

Categories

(NSPR :: NSPR, defect)

4.19
All
FreeBSD
defect
Not set
normal

Tracking

(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox59 wontfix, firefox60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox59 --- wontfix
firefox60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed

People

(Reporter: val, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:61.0) Gecko/20100101 Firefox/61.0 Build ID: 20180312195859 Steps to reproduce: Build current development Firefox source tree Actual results: nsprpub/pr/src/pthreads/ptsynch.c:941:17: error: variable has incomplete type 'union semun' (because it tries to get it from the system header, which only defines that conditionally — on _WANT_SEMUN) Expected results: Adding #define _WANT_SEMUN at the top of the file (before *any* system header includes could happen) fixes the problem.
Component: Untriaged → General
OS: Unspecified → FreeBSD
Product: Firefox → Core
Hardware: Unspecified → All
Component: General → NSPR
Product: Core → NSPR
Version: 61 Branch → 4.19
Comment on attachment 8958407 [details] [diff] [review] fix Review of attachment 8958407 [details] [diff] [review]: ----------------------------------------------------------------- ::: pr/src/pthreads/ptsynch.c @@ +910,5 @@ > /* > * From the semctl(2) man page in glibc 2.0 > */ > #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \ > + || (defined(FREEBSD) && __FreeBSD_version < 1200059) \ Should I check for _WANT_SEMUN here to avoid breaking consumers that define it as a workaround for *other* libraries?
Here's a list of _WANT_SEMUN consumers (where Makefile changed), none of which bundle NSPR. https://svnweb.freebsd.org/changeset/ports/463452
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch fixSplinter Review
Oops, wrong bug number in commit message.
Attachment #8958407 - Attachment is obsolete: true
Attachment #8958407 - Flags: review?(kaie)
Attachment #8958417 - Flags: review?(kaie)
Can you also backport to NSPR 4.19 branch? Firefox 60 may update bundled NSPR to 4.19.1 (or later) during ESR cycle.
Flags: needinfo?(kaie)
Is this a regression? The change is very small, and it probably doesn't justify the overhead of doing a release. Maybe this bug is sufficient documentation to allow others who run into it to find your fix?
Flags: needinfo?(kaie)
I don't mind including it in a future 4.19.1 release, but it's unclear if there will be any such branch release.
Target Milestone: --- → 4.20
Attachment #8958417 - Flags: review?(kaie) → review+
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Blocks: 1446136
Kai Engert, I can confirm this bug is still present. After manually applying the suggested fix to ptsynch.c as defined in https://hg.mozilla.org/projects/nspr/rev/776db96f834c This happens on FreeBSD 12, with a freshly built new buildworld from svn update (r333894) to what is current on this very day. I also pulled a completely clean new hg clone of mozilla-central branch on this very day. My .mozconfig file only contains these two lines: export CC=clang export CXX=clang++ I suspect the .mozconfig file could also just be left completely blank. I will try this later today. The only reason my .mozconfig file contains *anything* at all is because on previous mozilla-central builds circa ~5 months ago I had come across some issue/build brake that was fixed by these definitions in the .mozconfig file. Sadly, I've forgotten what caused the break, shame on me. In the interest of total clarity, my /etc/make.conf file only contains some switches (NLS, DOCS, EXAMPLES, CUPS, TEST) for building FreeBSD ports, I do *not* have a /usr/src/make.conf (irrelevant), /usr/src/src.conf (irrelevant), /usr/ports/make.conf (irrelevant) or /usr/ports/src.conf (irrelevant). The point being that I am not telling anything to build things without CLANG. I do *not* use ccache either, anywhere. CLANG & LLVM versions are 6.0.0 (tags/RELEASE_600/final 326565). Hope my experience here is of some use. Is there a chance somebody dropped the ball in committing your patch? If you need me to provide any additional info/logs, do please request I do so.
Confirmed, blank .mozconfig file has no effect. Again, completely fresh new hg clone of the mozilla-central branch. For what it is worth, having openssl or openssl-devel installed (or not installed) makes no difference. Adding to the general head-screwery of this bug, I have done the *exact* same procedure on FreeBSD 11 (11.0 , 11.1 , 11.2-BETA) where this bug does not appear...building on FreeBSD 11 goes without anything breaking the compile and the patch is not required.
(In reply to Kai Engert (:kaie:) from comment #6) > Is this a regression? Yes. Upcoming FreeBSD 12.0 fixed semctl API. See commit in URL (bugzilla field) for rationale. https://www.freebsd.org/releases/12.0R/schedule.html > The change is very small, and it probably doesn't justify the overhead of > doing a release. Should I request backport directly to bundled version in mozilla-central then? My goal is ESR60 as its lifetime intersects with FreeBSD 12.0-RELEASE: 2018-05-09..2019-05-?? vs. 2018-11-06..2019-11-?? > Maybe this bug is sufficient documentation to allow others who run into it to find your fix? Firefox being unfixed makes bisecting unrelated regressions harder. Ditto debugging downstream-specific issues not present upstream. Mozilla doesn't provide FreeBSD binaries, so building from source is essential. As for workarounds: - -D_WANT_SEMUN will have an opposite effect once the fix here land in mozilla-central - --with-system-nspr is often unusable, see bug 1341222 comment 6
Flags: needinfo?(kaie)
FreeBSD 12.0 is scheduled to be released on 2018-11-06 i.e., during Firefox 63 support life but mozilla-central is still broken.
Looks like we'll release NSPR 4.20 for FF63 see bug 1477680
Flags: needinfo?(kaie)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: