New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vcpkg-cmake] Fix the application of VCPKG_CMAKE_CONFIGURE_OPTIONS with more than one option #25123
[vcpkg-cmake] Fix the application of VCPKG_CMAKE_CONFIGURE_OPTIONS with more than one option #25123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for vcpkg-cmake have changed but the version was not updated
version: 2022-05-10
old SHA: e8db2f70aa8b584aac932fcff65d91bf52d57731
new SHA: d7d00bd5179b04630039999dad32abb3f4185264
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
I don't understand what the bot is asking for, here. This seems unfriendly to the uninitiated. I'm just fixing basically a typo-like issue :-). |
@walbourn assisted offline. Appreciated. |
And after modifying the version, now it all has a merge conflict with another PR that beat me by a matter of minutes. I am sending this PR from a fork (github way of doing things?). I don't know how to pull the new master branch into my fork so I can re-resolve the conflict (git fetch does nothing), and I don't know what the correct resolution is now:
More assistance appreciated. |
…ne option VCPKG_CMAKE_CONFIGURE_OPTIONS (plural) is meant to be a list of options to be added to a cmake invocation. But it was being applied quoted, which disallowed it from containing multiple options. - If it was initialized with a list, cmake would get the options ";"-separated. - If it was initialized with a blank-separated string, cmake would get the entire astring quoted as a single argument. The fix is simple: don't (ever) quote arguments to list(APPEND) unless they are really meant to be a single element to append to the list.
c239b77
to
49ce487
Compare
I think this changes is correct, @Neumann-A what do you think about? |
I think this is the right change here. |
There is one thing that need to be noticed is that this issue may also happened in other functions |
|
@Neumann-A "If it would have been just list() the extra quotes would have been necessary" - Necessary in order to allow options with (quoted) semicolons in them? I'm still wrapping my head around this. @dg0yt "insight in some of the quirks resolved by the function" - The unit test shows the behaviors that the function is supposed to implement, but not the differences with CMake's own list() function (which is not really documented to this amount of detail). Thanx all! |
I guess I don't have write access to merge this? Appreciate it if someone else does it before conflicts creep in. |
In my defence, I'm new to this...
Describe the pull request
VCPKG_CMAKE_CONFIGURE_OPTIONS (plural) is meant to be a list of options to be added to a cmake invocation.
But it was being applied quoted, which disallowed it from containing multiple options.
The fix is simple: don't (ever) quote arguments to list(APPEND) unless they are really meant to be a single element to append to the list.
What does your PR fix?
Fixes an issue I encountered when adding a custom triplet that uses a toolchain file.
I see issues #17750 and #23741 (and 23852 more indirectly) all contain reports of multiple options working correctly. Apparently PR #23259 inadvertently broke it by substituting list() with vcpkg_list().
vcpkg_list() top comments say "A replacement for CMake's
list()
function, which correctly handles elementswith internal semicolons (in other words, escaped semicolons)", but fail to explain what's the nature of the issue, and the code is not trivial to follow, so I'm guiding myself from empirical observation. Explanations and insights are welcome. In the meantime, removing the quotes here works around the issue.
Which triplets are supported/not supported? Have you updated the CI baseline?
N/A
Does your PR follow the maintainer guide?
Yes (it's just basically a typo fix).
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?N/A
If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/