Closed Bug 1238251 Opened 9 years ago Closed 9 years ago

Add LLVM detection support to MozillaBuild

Categories

(Firefox Build System :: MozillaBuild, task)

All
Windows
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gkw, Assigned: gkw)

References

Details

Attachments

(1 file)

Attached patch llvmDetectionPatchV1.diff (deleted) — 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: nobody → gary
Status: NEW → ASSIGNED
Rust depends on LLVM too, right? Should we consider just shipping LLVM w/ MozillaBuild?
(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...
That seems woefully inefficient :\
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...
Can we have an interim measure in the meantime? If we include clang-cl.exe, what about the asan libraries?
Flags: needinfo?(nfroyd)
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)
(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)
Yeah, let's not let the discussion about bundling LLVM get in the way of this bug, which can happen regardless.
Flags: needinfo?(ryanvm)
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)
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 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)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
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)
Ugh, this also pollutes PATH whether LLVM is there or not (you're adding %LLVMDIR%\bin unconditionally).
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.
Actually, make that last line |SET PATH=%PATH%;%LLVMDIR%\bin| (no quotes)
Please go ahead and make necessary changes, I won't be able to test till next week.
Flags: needinfo?(gary) → needinfo?(ryanvm)
Nevermind, I went ahead and installed LLVM locally to test it out. Confirmed that the https://hg.mozilla.org/mozilla-build/rev/fbfba3e7c65f
New test build is up. Please try it out when you get a chance. https://bugzilla.mozilla.org/show_bug.cgi?id=1224680#c8
Flags: needinfo?(ryanvm)
Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: