-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Insert "--head" defenses into the binary cache and block "default" wh…
…en calculating feature ABIs. (#336) * Insert defenses into BinaryCache as reasonable and add tests. <expected.h>: Add the missing T& overloads used elsewhere. <binarycaching.h>: * Remove VcpkgPaths from the IBinaryProvider interface; add it as a member of the concrete implementations. * Hoist BinaryConfigParserState (formerly State in binarycaching.cpp) here. It would be nice to make this more shiny, but hiding the definition of this struct wasn't buying us too much, and being unable to test stuff was a worse evil. * create_binary_providers_from_configs_pure now returns ExpectedS<BinaryConfigParserState>; this lets the tests of the parser machinery continue to be unchanged while still moving paths in as a member. binarycaching.cpp: * Push vcpkgpaths as a member into the concrete implementations. * Change/audit all IBinaryProvider::prefetch to support nullptr. We pass in the underlying action plan vector here, and preparing a vector with the ABI-less packages removed would require extra indirection or flattening of the data we don't want to do in a bugfix. * Change/audit all IBinaryProvider::precheck to not support nullptr. That is used only by CI and everything there should have a package ABI. * Change BinaryCache::prefetch to explicitly document that nullptr package_abi is acceptable. * Change BinaryCache::precheck to explicitly error out on nullptr package_abi. vcpkg-test/binarycaching.cpp: * Add tests for nullptr package ABIs passed to BinaryCache. * Block "default" in package ABI as it indicates that the default features have not yet been resolved. * Enforce that "core" is included before calculating ABI hashes. Co-authored-by: Robert Schumacher <[email protected]>
- Loading branch information
1 parent
f82ce3f
commit c76e0de
Showing
11 changed files
with
348 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
namespace vcpkg | ||
{ | ||
enum class RestoreResult | ||
{ | ||
unavailable, | ||
restored, | ||
}; | ||
|
||
enum class CacheAvailability | ||
{ | ||
unavailable, | ||
available, | ||
}; | ||
|
||
enum class CacheStatusState | ||
{ | ||
unknown, // the cache status of the indicated package ABI is unknown | ||
available, // the cache is known to contain the package ABI, but it has not been restored | ||
restored, // the cache contains the ABI and it has been restored to the packages tree | ||
}; | ||
|
||
struct CacheStatus; | ||
struct IBinaryProvider; | ||
struct BinaryCache; | ||
struct BinaryConfigParserState; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.