On 26/07/2017 19:22, Ted Mielczarek wrote:
I’ve ended up keeping "classic" ccache for C and C++ code and adding
'export RUSTC_WRAPPER=sccache' to my mach wrapper script in order to use
sccache for Rust code. (Having this line with or without 'export' in
.mozconfig did not appear to do anything. Can mozconfig set arbitrary
environment variables?)

No, mozconfig variable setting is sort of restricted. Bare variable
assignments (with or without export) are evaluated in the context of
configure, but don't survive to the Makefile environment. If you write
it as `mk_add_options export RUSTC_WRAPPER=sccache` that ought to work,
since that will be set as an exported Makefile variable, meaning it will
be set in the environment for commands executed by make.

`mk_add_options export RUSTC_WRAPPER=sccache` causes an error:

ValueError: dictionary update sequence element #1 has length 1; 2 is required

File "/home/simon/gecko/python/mozbuild/mozbuild/base.py", line 342, in resolve_config_guess
    make_extra = dict(m.split('=', 1) for m in make_extra)


When I removed `export` the build ran normally but didn’t use sccache.


What *did* work is mk_add_options MOZ_MAKE_FLAGS="RUSTC_WRAPPER=sccache"

I also had mk_add_options MOZ_MAKE_FLAGS="-j100" to make icecc effective, but when specifying both separately only one would take effect.


Overall, I ended up with this:

ac_add_options --with-ccache=/usr/bin/ccache
mk_add_options MOZ_MAKE_FLAGS="-j100 RUSTC_WRAPPER=sccache"
CC="/usr/lib/icecc/bin/cc"
CXX="/usr/lib/icecc/bin/c++"

--
Simon Sapin
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to