Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove BuildPackageOptions from the ActionPlan #1339

Merged
merged 18 commits into from
Apr 30, 2024

Conversation

BillyONeal
Copy link
Member

The BuildPackageOptions contains values that do not change per installation, such as PrintUsage. A likely bug was getting the package plan, and forgetting to fill in the BuildPackageOptions inside. Instead, this removes the BuildPackageOptions and passes it around to the places where it is actually needed.

The individual commits may help in understanding specific changes.

PurgeDecompressFailure causes the files backend for binary caching to delete the zip file if it fails to decompress. The install command set this to false due to a race consideration: it's possible that a partially uploaded zip is observed when the files backend is pointed to a network share, and deleting the file because we failed to decompress it just stomps on another builder sharing that same binary cache.

It seems incorrect that this reasoning would not apply to any other commands, but most of the other commands said PurgeDecompressFailure::Yes.

This change removes the option entirely in favor of the 'No' behavior.
These are already implied by the blockers on line 1075 and 1080.
… the consumption side of install plan action. This means that all BuildOptions for all actions will be the same in preparation for removing this member entirely.
Comment on lines 782 to 787
action.request_type == RequestType::USER_REQUESTED && Util::Enum::to_bool(build_options.use_head_version)
? "1"
: "0"},
{"_VCPKG_DOWNLOAD_TOOL", to_string_view(build_options.download_tool)},
{"_VCPKG_EDITABLE",
action.request_type == RequestType::USER_REQUESTED && Util::Enum::to_bool(build_options.editable) ? "1"
Copy link
Member Author

Choose a reason for hiding this comment

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

I can see an argument to put UseHeadVersion and/or Editable back into the ActionPlan since this can vary by according to user requested but this seemed simpler.

Copy link
Contributor

Choose a reason for hiding this comment

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

They do seem more tied to the install action itself rather than an overarching "plan" property. By my reading, these are the only "ABI affecting" options, so putting them into the plan would simplify several function interfaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good reason to go that way instead.

…values

# Conflicts:
#	src/vcpkg/commands.build-external.cpp
#	src/vcpkg/commands.build.cpp
Copy link
Contributor

@ras0219-msft ras0219-msft left a comment

Choose a reason for hiding this comment

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

Approved assuming editable and use_head_version are renamed to indicate that they only take effect if the action was a direct dependency (user requested)

@@ -253,7 +253,6 @@ namespace
{
nothing,
always,
on_fail,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this removed due to no mechanism to access it via UX?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's correct. There was one path where it got set but that path seemed like a bug. See rationale in 8b30b0c

…values

# Conflicts:
#	src/vcpkg/commands.build.cpp
#	src/vcpkg/commands.install.cpp
#	src/vcpkg/commands.set-installed.cpp
#	src/vcpkg/commands.upgrade.cpp
…range that the abi hash depends on whether download_only is selected. After discussion with @ras0219-msft , he agreed that the ABI hash shouldn't be affected by this setting.

However, given that in download mode, we intentionally build things which do not have all their dependencies present, it would not be safe to attempt to cache or otherwise install anything in that condition.

This change removes download_only from the ABI calculation, and changes installation to only attempt to install built bits whose dependencies are all satisfied.
@BillyONeal BillyONeal marked this pull request as draft March 9, 2024 04:37
BillyONeal added a commit that referenced this pull request Mar 12, 2024
While reviewing changes to #1339 , I observed that it was strange that the abi hash depends on whether download_only is selected. After discussion with @ras0219-msft , he agreed that the ABI hash shouldn't be affected by this setting.

However, given that in download mode, we intentionally build things which do not have all their dependencies present, it would not be safe to attempt to cache or otherwise install anything in that condition.

This change removes download_only from the ABI calculation, and changes installation to only attempt to install built bits whose dependencies are all satisfied.
…values

# Conflicts:
#	src/vcpkg/commands.build.cpp
#	src/vcpkg/commands.install.cpp
@BillyONeal BillyONeal marked this pull request as ready for review April 20, 2024 00:11
if (plan_type == InstallPlanType::ALREADY_INSTALLED)
{
if (use_head_version && is_user_requested)
// FIXME check that this can still get printed
Copy link
Contributor

Choose a reason for hiding this comment

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

FIXME?

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. --head and user requested
  2. --head and not user requested

@BillyONeal BillyONeal merged commit 7db75d6 into microsoft:main Apr 30, 2024
5 checks passed
@BillyONeal BillyONeal deleted the remove-common-action-values branch April 30, 2024 01:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants