-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
brew install llvm --with-python --with-lldb --with-clang
fails
#39621
Comments
The real error:
And some related info: http://sushihangover.github.io/building-lldb-on-mac-os-x/ |
Ugh. LLVM 😭. You found about the one clear reference that I did as well. The
Maybe that's not getting run, or maybe it's being placed in the wrong location? If I run the project inside |
Does this repro with just |
This actually failed for me in a whole different way:
|
I'm pretty sure this is not a cmake regression - the code signing thing might be a 3.6 regression though. |
Should homebrew roll back the llvm formula to 3.6.0 until it's fixed upstream? Or perhaps error out if Or should users be expected to not attempt to upgrade llvm? The main pain here is waiting until the end of building llvm to hit the error from the build system. Burning that much time and CPU kinda sucks from a UX perspective, so a way to soften the blow until things are fixed would be nice. |
Would personally like to remove the |
Gonna ping @Homebrew/owners @bfontaine for some LLVM discussions. Let's make a decision about whether or not we're happy keeping the broken option around in the main Homebrew/homebrew formula. |
I'm missing some context. What discussion would you like to have? Is it correct that the build fails if and only if both Are the failure conditions identical for 3.6.0 and 3.6.1 or does 3.6.1 introduce new failure conditions? |
A general discussion I guess about what we do with
Building
Identical. It's the |
I'm inclined to fix the bug(reporting to upstream) rather than simple killing it. Becuase killing it doesn't solve anything. People who need lldb will continue to file issue to complain its missing. And given the popularity of lldb it wouldn't be just a few. |
I was able to successfully build 3.6.0 with |
I wanted to bring the following up, since from this issue and related issues it seems that it's understood this is a code signing issue, but I'm not sure everyone understands the why of it. It's well documented in LLDB that lldb needs to be code-signed. This isn't some peculiarity of LLDB -- GDB has to do this as well to work on Darwin. Darwin is the peculiar aspect to all this. The mach kernel has a So, it's not weird at all that LLDB requires code-signing to operate correctly as accessing another process is it's job. What is weird and frustrating is that:
After giving up on 3.6.1 out of brew last night -- dying at 98% is killer, btw -- I built an LLVM release from svn/git. LLVM, as I learned, is both over-documented and poorly documented thanks to documentation atrophy. However, the LLDB docs (above) pretty much spelled out what I needed to do with respect to code-signing. After creating an svn/git build, out of curiosity, I ran the brew install again and it just worked (as it had access to the lldb_codesign identity I had created). I also came across the CODESIGN_TOOLS make var (e.g So, while it's ugly, this could probably be solved with a prebuild/preinstall type feature that checks for the existence of (and maybe validity of) the lldb_codesign identity. Brew does have post install procedures that users are expected to manually take care of, so I suppose this wouldn't be beyond the pale. If someone is compiling LLVM with options, there's a good chance that an error/warning message with some documentation and asking them to retry would be greatly appreciated over a long running build that dies at 98%. I hope this information is helpful. Cheers! |
@greymouser nice writeup, thank you. Unfortunately, there's nothing we can do about the property of dying at 98%, and I'm totally with you that it sucks, but that's how the LLVM build system works; the codesign check happens lazily. I'm going to look into |
Homebrew can refuse to start the build if we can detect the failure condition in advance, like @DomT4 is suggesting. |
Right, but then homebrew's detection of the failure condition has to track logic in LLVM's build system. |
@tamird I may have conflated the situation earlier mentioning CODESIGN_TOOLS. I believe CODESIGN_TOOLS (and the corresponding TOOL_CODESIGN_IDENTITY setting it uses) is intended for distributors (e.g. Apple) to sign all binaries created by the build. This logic is in However, this is not the case (i.e. separate from) for the While the actual name of the identity "lldb_codesign" might change, the test and check is easy enough ... something like the following from the build root should return enough info to stop the build early enough, if the user does not have a valid lldb_codesign cert in place:
|
@greymouser open a PR? |
We need to do something about this soon. It is horrible UX to allow the build to get to ~90% and have it fail at that point, especially given the length of an LLVM diff --git a/Library/Formula/llvm.rb b/Library/Formula/llvm.rb
index cad8897..78e7856 100644
--- a/Library/Formula/llvm.rb
+++ b/Library/Formula/llvm.rb
@@ -69,6 +69,7 @@ class Llvm < Formula
option "with-rtti", "Build with C++ RTTI"
option "with-python", "Build Python bindings against Homebrew Python"
option "without-assertions", "Speeds up LLVM, but provides less debug information"
+ option "with-confirmed-codesign", "I have the necessary codesigning identity for LLDB"
deprecated_option "rtti" => "with-rtti"
deprecated_option "disable-assertions" => "without-assertions"
@@ -91,6 +92,15 @@ class Llvm < Formula
# Apple's libstdc++ is too old to build LLVM
ENV.libcxx if ENV.compiler == :clang
+ if build.with?("lldb") && build.without?("confirmed-codesign")
+ raise <<-EOS.undent
+ lldb_codesign identity must be available to build with LLDB.
+ See: https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt
+
+ Please confirm that it is by passing `--with-confirmed-codesign` to brew.
+ EOS
+ end For discussion tomorrow. Welcome less hacky workarounds - Whether here or upstream. |
That change looks good to me. There is no sane programmatic way to create certificates, the clicky process seems to be the only way. |
Adds a codesign requirement for lldb option invocation. Closes Homebrew#39621. Closes Homebrew#40359. Closes Homebrew#40617. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
https://gist.github.com/xu-cheng/41ca3c4ad95a72351e39
cc @DomT4, @tamird
The text was updated successfully, but these errors were encountered: