Skip to content

Commit d586d53

Browse files
author
Olivier Tilloy
committed
Tentatively fix amd64 build failures (https://bugzilla.mozilla.org/1800857).
This is a temporary workaround, we really need to get to the bottom of the underlying issue.
1 parent 85dad0a commit d586d53

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

snapcraft.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,22 @@ parts:
332332
MACH="/usr/bin/python3 ./mach"
333333
$MACH configure --prefix=$SNAPCRAFT_PART_INSTALL/usr
334334
$MACH uniffi generate # workaround for https://bugzilla.mozilla.org/1797714
335+
# Unset SNAP_INSTANCE_NAME because when snapcraft runs as a snap it is set
336+
# (and its value is "snapcraft"), and this interferes with firefox's
337+
# detection of whether it's running sandboxed (see
338+
# https://searchfox.org/mozilla-central/search?q=IsRunningUnderSnap()).
339+
# That codes is compiled in the xpcshell binary that's used to generate
340+
# files at build time, and the environment it runs in prevents it from
341+
# locating services it needs, causing a crash (see
342+
# https://searchfox.org/mozilla-central/rev/aa329cf7506ddd966542e642ec00223fd7461599/xpcom/io/SpecialSystemDirectory.cpp#196).
343+
# This is a temporary workaround to get builds going again, we really need
344+
# to get to the bottom of this and understand why xpcshell cannot find the
345+
# appinfo service when run in the build environment.
346+
# Unsetting SNAP_INSTANCE_NAME has the undesirable side-effect that when
347+
# generating a profile for PGO-enabled builds, a potentially different
348+
# code path will be exercised (not confined as a snap), so that's not a
349+
# good solution.
350+
unset SNAP_INSTANCE_NAME
335351
if [ $SNAPCRAFT_TARGET_ARCH = "amd64" ]; then
336352
# xvfb is only needed when doing a PGO-enabled build
337353
xvfb-run '--server-args=-screen 0 1920x1080x24' $MACH build -j$SNAPCRAFT_PARALLEL_BUILD_COUNT

0 commit comments

Comments
 (0)