Closed Bug 1729760 Opened 3 years ago Closed 3 years ago

glsl-optimizer produces errors when building Gecko for Android

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox-esr78 unaffected, firefox-esr91 unaffected, firefox92 unaffected, firefox93 wontfix, firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox92 --- unaffected
firefox93 --- wontfix
firefox94 --- fixed

People

(Reporter: owlish, Assigned: glandium)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Mac OS 11.4, non-artifact build, latest tip
The error from the ./mach build output:

2:35.73   running: "/Users/owlish/.mozbuild/clang/bin/clang++" "-O1" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "--sysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-std=gnu++17" "-DMOZILLA_CONFIG_H" "-I" "glsl-optimizer/include" "-I" "glsl-optimizer/src/mesa" "-I" "glsl-optimizer/src/mapi" "-I" "glsl-optimizer/src/compiler" "-I" "glsl-optimizer/src/compiler/glsl" "-I" "glsl-optimizer/src/gallium/auxiliary" "-I" "glsl-optimizer/src/gallium/include" "-I" "glsl-optimizer/src" "-I" "glsl-optimizer/src/util" "-D__STDC_FORMAT_MACROS" "-DHAVE_PTHREAD" "-DHAVE_TIMESPEC_GET" "-DMOZ_INCLUDE_MOZALLOC_H" "-Dmozilla_throw_gcc_h" "-o" "/Users/owlish/code/gecko/obj-x86_64-unknown-linux-android/release/build/glslopt-a5682f2bddabc4bc/out/glsl-optimizer/src/compiler/glsl_types.o" "-c" "glsl-optimizer/src/compiler/glsl_types.cpp"
 2:35.73   cargo:warning=clang-12: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
 2:35.73   cargo:warning=In file included from glsl-optimizer/src/compiler/glsl_types.cpp:26:
 2:35.73   cargo:warning=In file included from glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h:34:
 2:35.73   cargo:warning=glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h:28:10: fatal error: 'new' file not found
 2:35.73   cargo:warning=#include <new>
 2:35.73   cargo:warning=         ^~~~~
 2:35.73   cargo:warning=1 error generated.
 2:35.73   exit status: 1
 2:35.73   --- stderr
 2:35.73   error occurred: Command "/Users/owlish/.mozbuild/clang/bin/clang++" "-O1" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "--sysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-std=gnu++17" "-DMOZILLA_CONFIG_H" "-I" "glsl-optimizer/include" "-I" "glsl-optimizer/src/mesa" "-I" "glsl-optimizer/src/mapi" "-I" "glsl-optimizer/src/compiler" "-I" "glsl-optimizer/src/compiler/glsl" "-I" "glsl-optimizer/src/gallium/auxiliary" "-I" "glsl-optimizer/src/gallium/include" "-I" "glsl-optimizer/src" "-I" "glsl-optimizer/src/util" "-D__STDC_FORMAT_MACROS" "-DHAVE_PTHREAD" "-DHAVE_TIMESPEC_GET" "-DMOZ_INCLUDE_MOZALLOC_H" "-Dmozilla_throw_gcc_h" "-o" "/Users/owlish/code/gecko/obj-x86_64-unknown-linux-android/release/build/glslopt-a5682f2bddabc4bc/out/glsl-optimizer/src/compiler/glsl_types.o" "-c" "glsl-optimizer/src/compiler/glsl_types.cpp" with args "clang++" did not execute successfully (status code exit status: 1).
 2:35.73 warning: build failed, waiting for other jobs to finish...```

I tried clobber, bootstrap, deleting object directories, resetting emulator (just in case), specifying “-stdlib=libc++” in the CFLAGS and CXXFLAGS variables, setting various values in HOST_CC / HOST_CXX / CC / CXX variables, overriding CXX_x86_64_apple_darwin variable, updating xcode - nothing helped.

Finally, I tried working off of an older commit - a random one from August 23 and a random one from August 10 - on the latter I was able to build.

jrmuizel is also able to reproduce the error.

I saw this today too on a new objdir: I'm on f880d61153d3 from Aug 26.

Curiously, I have an existing objdir that is from a direct descendant of that commit (something I wrote) that still builds successfully.

At the end of my runs, I see:

25:38.75 make[1]: INTERNAL: Exiting with 17 jobserver tokens available; should be 16!

Maybe there's a race condition that explains this?

I have not experienced the message about jobserver tokens

If it helps, I am currently on 2d2223baff892bb9bc0a229a0b8546cc90127594 - that one builds for me

This is currently blocking at least 2 people on both the performance and GeckoView teams. We would appreciate it if this could be prioritised. Thanks.

Flags: needinfo?(bvandyk)

Jamie, didn't you run into a problem with this recently?

Flags: needinfo?(jnicol)
Blocks: gfx-triage

Looks like gfx will handle this, clearing NI. Feel free to ping again if needed.

Flags: needinfo?(bvandyk)

I've not seen this before, no.

I'm on PTO so am unable to fix this quickly, and I don't have a Mac either.

A regression range would be very helpful from someone who is able to reproduce. Nothing has changed in glslopt recently so presumably something in our build system has.

Flags: needinfo?(jnicol)

Moving component. Feel free to pass back if this is found to be a media issue.

Component: Audio/Video → Graphics

Jeff, you ran into this at some point? Trying to understand what the cause is, and who would own fixing it.

Flags: needinfo?(jmuizelaar)

I will try to reproduce.

Flags: needinfo?(jmuizelaar) → needinfo?(bwerth)

FWIW, I don't know if there's anything graphics specific about this issue. This crate last changed Apr 22 2021 so unless it's been broken since then it was likely a change elsewhere that introduced the problem.

If anyone has an idea when this broke that would help narrowing down the cause.

owlish/Michael, do you know when this last worked?

Flags: needinfo?(michael.l.comella)
Flags: needinfo?(bugzeeeeee)

Jeff, the commit that is working for me is this one https://hg.mozilla.org/mozilla-central/log?rev=99e249810495d252d478908c1e8333b6a3673c4e

I tried building on a commit dated August 23, and the build failed. So, apparently, something got merged between August 11 and August 23

Flags: needinfo?(bugzeeeeee)

Can you hg/git bisect the build to see what commit broke it?

Flags: needinfo?(bugzeeeeee)

My guess is this was caused by bug 1724374

Yeah, a local bisect seems to confirm that.

Flags: needinfo?(michael.l.comella)
Flags: needinfo?(bwerth)
Flags: needinfo?(bugzeeeeee)
Regressed by: 1724374
Has Regression Range: --- → yes
No longer blocks: gfx-triage
Component: Graphics → General
Product: Core → Firefox Build System
Flags: needinfo?(mh+mozilla)

Setting HOST_CXXFLAGS=-stdlib=libc++ should work around this.

Flags: needinfo?(mh+mozilla)
Assignee: nobody → mh+mozilla

According to my git bisect it's this commit https://hg.mozilla.org/mozilla-central/rev/86d44d84b2cae5abd0df5af629e7c2827c592aa4
for this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1726628 - the previous commit builds for me

(I made a mistake about August 23 commits. Those do build for me - I might have confused commit shas there.)

mcomella, can you try git bisect as well? f880d61153d3 from Aug 26 does build for me - I wonder if there are two issues at play here

Assignee: mh+mozilla → nobody
Flags: needinfo?(michael.l.comella)
Assignee: nobody → mh+mozilla

It's currently added manually to CXXFLAGS and bindgen flags, and is
notably missing from HOST_CXXFLAGS. However, setting it at the toolchain
level makes it inherited anywhere it's needed, including host builds and
bindgen.

See Also: → 1731699
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/88384fc94631 Set -stdlib=libc++ for mac builds at the toolchain level. r=firefox-build-system-reviewers,nalexander
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

(In reply to Mike Hommey [:glandium] from comment #17)

Setting HOST_CXXFLAGS=-stdlib=libc++ should work around this.

For some reason I haven't noticed this message yesterday. I tried this, and it didn't help

But the latest tip builds for me, yay! Thanks everyone!

(In reply to [:owlish] 🦉 PST from comment #18)

mcomella, can you try git bisect as well? f880d61153d3 from Aug 26 does build for me - I wonder if there are two issues at play here

I'm assuming this isn't needed anymore. I'd tell you if it's working but I'm not actively building GV atm. I'll let you know if I run into trouble the next time I build.

Flags: needinfo?(michael.l.comella)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: