-
Notifications
You must be signed in to change notification settings - Fork 296
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
Insert "--head" defenses into the binary cache and block "default" when calculating feature ABIs. #336
Conversation
<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.
…res have not yet been resolved.
std::vector<std::string> sorted_feature_list = action.feature_list; | ||
Util::sort(sorted_feature_list); | ||
InternalFeatureSet sorted_feature_list = action.feature_list; | ||
// Check that no "default" feature is present. Default features must be resolved before attempting to calculate |
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.
Note that unlike #336 this does not insert "core" and rejects "default".
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.
The current documentation string for InternalFeatureSet indicates that default
is valid:
/// In an internal feature set, "default" represents default features and missing "core" has no semantic
How do we know that there won't be pseudo-features here?
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.
@ras0219-msft We could introduce InternalResolvedFeatureSet
or something like that if you wanted, but pseudo-features getting into an ABI calculation is a bug (since it would result in the same input having different ABIs depending on whether the pseudo-feature was resolved first).
@@ -16,27 +17,6 @@ | |||
|
|||
namespace vcpkg | |||
{ | |||
enum class RestoreResult |
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.
These got put into the fwd header
std::vector<std::string> sorted_feature_list = action.feature_list; | ||
Util::sort(sorted_feature_list); | ||
InternalFeatureSet sorted_feature_list = action.feature_list; | ||
// Check that no "default" feature is present. Default features must be resolved before attempting to calculate |
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.
The current documentation string for InternalFeatureSet indicates that default
is valid:
/// In an internal feature set, "default" represents default features and missing "core" has no semantic
How do we know that there won't be pseudo-features here?
This is fallout from code review / investigation of #331
--head
, and adds tests.VcpkgPaths
is sucked out of a parameter passed through the binary cache and is made a member of the providers if necessary.<expected.h>: Add the missing T& overloads used elsewhere.
<binarycaching.h>:
binarycaching.cpp:
vcpkg-test/binarycaching.cpp: