-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
account for CLANG_VENDOR when checking for llvm version #33860
Conversation
@@ -805,7 +805,7 @@ def get_nasm_version(asm): | |||
|
|||
def get_llvm_version(cc): | |||
return get_version_helper( | |||
cc, r"(^(?:FreeBSD )?clang version|based on LLVM) ([0-9]+\.[0-9]+)") | |||
cc, r"(^(?:.+ )?clang version|based on LLVM) ([0-9]+\.[0-9]+)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For detecting the support of OpenSSL's functionality, configure.py
checks xcode_version>=5.0
or llvm_version>=3.3
in https://github.com/nodejs/node/blob/master/configure.py#L1330
Thus, it changes the detection result for ex. Apple clang version 4.0
.
If you need to check for Alpine
, below one would be better.
- cc, r"(^(?:FreeBSD )?clang version|based on LLVM) ([0-9]+\.[0-9]+)")
+ cc, r"(^(?:(?:FreeBSD|Alpine) )?clang version|based on LLVM) ([0-9]+\.[0-9]+)")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what this PR is intended to fix. It won't be feasible to hard code the regex string for specific CLANG_VENDORs. Because what if I want to compile clang myself and I set my CLANG_VENDOR to "MyClang". Now I have to recompile Nodejs for whatever distribution I'm using - and I haven't even changed anything specifically related to Nodejs's functionality or behavior. The check here only cares about returning a version string - it doesn't care about the vendor; so there should be no need to do anything other than match against a Word.
I also compiled nodejs using this branch on my Macbook Pro and it worked just fine. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late response.
The problem I pointed out does not occur now, because Apple LLVM >= 10
is the supported version.
Landed in 409fdba |
Checklist
Apologies if I'm forgetting something - this is my first commit to node. I didn't think it necessary to include testing results as no src code is actually modified; only the configure script.
Please see issue #29536 for more details. I have not verified if this breaks configurations on systems like
void-linux
where a CLANG_VENDOR` is not specified, but it did fix the issue on alpine linux. Before this PR is merged, I'd like to investigate that it can be built in such cases.In the meantime, it would help to possibly get other members to verify the change allows clang/llvm to be recognized by their various systems.