Skip to content
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

Closed
wants to merge 1 commit into from
Closed

account for CLANG_VENDOR when checking for llvm version #33860

wants to merge 1 commit into from

Conversation

nathanblair
Copy link
Contributor

@nathanblair nathanblair commented Jun 13, 2020

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.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Jun 13, 2020
@@ -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]+)")
Copy link
Contributor

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]+)")

Copy link
Contributor Author

@nathanblair nathanblair Jun 13, 2020

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. 😄

Copy link
Contributor

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.

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 19, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

jasnell pushed a commit that referenced this pull request Jun 25, 2020
Fixes: #29536

PR-URL: #33860
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Jun 25, 2020

Landed in 409fdba

@jasnell jasnell closed this Jun 25, 2020
codebytere pushed a commit that referenced this pull request Jun 27, 2020
Fixes: #29536

PR-URL: #33860
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@codebytere codebytere mentioned this pull request Jun 28, 2020
codebytere pushed a commit that referenced this pull request Jun 30, 2020
Fixes: #29536

PR-URL: #33860
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
codebytere pushed a commit that referenced this pull request Jul 10, 2020
Fixes: #29536

PR-URL: #33860
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
codebytere pushed a commit that referenced this pull request Jul 12, 2020
Fixes: #29536

PR-URL: #33860
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@codebytere codebytere mentioned this pull request Jul 13, 2020
codebytere pushed a commit that referenced this pull request Jul 14, 2020
Fixes: #29536

PR-URL: #33860
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants