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] Extract common paths settings to make_cmake_cmd... #11842

Merged
merged 3 commits into from
Jun 16, 2020

Conversation

BillyONeal
Copy link
Member

…so that create and build share those variables.

Resolves #11784

@BillyONeal BillyONeal added category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) info:internal This PR or Issue was filed by the vcpkg team. labels Jun 8, 2020
@ras0219
Copy link
Contributor

ras0219 commented Jun 8, 2020

local_variables.emplace_back("PACKAGES_DIR", paths.packages);
local_variables.emplace_back("BUILDTREES_DIR", paths.buildtrees);
local_variables.emplace_back("_VCPKG_INSTALLED_DIR", paths.installed);
local_variables.emplace_back("DOWNLOADS", paths.downloads);
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is in the base library (vcpkg/base) and thus intends to model the more generic concept of "invoke a CMake script with given definitions". Because these arguments are specific to vcpkg, I think it would be better to provide a non-base function like void Build::add_vcpkg_cmake_path_args(const VcpkgPaths&, std::vector<CMakeVariable>& out) which would be called from All The Places.

Alternatively, this function could be moved out of base and into the core code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm the bit that's a bit strange about that is the get_modified_clean_environment just below is also very 'vcpkg specific', so I'm not sure if we're maintaining that layering.

Is the objection to naming VcpkgPaths? (I think there's still some improvement here from centralizing the get_tool_exe call even if I factor out those variables...)

Copy link
Member Author

Choose a reason for hiding this comment

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

Offline @ras0219 confirmed that he didn't like either naming VcpkgPaths or the explicit list here, so I introduced a new layer buildenvironment.h / buildenvironment.cpp. Ideally the explicit environment list would move there too since that's also very 'vcpkg specific' but I'm not sure exactly how to design that (since the 'base' get_clean_environment() depends on get_modified_clean_environment()) and I don't want to block this regression fix on that.

@BillyONeal
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sweemer
Copy link
Contributor

sweemer commented Jun 12, 2020

Works for me now. Thanks for the fix!

@BillyONeal BillyONeal merged commit 04e214e into microsoft:master Jun 16, 2020
@BillyONeal
Copy link
Member Author

Robert confirmed this was OK offline.

@BillyONeal BillyONeal deleted the fix_create branch June 16, 2020 18:58
JangBoo pushed a commit to JangBoo/vcpkg that referenced this pull request Jun 18, 2020
penumbra23 pushed a commit to codespace-dev/vcpkg that referenced this pull request Aug 5, 2020
strega-nil pushed a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) 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.

vcpkg create fails with "CMake Error at scripts/ports.cmake:14"
5 participants