Closed Bug 1727087 Opened 3 years ago Closed 2 years ago

Building a snap from source fails for 92, build errors in angle

Categories

(Core :: Graphics, defect, P1)

Firefox 92
defect

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox-esr102 --- wontfix
firefox91 --- unaffected
firefox92 --- wontfix
firefox93 --- wontfix
firefox94 --- wontfix
firefox95 --- wontfix
firefox104 --- wontfix
firefox105 --- wontfix
firefox106 --- fixed

People

(Reporter: olivier, Assigned: jgilbert)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Building a firefox snap package from source (https://code.launchpad.net/~mozilla-snaps/+git/firefox-snap) is failing starting with the current beta (version 92).
The build failure doesn't affect upstream builds, only snaps built from source, and is caused by the layout of the snap build environment.
The problem was triggered by recent changes in gfx/angle/moz.build.common (last two commits on bug 1721962, https://hg.mozilla.org/mozilla-central/rev/89fbf7468841 and https://hg.mozilla.org/mozilla-central/rev/053c9e528b02).

Actual results:

These are the build errors:

32:50.57 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5605:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
32:50.57                                     BuiltInName::isnan,
32:50.57                                     ~~~~~~~~~~~~~^
32:50.59 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5613:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
32:50.59                                     BuiltInName::isnan,
32:50.59                                     ~~~~~~~~~~~~~^
32:50.60 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5621:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
32:50.60                                     BuiltInName::isnan,
32:50.60                                     ~~~~~~~~~~~~~^
32:50.61 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5629:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
32:50.61                                     BuiltInName::isnan,
32:50.61                                     ~~~~~~~~~~~~~^
32:50.63 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5637:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
32:50.63                                     BuiltInName::isinf,
32:50.63                                     ~~~~~~~~~~~~~^
32:50.64 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5645:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
32:50.64                                     BuiltInName::isinf,
32:50.64                                     ~~~~~~~~~~~~~^
32:50.65 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5653:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
32:50.65                                     BuiltInName::isinf,
32:50.65                                     ~~~~~~~~~~~~~^
32:50.67 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:5661:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
32:50.67                                     BuiltInName::isinf,
32:50.67                                     ~~~~~~~~~~~~~^
32:51.20 8 errors generated.
32:51.22 make[4]: *** [/build/firefox/parts/firefox/build/config/rules.mk:693: SymbolTable_ESSL_autogen.o] Error 1
32:51.22 make[3]: *** [/build/firefox/parts/firefox/build/config/recurse.mk:72: gfx/angle/targets/translator/target-objects] Error 2

Expected results:

I'm opening this bug to keep a track record of my findings while I'm investigating the problem and looking for a decent fix.

I do have a workaround (in the form of a minimal patch to the angle sources that are vendored in the firefox source tree), but we're aiming to build the snap from unmodified sources, so either the patch is good enough to be upstreamed (to angle), or we need to come up with another solution. This is the patch:

--- a/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp
@@ -11,6 +11,8 @@
 
 #ifdef ANGLE_TRANSLATOR_ESSL_ONLY
 
+#include <cmath>
+
 #    include "compiler/translator/SymbolTable.h"
 
 #    include "angle_gl.h"
Blocks: snap

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::General' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Firefox Build System

The problem is caused by pkg-config setting MOZ_X11_CFLAGS to -I/snap/gnome-3-38-2004-sdk/current/usr/include, which results in clang resolving include directives differently, and using system headers provided by the gnome-3-38-2004-sdk snap where std::isnan and std::isinf are not defined.

Manually editing obj-*/gfx/angle/targets/translator/backend.mk to remove -I/snap/gnome-3-38-2004-sdk/current/usr/include from the value of COMPUTED_CXXFLAGS "fixes" the problem.

As does adding the #include <cmath> directive to gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp.

I'm guessing that this is related to recent sysroot work, sending this to glandium to confirm.

Flags: needinfo?(mh+mozilla)

I don't think so, building the snap from source doesn't make use of a sysroot. It's really a snap-specific problem that wasn't uncovered until the recent changes to gfx/angle/moz.build.common.

Ah, I'm assuming that the pkg-config and sysroot changes are related.

Regressed by: 1721962
Has Regression Range: --- → yes

I'm attaching the contents of obj-*/gfx/angle/targets/translator/.deps/SymbolTable_ESSL_autogen.o.pp when building firefox 92 in the snap build environment, without the patch (fails to build) and with the patch that adds the <cmath> include, for reference and further investigation.

Component: General → Graphics
Flags: needinfo?(mh+mozilla)
Product: Firefox Build System → Core

Set release status flags based on info from the regressing bug 1721962

Seeing that firefox doesn't use angle on Linux, an option would be to not build it at all, thus working around the problem. Unfortunately, I'm not seeing any build option that allows not building it. The targets/translator library is always being built.

Jeff, would you have any pointers here?

Flags: needinfo?(jgilbert)
Severity: -- → S3

(In reply to Olivier Tilloy from comment #10)

Seeing that firefox doesn't use angle on Linux, an option would be to not build it at all, thus working around the problem. Unfortunately, I'm not seeing any build option that allows not building it. The targets/translator library is always being built.

We do use (that part of) ANGLE on Linux. ANGLE is has two modules that we use:

  1. A shader validator and translator (WebGLSL => GLSL/ESSL), which we build and use everywhere. (This is required for our WebGL engine's validation code)
  2. An OpenGL ES driver that runs on top of D3D, which we build and use only on Windows
Flags: needinfo?(jgilbert)

I think this is easy to fix upstream.

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Kelsey, you mentionned this is easy to fix upstream, Olivier's patch is really simple indeed, is there any reason this is not yet in upstream ?

Flags: needinfo?(jgilbert)
Assignee: nobody → jgilbert
Flags: needinfo?(jgilbert)
Priority: -- → P1

I'm really not sure how vulkan.hpp gets marked for vendoring? It has no references in searchfox outside of itself.
And for some reason it's changed here, even though I don't think I touched it?
I'm just going to leave it for now though, though it'd be nice to not even have these things that we don't use. We "shouldn't" be picking them up for vendoring.

Does this patch fix your issue? I have not built snaps before, so if you can test it and confirm that this fixes it, I can finish landing it.

Flags: needinfo?(olivier)

I'll do a test build with the patch to confirm.

The test build failed, with the same errors as originally reported:

28:33.99 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6012:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
28:33.99                                     BuiltInName::isnan,
28:33.99                                     ~~~~~~~~~~~~~^
28:33.99 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6020:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
28:33.99                                     BuiltInName::isnan,
28:33.99                                     ~~~~~~~~~~~~~^
28:33.99 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6028:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
28:33.99                                     BuiltInName::isnan,
28:33.99                                     ~~~~~~~~~~~~~^
28:33.99 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6036:50: error: no member named 'isnan' in namespace 'sh::BuiltInName'
28:33.99                                     BuiltInName::isnan,
28:34.00                                     ~~~~~~~~~~~~~^
28:34.00 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6044:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
28:34.00                                     BuiltInName::isinf,
28:34.00                                     ~~~~~~~~~~~~~^
28:34.02 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6052:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
28:34.02                                     BuiltInName::isinf,
28:34.02                                     ~~~~~~~~~~~~~^
28:34.03 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6060:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
28:34.03                                     BuiltInName::isinf,
28:34.03                                     ~~~~~~~~~~~~~^
28:34.03 /build/firefox/parts/firefox/build/gfx/angle/checkout/src/compiler/translator/SymbolTable_ESSL_autogen.cpp:6068:50: error: no member named 'isinf' in namespace 'sh::BuiltInName'
28:34.03                                     BuiltInName::isinf,
28:34.03                                     ~~~~~~~~~~~~~^
28:34.46 8 errors generated.

Note that I'm not seeing any reference to including <cmath> in the patch, except in the commit message, is that an oversight?

Flags: needinfo?(olivier) → needinfo?(jgilbert)

Oops, yeah, oversight! Good catch.

Flags: needinfo?(jgilbert)

Try this newer version please!

Flags: needinfo?(olivier)

Yes, with the updated patch the amd64 snap build succeeded. I have now triggered armhf and arm64 builds to make sure all supported architectures (for the snap) build equally well, I'll report back here.

And I can confirm that the patch fixes the build for all supported snap architectures (amd64, armhf, arm64). Thanks!

Flags: needinfo?(olivier)
Pushed by jgilbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6c7ac7825674 Include cmath in autogen files in ANGLE. r=gfx-reviewers,lsalzman
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: