Skip to content
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] guard against inf recursion. #23195

Closed
wants to merge 21 commits into from

Conversation

Neumann-A
Copy link
Contributor

@Neumann-A Neumann-A commented Feb 20, 2022

requires cmake 3.18
closes #16454

Copy link

@github-actions github-actions bot left a 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!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 5cf60186a241e84e8232641ee973395d4fde90e1 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 6b3147e..165fa5e 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7542,7 +7542,7 @@
     },
     "zlib": {
       "baseline": "1.2.11",
-      "port-version": 13
+      "port-version": 14
     },
     "zlib-ng": {
       "baseline": "2.0.5",
diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json
index 7c0d68f..cc5ac06 100644
--- a/versions/z-/zlib.json
+++ b/versions/z-/zlib.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "6e9612a1beb3167f554ef45373ab272b56596f90",
+      "version": "1.2.11",
+      "port-version": 14
+    },
     {
       "git-tree": "92cfe30c807d343c6359d272242f0765ad906740",
       "version": "1.2.11",

You have modified or added at least one vcpkg.json where a "license" field is missing.

If you feel able to do so, please consider adding a "license" field to the following files:

  • ports/zlib/vcpkg.json
  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

ports/zlib/vcpkg.json Outdated Show resolved Hide resolved
@JackBoosY JackBoosY added category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed depends:different-pr This PR or Issue depends on a PR which has been filed labels Feb 21, 2022
Co-authored-by: autoantwort <[email protected]>
Copy link

@github-actions github-actions bot left a 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!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 5cf60186a241e84e8232641ee973395d4fde90e1 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 6b3147e..165fa5e 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7542,7 +7542,7 @@
     },
     "zlib": {
       "baseline": "1.2.11",
-      "port-version": 13
+      "port-version": 14
     },
     "zlib-ng": {
       "baseline": "2.0.5",
diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json
index 7c0d68f..f0f409f 100644
--- a/versions/z-/zlib.json
+++ b/versions/z-/zlib.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "27564e1e248f9c40b856871f6b112eb4c4971dc1",
+      "version": "1.2.11",
+      "port-version": 14
+    },
     {
       "git-tree": "92cfe30c807d343c6359d272242f0765ad906740",
       "version": "1.2.11",

You have modified or added at least one vcpkg.json where a "license" field is missing.

If you feel able to do so, please consider adding a "license" field to the following files:

  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

@Neumann-A
Copy link
Contributor Author

@JackBoosY: Why the tag depends:different-pr?

@JackBoosY JackBoosY removed the depends:different-pr This PR or Issue depends on a PR which has been filed label Feb 21, 2022
@JackBoosY
Copy link
Contributor

Ah sorry for that. Now we use cmake 3.22.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where a "license" field is missing.

If you feel able to do so, please consider adding a "license" field to the following files:

  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where a "license" field is missing.

If you feel able to do so, please consider adding a "license" field to the following files:

  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

@Neumann-A
Copy link
Contributor Author

Hmm the license bot is buggy for test ports

@JackBoosY
Copy link
Contributor

Ready for review now?

@Neumann-A Neumann-A marked this pull request as ready for review February 22, 2022 05:57
@Neumann-A
Copy link
Contributor Author

@JackBoosY Yes

@JackBoosY JackBoosY added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Feb 22, 2022
@JackBoosY
Copy link
Contributor

I'd like this PR and we should wait for other team members to review it.

Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to review further, but that's the obvious change I see right now.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where a "license" field is missing.

If you feel able to do so, please consider adding a "license" field to the following files:

  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are the only two things, then I'm approve (well, also have a vcpkg_underlying_add_executable and such)

ports/zlib/vcpkg-cmake-wrapper.cmake Outdated Show resolved Hide resolved
scripts/buildsystems/vcpkg.cmake Outdated Show resolved Hide resolved
Co-authored-by: nicole mazzuca <[email protected]>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where you should check the license field.

If you feel able to do so, please consider adding a "license" field to the following files:

  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one vcpkg.json where you should check the license field.

If you feel able to do so, please consider adding a "license" field to the following files:

  • scripts/test_ports/inf-recursion-test/vcpkg.json

Valid values for the license field can be found in the documentation

@JackBoosY
Copy link
Contributor

So what's the status here?

@Neumann-A
Copy link
Contributor Author

@JackBoosY Should be finished. The zlib issue seems to be gone since CI is green (?, never had a clue why it was happening any way and wasn't locally reproduciable)

@JackBoosY
Copy link
Contributor

@BillyONeal Can you please review again?

Thanks.

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Aug 19, 2022
@JavierMatosD JavierMatosD added requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. and removed info:reviewed Pull Request changes follow basic guidelines labels Aug 19, 2022
@JackBoosY JackBoosY assigned Cheney-W and unassigned JackBoosY Oct 14, 2022
@Neumann-A
Copy link
Contributor Author

I see the merge conflict; I ignore the merge conflict unless somebody is showing a willingness to merge. or should I invent a new 3.24 toolchain ?

@Cheney-W Cheney-W removed the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Nov 11, 2022
@Cheney-W
Copy link
Contributor

We should not do this: defending against the "before project()" case when all in-the-wild examples have been after project() seems like unnecessary complexity.

@Neumann-A
Copy link
Contributor Author

all in-the-wild examples have been after project()

Do you have a list of examples? The point here is also that for those examples we could patch them to be before project() (or also do the correct thing which is applied here.)

@BillyONeal
Copy link
Member

BillyONeal commented Jan 17, 2023

all in-the-wild examples have been after project()

Do you have a list of examples? The point here is also that for those examples we could patch them to be before project() (or also do the correct thing which is applied here.)

The ones listed in the rationale for the change (e.g. #16454) are that way.

@Cheney-W Cheney-W added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly and removed category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed labels May 17, 2023
@BillyONeal
Copy link
Member

Given that this change is complex and we haven't seen an in the wild example it will fix, I'm going to close this. Please feel to reopen it should an in the wild bug it would fix appears.

Thanks for your contribution!

@BillyONeal BillyONeal closed this Jun 22, 2024
@Neumann-A
Copy link
Contributor Author

@BillyONeal You still want to have z_vcpkg_underlying_find_package to someday support dependency providers. You want wrappers to stop using _find_package directly

@Neumann-A
Copy link
Contributor Author

@BillyONeal: Just saying: The overrides in vcpkg.cmake makes using vcpkg.cmake with my current employer in the current form impossible. I am more than capable enough to workaround that but other employees in other companies might not be able to do so.

It should be a priority to get rid of the plain _find_package calls in the wrappers.

@BillyONeal
Copy link
Member

@JavierMatosD @ras0219-msft @vicroms @AugP and I discussed. We make the following observations:

  1. The expected use case is:
    1. Define VCPKG_OVERRIDE_FIND_PACKAGE_NAME to something else
    2. You call macro(find_package ...)
    3. In your overridden macro, you call "something else"
      but we understand that this enforces that vcpkg is in the 'bottom' of the stack without excessive workarounds.
  2. We would be OK with adding a new feature for "the name of the thing we call that is not _find_package" but:
    • It needs infrastructure for the wrappers to call to avoid needing cmake_language(...)
    • We need a post build check for vcpkg-cmake-wrapper to fail if _find_package is present

@Neumann-A
Copy link
Contributor Author

Define VCPKG_OVERRIDE_FIND_PACKAGE_NAME to something else

That variable is currently broken and correctly supporting it requires cmake_language call.

We need a post build check for vcpkg-cmake-wrapper to fail if _find_package is present

Seems like a hen/egg problem. First requires the proper infrastructure in vcpkg.cmake and then can add the post build check into vcpkg-tool otherwise there is no way to fix the CI issues appearing due to the post build check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
8 participants