This patch correctly sets the devtoolset on RHEL.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Driver/ToolChains/Gnu.cpp | ||
---|---|---|
2152 | I believe this will cause a failure with the unit test added in the original patch. And presumably since the unit test tests for paths that don't include /root/usr, there are real world toolsets that also don't use that suffix. So we should presumably add both Prefixes. | |
2157–2159 | Can we not just change this to something like: if (ChosenToolsetVersion > 0) { Prefixes.push_back(ChosenToolsetDir); Prefixes.push_back(ChosenToolsetDir + "/root/usr"); } |
Thank you @nemanjai! I've updated the patch based on your suggestion and tested it for both the existing testcase and the RHEL buildbot failure.
Do you have more authoritative answer when /root/usr is used and when it isn't?
I'd wish that we have comments for them.
This change also needs a unit test.
These suffixes were always part of the code and the mentioned changeset removed it without any justification. The burden of providing this answer should lie with the author of the change that removed this (i.e. @tbaeder). Here at IBM, we are not aware of any Redhat release that does not have this suffix. Namely, all of our RH PowerPC machines with all the toolset versions and distro versions we have available have the suffix. So we are ill equipped to answer this question. I assume that Timm is aware of situations where this isn't part of the path.
I'd wish that we have comments for them.
I agree 100%. Timm, do you know the answer to this and if so, can you propose a comment to that end?
This change also needs a unit test.
+1
I did not remove that on purpose, so adding it back makes sense to me.
This change also needs a unit test.
+1
Does the existing unit test not break with this change?
Addressing review comments. Removing path without /root/usr suffix and changing unit test to match.
Thanks @tbaeder, @MaskRay, and @nemanjai.
I did not remove that on purpose, so adding it back makes sense to me.
I've updated the patch to remove the path without the /root/usr suffix and exclusively add the path with the root/usr suffix.
This change also needs a unit test.
I've updated the existing test case to match this change.
I believe this will cause a failure with the unit test added in the original patch.
And presumably since the unit test tests for paths that don't include /root/usr, there are real world toolsets that also don't use that suffix. So we should presumably add both Prefixes.