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_configure_cmake] Introduce REQUIRE_ALL_PACKAGES #15808

Closed
wants to merge 3 commits into from

Conversation

ras0219
Copy link
Contributor

@ras0219 ras0219 commented Jan 22, 2021

A recurring problem with many builds are uses of autodetected dependencies; depending on the specific install order, different CI runs results in different results for detection which results in flaky, unrobust behavior.

This PR introduces new flags to vcpkg_configure_cmake() to control this: REQUIRE_ALL_PACKAGES, DISABLE_PACKAGES, and OPTIONAL_PACKAGES.

A deficiency in the current PR implementation is that disables are also applied to transitive find_package()/find_dependency() calls; this is problematic in that it (in the most general case) requires each port to calculate the transitive closure of packages used under the current configuration and compute a disable list using all that information. Ideally, we would only apply DISABLE_PACKAGES to the first level of find_package(), which allows these settings to only concern themselves with local information.

@JackBoosY JackBoosY self-assigned this Jan 22, 2021
@JackBoosY JackBoosY added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly info:internal This PR or Issue was filed by the vcpkg team. labels Jan 22, 2021
@cenit
Copy link
Contributor

cenit commented Jan 22, 2021

Very nice and very useful. Might help also reducing patchsets in some ports (and improve their maintainability too)

@cenit
Copy link
Contributor

cenit commented Jan 22, 2021

Is it necessary to remove the QUIET keyword from ${ARGS}? Or putting REQUIRED at the end always wins?

@@ -605,20 +623,20 @@ macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name)
else()
set(Boost_COMPILER "-vc140")
endif()
_find_package(${ARGV})
_find_package(${ARGV} ${_REQUIRED})
elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h")
Copy link
Contributor

Choose a reason for hiding this comment

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

everything below should probably be installed within a port via a vcpkg-cmake-wrapper.cmake instead of being in the toolchain.

Copy link
Contributor

Choose a reason for hiding this comment

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

i agree. They belong to a time in which vcpkg-cmake-wrapper.cmake was not existing...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, but I didn't want to make that change in this PR.

@cenit
Copy link
Contributor

cenit commented Jan 22, 2021

Just few years ago @Neumann-A (or me) would have triggered a full rebuild just after this PR was merged, enabling the REQUIRE_ALL_PACKAGES by default. And I would have really enjoyed the result of that hard work!
It would be a very reasonable default, to have more reproducible builds. But I understand that it would be very very difficult, with many broken ports at first. The outcome would be a better vcpkg too

@ras0219
Copy link
Contributor Author

ras0219 commented Jan 22, 2021

We unfortunately can no longer do such "break the world" operations with the new versioning and registries features -- we've lost "total" atomicity in exchange for stability.

However, we do intend to make this a requirement for all new ports and to eventually apply this policy to every current port.

@ras0219 ras0219 force-pushed the dev/roschuma/cmake-opt-deps branch 15 times, most recently from acc9cd5 to 56e849e Compare February 1, 2021 01:46
@ras0219 ras0219 force-pushed the dev/roschuma/cmake-opt-deps branch 2 times, most recently from 46de5b7 to 9dabfc5 Compare February 11, 2021 20:12
@ras0219-msft
Copy link
Contributor

/azp run

@wrobelda
Copy link
Contributor

wrobelda commented Mar 15, 2021

Don't want to sound needy or something, but it is a blocker for a number of PRs right now, which is a bummer. Has this stalled?

ports/armadillo/vcpkg.json Show resolved Hide resolved
ports/armadillo/vcpkg.json Outdated Show resolved Hide resolved
ports/gdal/vcpkg.json Outdated Show resolved Hide resolved
ports/geos/vcpkg.json Show resolved Hide resolved
@ras0219-msft ras0219-msft force-pushed the dev/roschuma/cmake-opt-deps branch 6 times, most recently from 0f88793 to d121552 Compare April 2, 2021 00:34
[opencv4] Disable vendored quirc library

[libsndfile] Disable Sndio dependency

[armadillo] Disable PkgConfig

WIP

[gdal] Specify options on linux [geos][libxml2][openjpeg] .pc fixes

[armadillo][gdal][geos] CR comments

[pangolin] Apply REQUIRE_ALL_PACKAGES
@ras0219-msft
Copy link
Contributor

Note #18393 and #18473 for examples of transitive dependency issues.

@dg0yt
Copy link
Contributor

dg0yt commented Jun 19, 2021

Note #18393 and #18473 for examples of transitive dependency issues.

Or now simage on Windows: #17519, #17519

@JackBoosY
Copy link
Contributor

This PR has been inactive for a long time, please reopen it if there is any progress.

@JackBoosY JackBoosY closed this Sep 10, 2021
@cenit
Copy link
Contributor

cenit commented Sep 10, 2021

😞 😢 😭

@JackBoosY
Copy link
Contributor

@cenit Don't worry, I believe this PR will continue.

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 info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gdal:x64-windows-static] missing geos dependencies
7 participants