mozjs
mozjs copied to clipboard
Force Reconfigure if CC / CXX changed
I noticed that when building servo for openharmony and upgrading the SDK, the mozjs build system will continue to use the old compiler paths. This becomes noticable, when deleting the old SDK, since that triggers errors like:
make[4]: /path/to/old/llvm/bin/aarch64-unknown-linux-ohos-clang++: No such file or directory
I'm a bit more worried about the case, were the user did not delete the old SDK, and mozjs is just silently using the old compiler instead of the new compiler that servo is telling it to use.
Proposed solution: mozjs should force a complete reconfigure if variables like CC or CXX change.
We have https://github.com/servo/mozjs/blob/10fb074ab11756444e8b0f69e4cbed8d6462e3ae/mozjs-sys/build.rs#L97-L100 but maybe we should make it unconditional.
I think that is not sufficient, since the build script re-running doesn't necessarily mean the spidermonkey makefiles get reconfigured.
Indeed: https://github.com/servo/mozjs/blob/10fb074ab11756444e8b0f69e4cbed8d6462e3ae/mozjs-sys/makefile.cargo#L147