Closed
Bug 1238251
Opened 9 years ago
Closed 9 years ago
Add LLVM detection support to MozillaBuild
Categories
(Firefox Build System :: MozillaBuild, task)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gkw, Assigned: gkw)
References
Details
Attachments
(1 file)
(deleted),
patch
|
RyanVM
:
review+
|
Details | Diff | Splinter Review |
We are (apparently) now able to compile Firefox and SpiderMonkey js shell using Clang on Windows. This patch adds detection support to LLVM and sets paths accordingly.
This should work with LLVM 3.7.1 for Windows downloaded from llvm.org [1], both 32-bit and 64-bit. However it only works properly when *either* 32-bit *or* 64-bit LLVM is installed, not both.
Setting feedback? from Ryan and Ted as a start, comments appreciated. Please also let me know the right reviewer for this.
[1] http://llvm.org/releases/download.html#3.7.1
Attachment #8705981 -
Flags: feedback?(ted)
Attachment #8705981 -
Flags: feedback?(ryanvm)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → gary
Status: NEW → ASSIGNED
Comment 1•9 years ago
|
||
Rust depends on LLVM too, right? Should we consider just shipping LLVM w/ MozillaBuild?
Comment 2•9 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #1)
> Rust depends on LLVM too, right? Should we consider just shipping LLVM w/
> MozillaBuild?
Rust ships its own version of LLVM, so I don't think we should ship LLVM with MozillaBuild for Rust's sake. We could consider shipping clang-cl with MozillaBuild...
Comment 3•9 years ago
|
||
That seems woefully inefficient :\
Comment 4•9 years ago
|
||
Maybe as Rust matures we'll get to the point where it's easier to track LLVM upstream and/or you can build Rust with your own LLVM. Until that point...
Assignee | ||
Comment 5•9 years ago
|
||
Can we have an interim measure in the meantime? If we include clang-cl.exe, what about the asan libraries?
Flags: needinfo?(nfroyd)
Comment 6•9 years ago
|
||
Sure, we could do that. LLVM would add 50% (32-bit) or more (64-bit) to the size of MozillaBuild; I don't know if we have strong feelings about that.
If we are going to package LLVM, I'd wait for the 3.8 release, which is coming out "soon".
Flags: needinfo?(nfroyd)
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #6)
> LLVM would add 50% (32-bit) or more (64-bit) to the
> size of MozillaBuild; I don't know if we have strong feelings about that.
Ryan had wanted to keep the size of MozillaBuild down previously, but not sure if this feeling extends to essential utilities.
> If we are going to package LLVM, I'd wait for the 3.8 release, which is
> coming out "soon".
Can we still land this detection in the interim 2.2.0 (currently -pre) release? Or package 3.7.1 as a start?
We can also follow up packaging 3.8 in 2.3.0, LLVM sometimes slips in their release schedule.
Flags: needinfo?(ryanvm)
Comment 8•9 years ago
|
||
Yeah, let's not let the discussion about bundling LLVM get in the way of this bug, which can happen regardless.
Flags: needinfo?(ryanvm)
Comment 9•9 years ago
|
||
It's not clear to me why we'd include LLVM, as that's not really for building. Then again, I think we include emacs, and that's not really for building either...
Anyway, Gary, want to file a different bug about bundling LLVM?
Flags: needinfo?(gary)
Assignee | ||
Comment 10•9 years ago
|
||
LLVM is needed for compiling at least the js shell with Clang+ASan, so it is related to building.
Nonetheless, spun off bug 1238318.
Flags: needinfo?(gary)
Comment 11•9 years ago
|
||
Comment on attachment 8705981 [details] [diff] [review]
llvmDetectionPatchV1.diff
Review of attachment 8705981 [details] [diff] [review]:
-----------------------------------------------------------------
Looks fine, go ahead and land it.
Attachment #8705981 -
Flags: review+
Attachment #8705981 -
Flags: feedback?(ted)
Attachment #8705981 -
Flags: feedback?(ryanvm)
Assignee | ||
Comment 12•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Comment 13•9 years ago
|
||
The patch as-landed is causing "ERROR: The system was unable to find the specified registry key or value." to appear if LLVM isn't installed. Changing the "IF ERRORLEVEL 0 (" to "IF NOT ERRORLEVEL 1 (" appears to fix it. Can you please confirm locally that the path still gets properly set if you make that change locally?
Flags: needinfo?(gary)
Comment 14•9 years ago
|
||
Ugh, this also pollutes PATH whether LLVM is there or not (you're adding %LLVMDIR%\bin unconditionally).
Comment 15•9 years ago
|
||
Here's what I changed that block to locally, which fixes the various issues on my end.
------------------------
REM Set up LLVM if present.
SET LLVMDIR=
IF "%WIN64%" == "1" (
SET LLVMKEY=HKLM\SOFTWARE\Wow6432Node\LLVM\LLVM
) ELSE (
SET LLVMKEY=HKLM\SOFTWARE\LLVM\LLVM
)
REM Find the LLVM installation directory
REG QUERY "%LLVMKEY%" /ve >nul 2>nul
IF NOT ERRORLEVEL 1 (
FOR /F "tokens=2*" %%A IN ('REG QUERY "%LLVMKEY%" /ve') DO SET LLVMDIR=%%B
SET "PATH=%PATH%;%LLVMDIR%\bin"
)
------------------------
Let me know if that still properly creates the environment for you as well.
Comment 16•9 years ago
|
||
Actually, make that last line |SET PATH=%PATH%;%LLVMDIR%\bin| (no quotes)
Assignee | ||
Comment 17•9 years ago
|
||
Please go ahead and make necessary changes, I won't be able to test till next week.
Flags: needinfo?(gary) → needinfo?(ryanvm)
Comment 18•9 years ago
|
||
Nevermind, I went ahead and installed LLVM locally to test it out. Confirmed that the
https://hg.mozilla.org/mozilla-build/rev/fbfba3e7c65f
Comment 19•9 years ago
|
||
New test build is up. Please try it out when you get a chance.
https://bugzilla.mozilla.org/show_bug.cgi?id=1224680#c8
Blocks: MozillaBuild2.2
Flags: needinfo?(ryanvm)
Updated•2 years ago
|
Product: mozilla.org → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•