Install successful installs even with --only-downloads. (#901)

* Install successful installs even with --only-downloads.

Drive-by: Make set-installed accept --only-downloads.

"Download only" mode works by marking execute_process and friends to fail instantly when a port is run, and we just hope the `vcpkg_from_Xxx` is reached before that failure happens. Then, we didn't install the result, even if it "succeeded".

This failed for ports which put their "get" operation into a helper port, since the helper cmake script dependent ports were expecting to use was unavailable.

Before:

```
PS C:\Dev\vcpkg> .\vcpkg.exe install ignition-math4 --only-downloads
Computing installation plan...
The following packages will be built and installed:
  * ignition-cmake0[core]:x86-windows -> 0.6.2#4
    ignition-math4[core]:x86-windows -> 4.0.0#3
  * ignition-modularscripts[core]:x64-windows -> 2022-05-11#1
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Detecting compiler hash for triplet x86-windows...
Installing 1/3 ignition-modularscripts:x64-windows...
Building ignition-modularscripts[core]:x64-windows...
-- Installing: C:/Dev/vcpkg/packages/ignition-modularscripts_x64-windows/share/ignition-modularscripts/vcpkg-port-config.cmake
Downloaded sources for ignition-modularscripts[core]:x64-windows
Elapsed time to handle ignition-modularscripts:x64-windows: 51.88 ms
Installing 2/3 ignition-cmake0:x86-windows...
Building ignition-cmake0[core]:x86-windows...
CMake Error at ports/ignition-cmake0/portfile.cmake:3 (ignition_modular_library):
  Unknown CMake command "ignition_modular_library".
Call Stack (most recent call first):
  scripts/ports.cmake:147 (include)

Downloaded sources for ignition-cmake0[core]:x86-windows
Elapsed time to handle ignition-cmake0:x86-windows: 43.37 ms
Installing 3/3 ignition-math4:x86-windows...
Building ignition-math4[core]:x86-windows...
CMake Error at ports/ignition-math4/portfile.cmake:1 (ignition_modular_library):
  Unknown CMake command "ignition_modular_library".
Call Stack (most recent call first):
  scripts/ports.cmake:147 (include)

Downloaded sources for ignition-math4[core]:x86-windows
Elapsed time to handle ignition-math4:x86-windows: 43.78 ms
Total install time: 4.206 s
RESULTS
    ignition-modularscripts:x64-windows: DOWNLOADED: 51.88 ms
    ignition-cmake0:x86-windows: DOWNLOADED: 43.37 ms
    ignition-math4:x86-windows: DOWNLOADED: 43.78 ms

SUMMARY FOR x64-windows
    DOWNLOADED: 1
SUMMARY FOR x86-windows
    DOWNLOADED: 2
PS C:\Dev\vcpkg>
```

After:
```
PS C:\Dev\vcpkg> C:\Dev\vcpkg-tool\out\build\x64-Debug\vcpkg.exe install ignition-math4 --only-downloads
Computing installation plan...
The following packages will be built and installed:
  * ignition-cmake0[core]:x86-windows -> 0.6.2#4
    ignition-math4[core]:x86-windows -> 4.0.0#3
  * ignition-modularscripts[core]:x64-windows -> 2022-05-11#1
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Detecting compiler hash for triplet x86-windows...
Installing 1/3 ignition-modularscripts:x64-windows...
Building ignition-modularscripts[core]:x64-windows...
-- Installing: C:/Dev/vcpkg/packages/ignition-modularscripts_x64-windows/share/ignition-modularscripts/vcpkg-port-config.cmake
-- Performing post-build validation
Elapsed time to handle ignition-modularscripts:x64-windows: 63.08 ms
Installing 2/3 ignition-cmake0:x86-windows...
Building ignition-cmake0[core]:x86-windows...
-- Downloading https://github.com/ignitionrobotics/ign-cmake/archive/ignition-cmake_0.6.1.tar.gz -> ignitionrobotics-ign-cmake-ignition-cmake_0.6.1-1.tar.gz...
-- Extracting source C:/Dev/vcpkg/downloads/ignitionrobotics-ign-cmake-ignition-cmake_0.6.1-1.tar.gz
-- Applying patch do-not-compile-gtest.patch
-- Applying patch support-arm64.patch
-- Applying patch uuid-do-not-require-pkg-config.patch
-- Applying patch fix-find-ign-curl.patch
-- Using source at C:/Dev/vcpkg/buildtrees/ignition-cmake0/src/make_0.6.1-6417790457.clean
-- Using cached msys-mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst.
-- Using msys root at C:/Dev/vcpkg/downloads/tools/msys2/9a1ec3f33446b195
-- Found external ninja('1.11.0').
-- Configuring x86-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:23 (message):
  This command cannot be executed in Download Mode.

  Halting portfile execution.

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:326 (vcpkg_execute_required_process)
  installed/x64-windows/share/ignition-modularscripts/vcpkg-port-config.cmake:8 (vcpkg_configure_cmake)
  installed/x64-windows/share/ignition-modularscripts/vcpkg-port-config.cmake:160 (ignition_modular_build_library)
  ports/ignition-cmake0/portfile.cmake:3 (ignition_modular_library)
  scripts/ports.cmake:147 (include)

Downloaded sources for ignition-cmake0[core]:x86-windows
Elapsed time to handle ignition-cmake0:x86-windows: 1.004 s
Installing 3/3 ignition-math4:x86-windows...
Building ignition-math4[core]:x86-windows...
-- Downloading https://github.com/ignitionrobotics/ign-math/archive/ignition-math4_4.0.0.tar.gz -> ignitionrobotics-ign-math-ignition-math4_4.0.0-1.tar.gz...
-- Extracting source C:/Dev/vcpkg/downloads/ignitionrobotics-ign-math-ignition-math4_4.0.0-1.tar.gz
-- Using source at C:/Dev/vcpkg/buildtrees/ignition-math4/src/ath4_4.0.0-89bdbdf369.clean
-- Using cached msys-mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst.
-- Using cached msys-mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst.
-- Using msys root at C:/Dev/vcpkg/downloads/tools/msys2/9a1ec3f33446b195
-- Found external ninja('1.11.0').
-- Configuring x86-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:23 (message):
  This command cannot be executed in Download Mode.

  Halting portfile execution.

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:326 (vcpkg_execute_required_process)
  installed/x64-windows/share/ignition-modularscripts/vcpkg-port-config.cmake:8 (vcpkg_configure_cmake)
  installed/x64-windows/share/ignition-modularscripts/vcpkg-port-config.cmake:160 (ignition_modular_build_library)
  ports/ignition-math4/portfile.cmake:1 (ignition_modular_library)
  scripts/ports.cmake:147 (include)

Downloaded sources for ignition-math4[core]:x86-windows
Elapsed time to handle ignition-math4:x86-windows: 965.5 ms
Total install time: 5.452 s
RESULTS
    ignition-modularscripts:x64-windows: SUCCEEDED: 63.08 ms
    ignition-cmake0:x86-windows: DOWNLOADED: 1.004 s
    ignition-math4:x86-windows: DOWNLOADED: 965.5 ms

SUMMARY FOR x64-windows
    SUCCEEDED: 1
SUMMARY FOR x86-windows
    DOWNLOADED: 2
PS C:\Dev\vcpkg>
```

Observe that in the before we failed to download the sources of ignition-cmake0 and ignition-math4.

* Delete StringMetric::BuildError because it was leaking unhashed port names.

* Deduplicate the call to do_build_package_and_clean_buildtrees.
This commit is contained in:
Billy O'Neal 2023-03-07 11:46:20 -08:00 коммит произвёл GitHub
Родитель cb90d76df4
Коммит dbc4a343e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
21 изменённых файлов: 166 добавлений и 62 удалений

Просмотреть файл

@ -0,0 +1 @@
message(FATAL_ERROR "This port is expected to fail to build.")

Просмотреть файл

@ -0,0 +1,4 @@
{
"name": "vcpkg-never-builds",
"version": "1.0.0"
}

Просмотреть файл

@ -0,0 +1,11 @@
if(VCPKG_CROSSCOMPILING)
message(${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL} "vcpkg-touch-missing-dependency is a host-only port; please mark it as a host port in your dependencies.")
endif()
file(INSTALL
"${CMAKE_CURRENT_LIST_DIR}/vcpkg_touch.cmake"
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${VCPKG_ROOT_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled)

Просмотреть файл

@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_touch.cmake")

Просмотреть файл

@ -0,0 +1,7 @@
{
"name": "vcpkg-touch-missing-dependency",
"version": "1.0.0",
"dependencies": [
"vcpkg-never-builds"
]
}

Просмотреть файл

@ -0,0 +1,11 @@
include_guard(GLOBAL)
function(vcpkg_touch)
cmake_parse_arguments(PARSE_ARGV 0 "arg" "" "TARGET" "")
if(DEFINED arg_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vcpkg_touch was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
endif()
file(TOUCH "${arg_TARGET}")
endfunction()

Просмотреть файл

@ -0,0 +1,11 @@
if(VCPKG_CROSSCOMPILING)
message(${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL} "vcpkg-touch is a host-only port; please mark it as a host port in your dependencies.")
endif()
file(INSTALL
"${CMAKE_CURRENT_LIST_DIR}/vcpkg_touch.cmake"
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${VCPKG_ROOT_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled)

Просмотреть файл

@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_touch.cmake")

Просмотреть файл

@ -0,0 +1,4 @@
{
"name": "vcpkg-touch",
"version": "1.0.0"
}

Просмотреть файл

@ -0,0 +1,11 @@
include_guard(GLOBAL)
function(vcpkg_touch)
cmake_parse_arguments(PARSE_ARGV 0 "arg" "" "TARGET" "")
if(DEFINED arg_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vcpkg_touch was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
endif()
file(TOUCH "${arg_TARGET}")
endfunction()

Просмотреть файл

@ -0,0 +1,3 @@
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include")
vcpkg_touch(TARGET "${CURRENT_PACKAGES_DIR}/include/vcpkg-uses-touch.h")
file(INSTALL "${VCPKG_ROOT_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

Просмотреть файл

@ -0,0 +1,10 @@
{
"name": "vcpkg-uses-touch-missing-dependency",
"version": "1.0.0",
"dependencies": [
{
"name": "vcpkg-touch-missing-dependency",
"host": true
}
]
}

Просмотреть файл

@ -0,0 +1,3 @@
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include")
vcpkg_touch(TARGET "${CURRENT_PACKAGES_DIR}/include/vcpkg-uses-touch.h")
file(INSTALL "${VCPKG_ROOT_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

Просмотреть файл

@ -0,0 +1,10 @@
{
"name": "vcpkg-uses-touch",
"version": "1.0.0",
"dependencies": [
{
"name": "vcpkg-touch",
"host": true
}
]
}

Просмотреть файл

@ -0,0 +1,13 @@
. "$PSScriptRoot/../end-to-end-tests-prelude.ps1"
Refresh-TestRoot
Run-Vcpkg @commonArgs install --only-downloads vcpkg-uses-touch
Throw-IfFailed
Require-FileExists "$installRoot/$Triplet/include/vcpkg-uses-touch.h"
Refresh-TestRoot
Run-Vcpkg @commonArgs install --only-downloads vcpkg-uses-touch-missing-dependency
Throw-IfFailed
Require-FileNotExists "$installRoot/$Triplet/include/vcpkg-uses-touch.h"

Просмотреть файл

@ -1824,7 +1824,7 @@ namespace vcpkg
DECLARE_MESSAGE(HelpRemoveOutdatedCommand, (), "", "Uninstall all out-of-date packages.");
DECLARE_MESSAGE(HelpResponseFileCommand, (), "", "Specify a response file to provide additional parameters.");
DECLARE_MESSAGE(HelpSearchCommand, (), "", "Search for packages available to be built.");
DECLARE_MESSAGE(HelpTextOptFullDesc, (), "", "Do not truncate long text");
DECLARE_MESSAGE(HelpTextOptFullDesc, (), "", "Do not truncate long text.");
DECLARE_MESSAGE(HelpTopicCommand, (), "", "Display help for a specific topic.");
DECLARE_MESSAGE(HelpTopicsCommand, (), "", "Display the list of help topics.");
DECLARE_MESSAGE(HelpTxtOptAllowUnsupportedPort,
@ -1834,10 +1834,10 @@ namespace vcpkg
DECLARE_MESSAGE(HelpTxtOptCleanAfterBuild,
(),
"",
"Clean buildtrees, packages and downloads after building each package");
DECLARE_MESSAGE(HelpTxtOptCleanBuildTreesAfterBuild, (), "", "Clean buildtrees after building each package");
DECLARE_MESSAGE(HelpTxtOptCleanDownloadsAfterBuild, (), "", "Clean downloads after building each package");
DECLARE_MESSAGE(HelpTxtOptCleanPkgAfterBuild, (), "", "Clean packages after building each package");
"Clean buildtrees, packages and downloads after building each package.");
DECLARE_MESSAGE(HelpTxtOptCleanBuildTreesAfterBuild, (), "", "Clean buildtrees after building each package.");
DECLARE_MESSAGE(HelpTxtOptCleanDownloadsAfterBuild, (), "", "Clean downloads after building each package.");
DECLARE_MESSAGE(HelpTxtOptCleanPkgAfterBuild, (), "", "Clean packages after building each package.");
DECLARE_MESSAGE(HelpTxtOptDryRun, (), "", "Do not actually build or install.");
DECLARE_MESSAGE(HelpTxtOptEditable,
(),
@ -1847,7 +1847,7 @@ namespace vcpkg
(),
"",
"Fail install if a port has detected problems or attempts to use a deprecated feature");
DECLARE_MESSAGE(HelpTxtOptKeepGoing, (), "", "Continue installing packages on failure");
DECLARE_MESSAGE(HelpTxtOptKeepGoing, (), "", "Continue installing packages on failure.");
DECLARE_MESSAGE(HelpTxtOptManifestFeature,
(),
"",
@ -1856,16 +1856,19 @@ namespace vcpkg
(),
"",
"Don't install the default features from the top-level manifest (manifest mode).");
DECLARE_MESSAGE(HelpTxtOptNoDownloads, (), "", "Do not download new sources");
DECLARE_MESSAGE(HelpTxtOptNoDownloads, (), "", "Do not download new sources.");
DECLARE_MESSAGE(HelpTxtOptNoUsage, (), "", "Don't print CMake usage information after install.");
DECLARE_MESSAGE(HelpTxtOptOnlyBinCache, (), "", "Fail if cached binaries are not available");
DECLARE_MESSAGE(HelpTxtOptOnlyDownloads, (), "", "Download sources but don't build packages");
DECLARE_MESSAGE(HelpTxtOptRecurse, (), "", "Allow removal of packages as part of installation");
DECLARE_MESSAGE(HelpTxtOptUseAria2, (), "", "Use aria2 to perform download tasks");
DECLARE_MESSAGE(HelpTxtOptOnlyBinCache, (), "", "Fail if cached binaries are not available.");
DECLARE_MESSAGE(HelpTxtOptOnlyDownloads,
(),
"",
"Make a best-effort attempt to download sources without building.");
DECLARE_MESSAGE(HelpTxtOptRecurse, (), "", "Allow removal of packages as part of installation.");
DECLARE_MESSAGE(HelpTxtOptUseAria2, (), "", "Use aria2 to perform download tasks.");
DECLARE_MESSAGE(HelpTxtOptUseHeadVersion,
(),
"",
"Install the libraries on the command line using the latest upstream sources (classic mode)");
"Install the libraries on the command line using the latest upstream sources (classic mode).");
DECLARE_MESSAGE(
HelpTxtOptWritePkgConfig,
(),

Просмотреть файл

@ -53,7 +53,6 @@ namespace vcpkg
enum class StringMetric
{
AcquiredArtifacts,
BuildError,
CommandArgs,
CommandContext,
CommandName,

Просмотреть файл

@ -774,27 +774,27 @@
"HelpRemoveOutdatedCommand": "Uninstall all out-of-date packages.",
"HelpResponseFileCommand": "Specify a response file to provide additional parameters.",
"HelpSearchCommand": "Search for packages available to be built.",
"HelpTextOptFullDesc": "Do not truncate long text",
"HelpTextOptFullDesc": "Do not truncate long text.",
"HelpTopicCommand": "Display help for a specific topic.",
"HelpTopicsCommand": "Display the list of help topics.",
"HelpTxtOptAllowUnsupportedPort": "Instead of erroring on an unsupported port, continue with a warning.",
"HelpTxtOptCleanAfterBuild": "Clean buildtrees, packages and downloads after building each package",
"HelpTxtOptCleanBuildTreesAfterBuild": "Clean buildtrees after building each package",
"HelpTxtOptCleanDownloadsAfterBuild": "Clean downloads after building each package",
"HelpTxtOptCleanPkgAfterBuild": "Clean packages after building each package",
"HelpTxtOptCleanAfterBuild": "Clean buildtrees, packages and downloads after building each package.",
"HelpTxtOptCleanBuildTreesAfterBuild": "Clean buildtrees after building each package.",
"HelpTxtOptCleanDownloadsAfterBuild": "Clean downloads after building each package.",
"HelpTxtOptCleanPkgAfterBuild": "Clean packages after building each package.",
"HelpTxtOptDryRun": "Do not actually build or install.",
"HelpTxtOptEditable": "Disable source re-extraction and binary caching for libraries on the command line (classic mode)",
"HelpTxtOptEnforcePortChecks": "Fail install if a port has detected problems or attempts to use a deprecated feature",
"HelpTxtOptKeepGoing": "Continue installing packages on failure",
"HelpTxtOptKeepGoing": "Continue installing packages on failure.",
"HelpTxtOptManifestFeature": "Additional feature from the top-level manifest to install (manifest mode).",
"HelpTxtOptManifestNoDefault": "Don't install the default features from the top-level manifest (manifest mode).",
"HelpTxtOptNoDownloads": "Do not download new sources",
"HelpTxtOptNoDownloads": "Do not download new sources.",
"HelpTxtOptNoUsage": "Don't print CMake usage information after install.",
"HelpTxtOptOnlyBinCache": "Fail if cached binaries are not available",
"HelpTxtOptOnlyDownloads": "Download sources but don't build packages",
"HelpTxtOptRecurse": "Allow removal of packages as part of installation",
"HelpTxtOptUseAria2": "Use aria2 to perform download tasks",
"HelpTxtOptUseHeadVersion": "Install the libraries on the command line using the latest upstream sources (classic mode)",
"HelpTxtOptOnlyBinCache": "Fail if cached binaries are not available.",
"HelpTxtOptOnlyDownloads": "Make a best-effort attempt to download sources without building.",
"HelpTxtOptRecurse": "Allow removal of packages as part of installation.",
"HelpTxtOptUseAria2": "Use aria2 to perform download tasks.",
"HelpTxtOptUseHeadVersion": "Install the libraries on the command line using the latest upstream sources (classic mode).",
"HelpTxtOptWritePkgConfig": "Writes out a NuGet packages.config-formatted file for use with external binary caching.\nSee `vcpkg help binarycaching` for more information.",
"HelpUpdateBaseline": "The best approach to keep your libraries up to date, the best approach is to update your baseline reference. This will ensure all packages, including transitive ones, are updated. However if you need to update a package independently, you can use a \"version>=\" constraint.",
"HelpUpdateCommand": "List packages that can be updated.",

Просмотреть файл

@ -884,7 +884,8 @@ namespace vcpkg
static ExtendedBuildResult do_build_package(const VcpkgCmdArguments& args,
const VcpkgPaths& paths,
const InstallPlanAction& action)
const InstallPlanAction& action,
bool all_dependencies_satisfied)
{
const auto& pre_build_info = action.pre_build_info(VCPKG_LINE_INFO);
@ -935,18 +936,21 @@ namespace vcpkg
env);
} // close out_file
// With the exception of empty packages, builds in "Download Mode" always result in failure.
const auto buildtimeus = timer.microseconds();
const auto spec_string = action.spec.to_string();
const bool build_failed = !succeeded(return_code);
MetricsSubmission metrics;
if (build_failed)
{
// With the exception of empty or helper ports, builds in "Download Mode" result in failure.
if (action.build_options.only_downloads == OnlyDownloads::YES)
{
// TODO: Capture executed command output and evaluate whether the failure was intended.
// If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status.
return ExtendedBuildResult{BuildResult::DOWNLOADED};
}
}
const auto buildtimeus = timer.microseconds();
const auto spec_string = action.spec.to_string();
MetricsSubmission metrics;
metrics.track_buildtime(Hash::get_string_hash(spec_string, Hash::Algorithm::Sha256) + ":[" +
Strings::join(",",
action.feature_list,
@ -956,13 +960,12 @@ namespace vcpkg
"]",
buildtimeus);
const bool build_failed = !succeeded(return_code);
if (build_failed)
get_global_metrics_collector().track_submission(std::move(metrics));
if (!all_dependencies_satisfied)
{
metrics.track_string(StringMetric::BuildError, spec_string);
return ExtendedBuildResult{BuildResult::DOWNLOADED};
}
get_global_metrics_collector().track_submission(std::move(metrics));
if (build_failed)
{
const auto logs = buildpath / Strings::concat("error-logs-", action.spec.triplet(), ".txt");
@ -1012,9 +1015,10 @@ namespace vcpkg
static ExtendedBuildResult do_build_package_and_clean_buildtrees(const VcpkgCmdArguments& args,
const VcpkgPaths& paths,
const InstallPlanAction& action)
const InstallPlanAction& action,
bool all_dependencies_satisfied)
{
auto result = do_build_package(args, paths, action);
auto result = do_build_package(args, paths, action, all_dependencies_satisfied);
if (action.build_options.clean_buildtrees == CleanBuildtrees::YES)
{
@ -1298,7 +1302,8 @@ namespace vcpkg
}
}
if (!missing_fspecs.empty() && !Util::Enum::to_bool(action.build_options.only_downloads))
const bool all_dependencies_satisfied = missing_fspecs.empty();
if (!all_dependencies_satisfied && !Util::Enum::to_bool(action.build_options.only_downloads))
{
return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(missing_fspecs)};
}
@ -1317,26 +1322,21 @@ namespace vcpkg
}
auto& abi_info = action.abi_info.value_or_exit(VCPKG_LINE_INFO);
if (!abi_info.abi_tag_file)
ExtendedBuildResult result =
do_build_package_and_clean_buildtrees(args, paths, action, all_dependencies_satisfied);
if (abi_info.abi_tag_file)
{
return do_build_package_and_clean_buildtrees(args, paths, action);
}
auto& abi_file = *abi_info.abi_tag_file.get();
const auto abi_package_dir = paths.package_dir(spec) / "share" / spec.name();
const auto abi_file_in_package = abi_package_dir / "vcpkg_abi_info.txt";
ExtendedBuildResult result = do_build_package_and_clean_buildtrees(args, paths, action);
build_logs_recorder.record_build_result(paths, spec, result.code);
filesystem.create_directories(abi_package_dir, VCPKG_LINE_INFO);
filesystem.copy_file(abi_file, abi_file_in_package, CopyOptions::none, VCPKG_LINE_INFO);
if (result.code == BuildResult::SUCCEEDED)
{
binary_cache.push_success(action);
}
}
return result;
}

Просмотреть файл

@ -21,7 +21,9 @@ namespace vcpkg::Commands::SetInstalled
static constexpr CommandSwitch INSTALL_SWITCHES[] = {
{OPTION_DRY_RUN, []() { return msg::format(msgCmdSetInstalledOptDryRun); }},
{OPTION_NO_PRINT_USAGE, []() { return msg::format(msgCmdSetInstalledOptNoUsage); }}};
{OPTION_NO_PRINT_USAGE, []() { return msg::format(msgCmdSetInstalledOptNoUsage); }},
{OPTION_ONLY_DOWNLOADS, []() { return msg::format(msgHelpTxtOptOnlyDownloads); }},
};
static constexpr CommandSetting INSTALL_SETTINGS[] = {
{OPTION_WRITE_PACKAGES_CONFIG, []() { return msg::format(msgCmdSetInstalledOptWritePkgConfig); }},
};

Просмотреть файл

@ -127,7 +127,6 @@ namespace vcpkg
const constexpr std::array<StringMetricEntry, static_cast<size_t>(StringMetric::COUNT)> all_string_metrics{{
// registryUri:id:version,...
{StringMetric::AcquiredArtifacts, "acquired_artifacts", plan_example},
{StringMetric::BuildError, "build_error", "gsl:x64-windows"},
{StringMetric::CommandArgs, "command_args", "0000000011111111aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffff"},
{StringMetric::CommandContext, "command_context", "artifact"},
{StringMetric::CommandName, "command_name", "z-preregister-telemetry"},