-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
build: fix llvm version detection in freebsd-10 #11668
Conversation
In FreeBSD-10, the banner of clang version is "FreeBSD clang version". Fix regex to detect it.
configure
Outdated
@@ -576,7 +576,8 @@ def get_version_helper(cc, regexp): | |||
|
|||
def get_llvm_version(cc): | |||
return get_version_helper( | |||
cc, r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)") | |||
cc, r"(^clang version|^FreeBSD clang version|based on LLVM) " + | |||
"([3-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.
You could simply remove the anchor, I think?
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.
I thought it could be fixed but have no full confirmation if it has no side effects. This is very conservative fix not to break existing checks.
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.
I suppose a little conservatism won't hurt. Can you line up the strings?
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.
I'm a little coward ;-).
get_xcode_version
in 4 lines below had also 4 space indents. I fixed both. Thanks.
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.
LGTM with a style nit.
configure
Outdated
@@ -576,7 +576,8 @@ def get_version_helper(cc, regexp): | |||
|
|||
def get_llvm_version(cc): | |||
return get_version_helper( | |||
cc, r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)") | |||
cc, r"(^clang version|^FreeBSD clang version|based on LLVM) " + | |||
"([3-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.
I suppose a little conservatism won't hurt. Can you line up the strings?
CI was done in https://ci.nodejs.org/job/node-test-pull-request/6682/ and all is green. |
configure
Outdated
@@ -576,11 +576,12 @@ def get_version_helper(cc, regexp): | |||
|
|||
def get_llvm_version(cc): | |||
return get_version_helper( | |||
cc, r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)") | |||
cc, r"(^clang version|^FreeBSD clang version|based on LLVM) " + |
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.
An alternative would be a non-capturing group, e.g.
cc, r"(^(?:FreeBSD )?clang version|based on LLVM) " +
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.
I did not think of a non-capturing parentheses. It does not break existing check and looks better. Thanks.
@bnoordhuis I fixed in ed1d266. PTAL.
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.
Confirmed it works fine in both FreeBSD-10 of clang-3.4 with OS prefix in its banner, https://ci.nodejs.org/job/node-test-commit-freebsd/7474/nodes=freebsd10-64/consoleFull and FreeBSD-11 of clang-3.6 without no OS prefix ,https://ci.nodejs.org/job/node-test-commit-freebsd/7474/nodes=freebsd11-x64/consoleFull .
In FreeBSD-10, the banner of clang version is "FreeBSD clang version". Fix regex to detect it. PR-URL: #11668 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
In FreeBSD-10, the banner of clang version is "FreeBSD clang version". Fix regex to detect it. PR-URL: #11668 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
In FreeBSD-10, the banner of clang version is "FreeBSD clang version". Fix regex to detect it. PR-URL: #11668 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
In FreeBSD-10, the banner of clang version is "FreeBSD clang version". Fix regex to detect it. PR-URL: #11668 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
In FreeBSD-10, the banner of clang version is "FreeBSD clang version". Fix regex to detect it. PR-URL: nodejs/node#11668 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
In FreeBSD-10, the banner of clang version start with "FreeBSD clang version" but the current
configure
checks/^clang version/
so thatllvm_version
is 0 and openssl is built with asm_obsolete.This can be seen in the CI output of https://ci.nodejs.org/job/node-test-commit-freebsd/7417/nodes=freebsd10-64/consoleFull that
'llvm_version': 0,
in the current configure output.With this fix, the clang version banner can be checked properly in FreeBSD-10. The result of https://ci.nodejs.org/job/node-test-commit-freebsd/7419/nodes=freebsd10-64/consoleFull shows that
'llvm_version': '3.4',
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
build
CC: @nodejs/platform-freebsd or @nodejs/build