mozjs-128: keep persistent state directory in WORKDIR

Mozilla projects (built from Firefox tarball) keep some
content around for the build process, for example Python
virtual environments, which is reused between the tasks.
This folder is by default in $HOME, unless it is overriden
by the MOZBUILD_STATE_PATH environment variable.

Having this content in the $HOME folder can be problematic,
as it can contaminate the build machine. As different
example, when using kas, it creates a new temporary $HOME
with each invokation, which is deleted upon exiting the
kas process. This can fail the build if for example do_compile
and do_install were called in different kas sessions, as the
tools and data stored in this folder are deleted between the
runs.

To solve this, set the MOZBUILD_STATE_PATH environment variable
to a folder inside the $TMPDIR, so this semi-persistent data
can be contained in a known path.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Gyorgy Sarvari 2025-02-10 16:45:14 +01:00 committed by Khem Raj
parent f7aa588db9
commit 747f2b282b
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -57,6 +57,7 @@ export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
export AS = "${CC}"
export MOZBUILD_STATE_PATH = "${WORKDIR}/mozbuild_state"
export RUSTFLAGS
JIT ?= ""