-
Notifications
You must be signed in to change notification settings - Fork 287
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
Refactor tools.cpp to homogenize system tools policies #540
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
include/vcpkg/fwd/vcpkgpaths.h
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
namespace vcpkg | |||
{ | |||
struct DownloadManager; |
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.
Don't think this is the right fwd header for that?
Can you add an e2e test for that? (I think setting that env var and doing |
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.
This is a great change, thank you!
[this]() { return this->fs.read_contents(this->xml_config, VCPKG_LINE_INFO); }); | ||
} | ||
|
||
virtual const Path& get_tool_path(StringView tool) const override { return get_tool_pathversion(tool).p; } |
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.
Can we make callers just do that now if we aren't going to special case it anymore?
It looks like before the special case was there so that we didn't have to try to get a version when we didn't know how to extract one...
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.
I like this more direct function because 90% of callers just want the path so they can proceed to build a command out of it.
If you would like to see get_tool_version()
replaced with get_tool_pathversion().version
while keeping get_tool_path()
, I can do that.
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.
You could make it nonvirtual and in the interface if it's to make callers prettier.
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.
That would be fine by me -- I thought you hated having any code in the interface though? Or is that only for virtual member default implementations?
This PR subsumes #181.
This PR refactors the internal implementation of
ToolsCache
to achieve several goals:VcpkgPaths
from theToolsCache
/ToolsProvider
interface by injecting the specific data requiredVcpkgPaths
to ToolsCache in thearchives.cpp
functionstools.cpp
VCPKG_FORCE_SYSTEM_BINARIES
&VCPKG_FORCE_DOWNLOADED_BINARIES
Fetch tool without an entry
Fetch missing tool with special failure instructions
Successful fetch
CMake from system +
VCPKG_FORCE_SYSTEM_BINARIES
/* todo: add more examples of error messages */