fix clang build version on Ubuntu Artful#3943
Conversation
There was a problem hiding this comment.
This indentation change is incorrect; it's part of the if statement above. Also, what is present in the .* before RELEASE?
There was a problem hiding this comment.
The string is clang version 5.0.1 (tags/RELEASE_501/final).
According to the pastebins I was able to find, the "501" is what's found under osx.
There was a problem hiding this comment.
Cool, thanks. What about making it tags/RELEASE_ instead of .*?
There was a problem hiding this comment.
I was less certain that would continue to match, and I don't think the current pattern will over-match.
There was a problem hiding this comment.
@bukzor I'd rather we go for something more conservative for now and extended when needed. Thanks!
0db9fdd to
f08eddb
Compare
Library/Homebrew/system_config.rb
Outdated
There was a problem hiding this comment.
The intent is to make it more noticeable when the above regex doesn't match. I think it does a good job of that.
The output in that case looks like so:
Clang: 5.0 build ???
There was a problem hiding this comment.
I'd suggest Clang: 5.0 build N/A.
There was a problem hiding this comment.
"Not applicable" is the correct answer when a tool is not installed, which is its usage in the rest of this file, but the build number is indeed applicable when clang is installed, as it is here.
There was a problem hiding this comment.
Fair enough. I don't feel strongly.
There was a problem hiding this comment.
I changed the "???" string to "(parse error)", which should be more clear.
bukzor
left a comment
There was a problem hiding this comment.
Offenses:
Library/Homebrew/development_tools.rb:77:48: C: Use %r around regular expression.
build_version = `#{path} --version`[/clang(-| version [^ ]+ \(tags\/RELEASE_)(\d{2,})/, 2]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Library/Homebrew/system_config.rb:213:64: C: Ternary operators must not be nested. Prefer if or else constructs instead.
f.puts "Clang: #{clang.null? ? "N/A" : "#{clang} build #{clang_build.null? ? "???" : clang_build}"}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
@bukzor You can reproduce those errors locally with |
f08eddb to
8b27b84
Compare
|
I'm not 100% happy with the result, but |
|
Thanks again @bukzor! |
|
Thank you too @MikeMcQuaid. It's a pleasure to work with you all. You and the rest of the homebrew team are a role model for open-source upstreams, and collaborative software in general. |
|
@bukzor Thanks for the kind words and taking the time to say them. We end up dealing with a lot of bile so comments like this are touching ❤️ |
Ported from Linuxbrew/brew#621
Before:
After: