Bug 1901592 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

As of bug 1849075, building the clang-plugin under Windows (with MozillaBuild 4.1) fails.

The specific failure occurs [here](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/config/rules.mk#582): the first two flags are a broken reference to a directory with a space in it, and should be a single flag.

The offending variable `HOST_CXXFLAGS`
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/config/config.mk#189) `COMPUTED_HOST_CXXFLAGS`, which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/python/mozbuild/mozbuild/frontend/emitter.py#1231) `HOST_COMPILE_FLAGS["HOST_CXXFLAGS"]`, which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/build/clang-plugin/moz.build#125) `CONFIG["LLVM_CXXFLAGS"]`, which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/build/autoconf/clang-plugin.m4#15), which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/build/autoconf/clang-plugin.m4#15) invoking `llvm-config`.

Testing shows that, with clang 17.0.6, `llvm-config` used the path embedded in `$0` directly, whereas with clang 18.1.5, it performs some sort of normalization on the path. Since we use the short name (8.3) of the home directory to invoke `llvm-config` in the first place, that means it used to spit out a (spaceless) short path, but no longer does.

This is properly an upstream bug (https://github.com/llvm/llvm-project/issues/28117); but since nobody's touched that in the last eight years, we'll probably want a local workaround.
As of bug 1849075, building the clang-plugin under Windows (with MozillaBuild 4.1) fails.

The specific failure occurs [here](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/config/rules.mk#582): the first two flags are a broken reference to a directory with a space in it, and should be a single flag.

The offending variable `HOST_CXXFLAGS`
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/config/config.mk#189) `COMPUTED_HOST_CXXFLAGS`, which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/python/mozbuild/mozbuild/frontend/emitter.py#1231) `HOST_COMPILE_FLAGS["HOST_CXXFLAGS"]`, which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/build/clang-plugin/moz.build#125) `CONFIG["LLVM_CXXFLAGS"]`, which
* [is derived from](https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/build/autoconf/clang-plugin.m4#15) invoking `llvm-config`.

Testing shows that, with clang 17.0.6, `llvm-config` used the path embedded in `$0` directly, whereas with clang 18.1.5, it performs some sort of normalization on the path. Since we use the short name (8.3) of the home directory to invoke `llvm-config` in the first place, that means it used to spit out a (spaceless) short path, but no longer does.

This is properly an upstream bug (https://github.com/llvm/llvm-project/issues/28117); but since nobody's touched that in the last eight years, we'll probably want a local workaround.

Back to Bug 1901592 Comment 0