Cannot build clang-plugin when home directory has a space in the name
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(firefox-esr115 unaffected, firefox127 unaffected, firefox128 wontfix, firefox129 fixed)
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox127 | --- | unaffected |
firefox128 | --- | wontfix |
firefox129 | --- | fixed |
People
(Reporter: rkraesig, Assigned: glandium)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
As of bug 1849075, building the clang-plugin under Windows (with MozillaBuild 4.1) fails.
The specific failure occurs here: 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
COMPUTED_HOST_CXXFLAGS
, which - is derived from
HOST_COMPILE_FLAGS["HOST_CXXFLAGS"]
, which - is derived from
CONFIG["LLVM_CXXFLAGS"]
, which - is derived from 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.
Reporter | ||
Comment 1•8 days ago
|
||
llvm-config doesn't quote paths with spaces -- and unfortunately, as of
the current version used by mozilla-central, expands spaceless short-names
to potentially space-bearing long-names.
Since we install clang into the user's home directory, as a workaround,
string-replace the long name of the directory with the short name for
flagsets obtained from llvm-config on Windows.
Updated•8 days ago
|
Updated•8 days ago
|
Comment 2•7 days ago
|
||
Set release status flags based on info from the regressing bug 1849075
Updated•7 days ago
|
Updated•7 days ago
|
Assignee | ||
Comment 3•7 days ago
|
||
I think I'd rather kill clang-plugin for local builds altogether rather than try to fix this. I guess your use case is to reproduce errors it catches on CI, but mach static-analysis
should give you that already. If it doesn't, please file bugs.
Reporter | ||
Comment 4•6 days ago
|
||
I guess your use case is to reproduce errors it catches on CI,
No — my use case is to catch errors before they are raised in CI. The try
server has a very long round-trip time, even when it's functioning perfectly, and I don't enjoy spending hours waiting on it to learn about and fix something that could and should have been caught locally on the first compilation attempt.
It's also necessary to be able to test changes to the plugin locally; those don't happen often, but they do happen (e.g. bug 1791682).
but
mach static-analysis
should give you that already.
mach static-analysis check
takes far longer than compiling and using the plugin [0], generates oodles of spam which drown out any real errors, and can't be interrupted with Ctrl+C once it starts analyzing files (!!!). I expect the amount of work and time that would be necessary to get it to an equivalently-usable state would be better spent on fixing llvm-config
to escape and/or quote paths on Windows.
It's also not done as part of compilation, which means it's easily forgotten about; conversely, the clang-plugin is build and used as part of mach build
, making it difficult to forget once it's in one's mozconfig.
[0] >30m just for mach static-analysis check widget/windows
, compared to ~17m full mach build
from a post-clobber state.
Assignee | ||
Comment 5•5 days ago
|
||
Before trying to address the issue in depth (possibly backporting an
upcoming llvm-config change), let's just revert to something that is
known to work for the moment.
Assignee | ||
Comment 6•5 days ago
|
||
(In reply to Ray Kraesig [:rkraesig] from comment #4)
but
mach static-analysis
should give you that already.
mach static-analysis check
takes far longer than compiling and using the plugin [0], generates oodles of spam which drown out any real errors, and can't be interrupted with Ctrl+C once it starts analyzing files (!!!). I expect the amount of work and time that would be necessary to get it to an equivalently-usable state would be better spent on fixingllvm-config
to escape and/or quote paths on Windows.It's also not done as part of compilation, which means it's easily forgotten about; conversely, the clang-plugin is build and used as part of
mach build
, making it difficult to forget once it's in one's mozconfig.
[0] >30m just for
mach static-analysis check widget/windows
, compared to ~17m fullmach build
from a post-clobber state.
Please file bugs.
Updated•5 days ago
|
Reporter | ||
Comment 7•5 days ago
|
||
Done: bug 1902441, bug 1902442, bug 1902443.
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/9b89f27988a5 Revert a LLVM change that affects how llvm-config outputs paths. r=firefox-build-system-reviewers,sergesanspaille
Comment 10•4 days ago
|
||
The patch landed in nightly and beta is affected.
:rkraesig, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox128
towontfix
.
For more information, please visit BugBot documentation.
Reporter | ||
Updated•4 days ago
|
Reporter | ||
Updated•4 days ago
|
Description
•