Semi-colon separated lists in portfile becomes multi-quote guarded, space delimited strings on the command line #4320
Labels
category:vcpkg-feature
The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
I'm trying to enhance the LLVM package to suit my needs, but there is a big problem which I spent over a day now trying to come over. (This is the kind of aggravation which makes me start to think that Vcpkg does not scale.)
LLVM requires a
LLVM_TARGETS_TO_BUILD
variable which by the docs should be a semi-colon delimited string, so the native CMake encoding for lists. Currently the LLVM port only builds the X86 target, but I want it to also build GPU-related targets. (Currently it's hardcoded, but before I submit, I'll make non-x86 targets features of the package.) Problem is, that if I write this in the portfile:It does not matter if I use quotes or not, the command-line invocation contains:
Things from here on start to fall apart spectacularly. (
LLVM_EXPERIMENTAL_TARGETS_TO_BUILD
is undocumented, which targets should be placed there, it just argues seemingly randomly if something's not there. So I just duplicate everything. The two get merged anyway in the mainCMakeLists.txt
file via)This is the code snippet that calls the LLVM-build Python scripts:
The error becomes:
of course, because the scripts got derailed a few lines back in LLVM-Config.cmake before invoking the Python scripts when it tried
The variable with the semi-colons stripped is no longer a list.
The fix is to add:
which results in configuration succeeding.
Summa summarum
Having to patch the build scripts solely because Vcpkg messes up command-line invocations containing native CMake lists is not okay.
The text was updated successfully, but these errors were encountered: