Stop trying to be clever when finding user's LLVM installation #3077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clever is bad. Eventually it bites you in the ass. Ask The Narrator, he
knows.
Prior to this commit, we were trying to be clever and helpful and would
bend over backwards to try and find the user's LLVM installation
whereever their package manager of choice might put it. This was, in the
end, a losing battle. We were constantly adding more and more
variations.
To make it worse, we tried to have a hierarchy where we would look for
LLVM 7 first then 6 etc. We did this by looking something like:
llvm-config-7
llvm-config-6
The problem with this approach was that some installations, wouldn't use
the
-7
notation. For example, if you download a release directly fromreleases.llvm.org, then your llvm-config will simply be
llvm-config
.I discovered this when, after installing LLVM 7 from releases.llvm.org,
I continued to have LLVM 6 used because the search loooked something
like:
llvm-config-7
llvm-config-6
... more stuff ...
llvm-config
In the end, that's all just too much clever.
With this change, we'll use the first
llvm-config
we find in your pathIF you haven't set the LLVM_CONFIG environment variable which should be
considered the preferred way to select an LLVM when building ponyc.
Closes #3072