[harfbuzz] Remove PARENT_SCOPE in harfbuzzConfig.cmake.in#23709
[harfbuzz] Remove PARENT_SCOPE in harfbuzzConfig.cmake.in#23709LilyWangLL wants to merge 11 commits intomicrosoft:masterfrom
Conversation
|
Thanks a lot @LilyWangLL / @JackBoosY , these changes look good to me (bug reporter). I just hope removing PARENT_SCOPE isn't going to break someone else's workflow, I'm most likely not familiar with all possible use cases. |
removing PARENT_SCOPE is correct. |
|
@Neumann-A Thanks for the clarification. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@LilyWangLL merge with master again? |
…LilyWang/issue23694
| get_filename_component(_INSTALL_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) | ||
| target_include_directories(harfbuzz INTERFACE "${_INSTALL_DIR}/include/harfbuzz") | ||
|
|
||
| set(HARFBUZZ_LIBRARY harfbuzz::harfbuzz) |
There was a problem hiding this comment.
Using PARENT_SCOPE will pass the variable to the upstream, and this port cannot use this variable, so add a variable to this port for itself.
|
You should revert cf01dcf
|
But if doesn't use |
Then those ports are doing it wrong and need fixing |
If the config file only provides targets, we should probably add these macros to the wrapper in order to adapt to the MODULE mode. |
Wait are some of those variables |
|
Thanks everyone for working on this! I'd just like to remind that this PR is supposed to fix the following bug: #23694 The bug is that calling because of all the lines in harfbuzzConfig.cmake.in which set a variable using PARENT_SCOPE, where in fact there is no parent scope. As of now, the PR isn't modifying these lines. It is just adding other lines, so the warning will remain and the bug will not be fixed. I see a couple of options:
Thanks! |
There is no official Find module for Harfbuzz, so there cannot be a wrapper. And going one step further, if there is no official Find module and upstream doesn't provide these variables in exported config, then the variables shouldn't be patched in by vcpkg IMHO. This is the wrong direction of dependencies, and it is inviting user dependencies on non-standard variables. |
|
Since implementing the "most correct" solution (fixing ports depending on Harfbuzz) seems to not get any traction, I would suggest in the meantime to implement the following workaround: testing if the current scope has a parent and applying PARENT_SCOPE or not accordingly. It would look like this: Should I make a PR with such change? Or maybe @LilyWangLL you could integrate this change to this PR so we can see if the checks pass with this approach? Thanks! |
|
Any updates on this? |
Sorry I missed the previous comment, I will test this soon. Thanks very much for your suggestion~ |
|
@LilyWangLL Perfect, thanks a lot! |
…LilyWang/issue23694 # Conflicts: # ports/harfbuzz/vcpkg.json # versions/baseline.json # versions/h-/harfbuzz.json
…LL/vcpkg into dev/LilyWang/issue23694 # Conflicts: # versions/h-/harfbuzz.json
There was a problem hiding this comment.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout a2d8a7cbb15cac91d6c59cd967ef9d85105832c3 -- versions
./vcpkg x-add-version --allDiff
diff --git a/versions/baseline.json b/versions/baseline.json
index 78c0722..13c3396 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2738,7 +2738,7 @@
},
"harfbuzz": {
"baseline": "4.2.0",
- "port-version": 0
+ "port-version": 1
},
"hash-library": {
"baseline": "8",
diff --git a/versions/h-/harfbuzz.json b/versions/h-/harfbuzz.json
index 32ecc78..dd67748 100644
--- a/versions/h-/harfbuzz.json
+++ b/versions/h-/harfbuzz.json
@@ -1,5 +1,10 @@
{
"versions": [
+ {
+ "git-tree": "668c7b8a674e336506ce31422bce05fce79345b9",
+ "version": "4.2.0",
+ "port-version": 1
+ },
{
"git-tree": "02ad2865be7815604bb2c0e6cbc368f3d23d93d6",
"version": "4.2.0",|
Closed as duplicate to #25092 |
Fixes #23694
Remove
PARENT_SCOPEin harfbuzzConfig.cmake.in, because it will make the variables ofHARFBUZZ_LIBRARYand so on can not set in CMake project. Like the following error: