Closed
Bug 1739644
Opened 4 years ago
Closed 4 years ago
./mach clang-format fails when mozconfig is set up for cross compile
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox96 fixed)
RESOLVED
FIXED
96 Branch
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: bhearsum, Assigned: andi)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
I cross compile (host: Linux, target: Windows) often. When my mozconfig is set up for this (attached), clang-format downloads a Linux toolchain, but then tries to run a Windows clang-format.exe that doesn't exist. Ideally, it would run the Linux clang-format it downloaded, although downloading and running the Windows one would arguably be acceptable (at least it would work).
Comment 1•4 years ago
|
||
I noticed this happened for the mingw cross compile also which I do locally every once in a while.
Comment 2•4 years ago
|
||
Try this:
--- a/python/mozbuild/mozbuild/code_analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code_analysis/mach_commands.py
@@ -1247,19 +1247,19 @@ def autotest(
clang_tools_path,
"clang-tidy",
"bin",
- "clang-tidy" + config.substs.get("BIN_SUFFIX", ""),
+ "clang-tidy" + config.substs.get("HOST_BIN_SUFFIX", ""),
)
clang_paths._clang_format_path = mozpath.join(
clang_tools_path,
"clang-tidy",
"bin",
- "clang-format" + config.substs.get("BIN_SUFFIX", ""),
+ "clang-format" + config.substs.get("HOST_BIN_SUFFIX", ""),
)
clang_paths._clang_apply_replacements = mozpath.join(
clang_tools_path,
"clang-tidy",
"bin",
- "clang-apply-replacements" + config.substs.get("BIN_SUFFIX", ""),
+ "clang-apply-replacements" + config.substs.get("HOST_BIN_SUFFIX", ""),
)
clang_paths._run_clang_tidy_path = mozpath.join(
clang_tools_path, "clang-tidy", "bin", "run-clang-tidy"
@@ -2210,19 +2210,19 @@ def _set_clang_tools_paths(command_context):
clang_paths._clang_tools_path,
"clang-tidy",
"bin",
- "clang-tidy" + config.substs.get("BIN_SUFFIX", ""),
+ "clang-tidy" + config.substs.get("HOST_BIN_SUFFIX", ""),
)
clang_paths._clang_format_path = mozpath.join(
clang_paths._clang_tools_path,
"clang-tidy",
"bin",
- "clang-format" + config.substs.get("BIN_SUFFIX", ""),
+ "clang-format" + config.substs.get("HOST_BIN_SUFFIX", ""),
)
clang_paths._clang_apply_replacements = mozpath.join(
clang_paths._clang_tools_path,
"clang-tidy",
"bin",
- "clang-apply-replacements" + config.substs.get("BIN_SUFFIX", ""),
+ "clang-apply-replacements" + config.substs.get("HOST_BIN_SUFFIX", ""),
)
clang_paths._run_clang_tidy_path = mozpath.join(
clang_paths._clang_tools_path,
Reporter | ||
Comment 3•4 years ago
|
||
Works for me. Thanks!
Assignee | ||
Comment 4•4 years ago
|
||
Original patch by glandium.
Assignee | ||
Updated•4 years ago
|
Assignee: nobody → bpostelnicu
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e011ef7d5445
make clang based tooling work for cross compile builds also. r=firefox-static-analysis-reviewers,sylvestre DONTBUILD
Comment 6•4 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 4 years ago
status-firefox96:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•