[PATCH] D126308: cmake: use llvm dir variables for clang/utils/hmaptool
Matheus Izvekov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 31 08:22:31 PDT 2022
mizvekov added a comment.
In D126308#3547435 <https://reviews.llvm.org/D126308#3547435>, @nikic wrote:
> In D126308#3546235 <https://reviews.llvm.org/D126308#3546235>, @mizvekov wrote:
>
>> In D126308#3545937 <https://reviews.llvm.org/D126308#3545937>, @Ericson2314 wrote:
>>
>>> There is a lot of cruft behind the signs. I would just use `LLVM_TOOLS_INSTALL_DIR` then which is exported to get this unblocked, and I'll rebase D117977 <https://reviews.llvm.org/D117977> to try to clean these things up later.
>>
>> Done in https://reviews.llvm.org/D126671
>
> Thanks for the fix! Unfortunately I'm still seeing a build failure related to this change:
>
> [176/1855] cd /builddir/build/BUILD/clang-15.0.0.src/redhat-linux-build/utils/hmaptool && /usr/bin/cmake -E copy /builddir/build/BUILD/clang-15.0.0.src/utils/hmaptool/hmaptool /usr/bin
> FAILED: /usr/bin/hmaptool
> cd /builddir/build/BUILD/clang-15.0.0.src/redhat-linux-build/utils/hmaptool && /usr/bin/cmake -E copy /builddir/build/BUILD/clang-15.0.0.src/utils/hmaptool/hmaptool /usr/bin
> Error copying file "/builddir/build/BUILD/clang-15.0.0.src/utils/hmaptool/hmaptool" to "/usr/bin".
>
> TBH I don't really understand why this fails and I can't reproduce this when running the commands manually. I'd have said there is a race condition here due to a missing dependency, but as this is copying a file from the source directory, I don't really see how that could be.
>
> However, seeing this copy command, I think the change being make here is fundamentally incorrect. This is copying hmaptool into LLVM_TOOLS_BINARY_DIR (as part of the normal build, //not// as part of an install command), where LLVM_TOOLS_BINARY_DIR is the location of the //installed// LLVM tools. This means we end up copying `hmaptool` into something like `/usr/bin` as part of a normal build, which definitely shouldn't be happening. The tool should only get copied into the right location in the cmake build directory (which is what the previous implementation did).
On a unified build, this is what I get:
`LLVM_TOOLS_BINARY_DIR: C:/Users/mizve/source/repos/llvm/build/dbg/llvm/./bin`
If on a standalone build that points to the llvm install dir, then this is confusing, but I understand now.
I will try to get this resolved, but if this is blocking you then feel free to revert for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126308/new/
https://reviews.llvm.org/D126308
More information about the cfe-commits
mailing list