aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCurtis.Bezault <curtbezault@gmail.com>2019-08-09 14:22:20 -0700
committerCurtis.Bezault <curtbezault@gmail.com>2019-08-09 14:22:20 -0700
commit724055b4e2c262035435468da269433773b4e22d (patch)
tree44cc0b7fc10469ab7b0f1b0f5b97f79acfd4e258
parent0c7d8f414669c6e025794c374f2837e5fa24d02b (diff)
parent6c1423f41d8e35268e8705d56f21ec09188be693 (diff)
downloadvcpkg-724055b4e2c262035435468da269433773b4e22d.tar.gz
vcpkg-724055b4e2c262035435468da269433773b4e22d.zip
Merge branch 'external_file_abi' of github.com:cbezault/vcpkg into external_file_abi
-rw-r--r--ports/jsonnet/CONTROL2
-rw-r--r--ports/jsonnet/portfile.cmake6
-rw-r--r--toolsrc/src/vcpkg/base/files.cpp2
-rw-r--r--toolsrc/src/vcpkg/build.cpp18
-rw-r--r--toolsrc/src/vcpkg/tools.cpp45
5 files changed, 38 insertions, 35 deletions
diff --git a/ports/jsonnet/CONTROL b/ports/jsonnet/CONTROL
index 35c870658..508f1e7af 100644
--- a/ports/jsonnet/CONTROL
+++ b/ports/jsonnet/CONTROL
@@ -1,4 +1,4 @@
Source: jsonnet
-Version: 2019-05-08
+Version: 2019-05-08-1
Homepage: https://github.com/google/jsonnet
Description: Jsonnet - The data templating language
diff --git a/ports/jsonnet/portfile.cmake b/ports/jsonnet/portfile.cmake
index 5472445da..ffa2973fb 100644
--- a/ports/jsonnet/portfile.cmake
+++ b/ports/jsonnet/portfile.cmake
@@ -11,12 +11,12 @@ vcpkg_from_github(
SHA512 d9f84c39929e9e80272e2b834f68a13b48c1cb4d64b70f5b6fa16e677555d947f7cf57372453e23066a330faa6a429b9aa750271b46f763581977a223d238785
HEAD_REF master
PATCHES
- 001-enable-msvc.patch
+ 001-enable-msvc.patch
)
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
vcpkg_execute_required_process(
- COMMAND Powershell -Command "((Get-Content -Encoding Byte \"${SOURCE_PATH}/stdlib/std.jsonnet\") -join ',') + ',0' > \"${SOURCE_PATH}/core/std.jsonnet.h\""
+ COMMAND Powershell -Command "((Get-Content -AsByteStream \"${SOURCE_PATH}/stdlib/std.jsonnet\") -join ',') + ',0' | Out-File -Encoding Ascii \"${SOURCE_PATH}/core/std.jsonnet.h\""
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "std.jsonnet"
)
@@ -31,7 +31,7 @@ endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- OPTIONS -DBUILD_JSONNET=OFF -DBUILD_TESTS=OFF
+ OPTIONS -DBUILD_JSONNET=OFF -DBUILD_JSONNETFMT=OFF -DBUILD_TESTS=OFF
)
vcpkg_install_cmake()
diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp
index 4a0a52f06..eb6119f18 100644
--- a/toolsrc/src/vcpkg/base/files.cpp
+++ b/toolsrc/src/vcpkg/base/files.cpp
@@ -78,7 +78,7 @@ namespace fs::detail
#else
auto result = symlink ? stdfs::symlink_status(p, ec) : stdfs::status(p, ec);
// libstdc++ doesn't correctly not-set ec on nonexistent paths
- if (ec.value() == ENOENT)
+ if (ec.value() == ENOENT || ec.value() == ENOTDIR)
{
ec.clear();
result = file_status(file_type::not_found, perms::unknown);
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index 147bbe796..de8fbc752 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -503,6 +503,14 @@ namespace vcpkg::Build
const BuildPackageConfig& config)
{
auto& fs = paths.get_filesystem();
+#if defined(_WIN32)
+ const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core");
+ if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe"))
+ {
+ fs.copy(powershell_exe_path, powershell_exe_path.parent_path() / "powershell.exe", fs::copy_options::none);
+ }
+#endif
+
const Triplet& triplet = spec.triplet();
const auto& triplet_file_path = paths.get_triplet_file_path(spec.triplet()).u8string();
@@ -520,8 +528,12 @@ namespace vcpkg::Build
std::string command = make_build_cmd(paths, pre_build_info, config, triplet);
std::unordered_map<std::string, std::string> env = make_env_passthrough(pre_build_info);
+#if defined(_WIN32)
+ const int return_code =
+ System::cmd_execute_clean(command, env, powershell_exe_path.parent_path().u8string() + ";");
+#else
const int return_code = System::cmd_execute_clean(command, env);
-
+#endif
const auto buildtimeus = timer.microseconds();
const auto spec_string = spec.to_string();
@@ -658,6 +670,10 @@ namespace vcpkg::Build
}
abi_tag_entries.emplace_back(AbiEntry{"cmake", paths.get_tool_version(Tools::CMAKE)});
+
+#if defined(_WIN32)
+ abi_tag_entries.emplace_back(AbiEntry{"powershell", paths.get_tool_version("powershell-core")});
+#endif
abi_tag_entries.emplace_back(AbiEntry{
"vcpkg_fixup_cmake_targets",
diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp
index 4f4b23055..7d56854c6 100644
--- a/toolsrc/src/vcpkg/tools.cpp
+++ b/toolsrc/src/vcpkg/tools.cpp
@@ -294,20 +294,6 @@ CMake suite maintained and supported by Kitware (kitware.com/cmake).
}
};
- static fs::path get_7za_path(const VcpkgPaths& paths)
- {
-#if defined(_WIN32)
- static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "7zip").value_or_exit(VCPKG_LINE_INFO);
- if (!paths.get_filesystem().exists(TOOL_DATA.exe_path))
- {
- return fetch_tool(paths, "7zip", TOOL_DATA);
- }
- return TOOL_DATA.exe_path;
-#else
- Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot download 7zip for non-Windows platforms.");
-#endif
- }
-
struct NinjaProvider : ToolProvider
{
std::string m_exe = "ninja";
@@ -443,31 +429,21 @@ git version 2.17.1.windows.2
virtual const fs::path& get_tool_path(const VcpkgPaths& paths, const std::string& tool) const override
{
return path_only_cache.get_lazy(tool, [&]() {
- // First deal with specially handled tools.
- // For these we may look in locations like Program Files, the PATH etc as well as the auto-downloaded
- // location.
- if (tool == Tools::SEVEN_ZIP) return get_7za_path(paths);
- if (tool == Tools::CMAKE || tool == Tools::GIT || tool == Tools::NINJA || tool == Tools::NUGET ||
- tool == Tools::IFW_INSTALLER_BASE)
- return get_tool_pathversion(paths, tool).path;
if (tool == Tools::IFW_BINARYCREATOR)
return get_tool_path(paths, Tools::IFW_INSTALLER_BASE).parent_path() / "binarycreator.exe";
if (tool == Tools::IFW_REPOGEN)
return get_tool_path(paths, Tools::IFW_INSTALLER_BASE).parent_path() / "repogen.exe";
- // For other tools, we simply always auto-download them.
- const ToolData tool_data = parse_tool_data_from_xml(paths, tool).value_or_exit(VCPKG_LINE_INFO);
- if (paths.get_filesystem().exists(tool_data.exe_path))
- {
- return tool_data.exe_path;
- }
- return fetch_tool(paths, tool, tool_data);
+ return get_tool_pathversion(paths, tool).path;
});
}
const PathAndVersion& get_tool_pathversion(const VcpkgPaths& paths, const std::string& tool) const
{
return path_version_cache.get_lazy(tool, [&]() -> PathAndVersion {
+ // First deal with specially handled tools.
+ // For these we may look in locations like Program Files, the PATH etc as well as the auto-downloaded
+ // location.
if (tool == Tools::CMAKE)
{
if (System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value())
@@ -495,7 +471,18 @@ git version 2.17.1.windows.2
if (tool == Tools::NUGET) return get_path(paths, NuGetProvider());
if (tool == Tools::IFW_INSTALLER_BASE) return get_path(paths, IfwInstallerBaseProvider());
- Checks::exit_with_message(VCPKG_LINE_INFO, "Finding version for %s is not implemented yet.", tool);
+ // For other tools, we simply always auto-download them.
+ auto maybe_tool_data = parse_tool_data_from_xml(paths, tool);
+ if (auto p_tool_data = maybe_tool_data.get())
+ {
+ if (paths.get_filesystem().exists(p_tool_data->exe_path))
+ {
+ return {p_tool_data->exe_path, p_tool_data->sha512};
+ }
+ return {fetch_tool(paths, tool, *p_tool_data), p_tool_data->sha512};
+ }
+
+ Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown or unavailable tool: %s", tool);
});
}