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

Use System32\tar.exe if present instead of 7zip for zip archives. #406

Merged
merged 3 commits into from
Mar 3, 2022

Conversation

BillyONeal
Copy link
Member

This is a more targeted hotfix version of #404 as there are outstanding code review discussions there. (I do still intend to apply the changes therein but don't want code reviewers to feel like they can't say anything because it's resolving a high priority issue)

This is a more targeted hotfix version of microsoft#404 as there are outstanding code review discussions there. (I do still intend to apply the changes therein but don't want code reviewers to feel like they can't say anything because it's resolving a high priority issue)
@Neumann-A
Copy link
Contributor

Neumann-A commented Mar 3, 2022

This PR + #405 + #407. Should solve all msiexec issues and completely move from 7z to tar.

  • Use 7z installer instead of msiexec #407: makes 7z install without msiexec possible if 7z is required due to not having tar. This only leaves python2/kinectsdk2/msmpi to require msiexec. Probably also update the search path for 7z in vcpkg_find_acquire_program. Only libpng seems to require it (maybe change to cmake -E tar?).
  • extract 7z archive part from 7z installers #405: makes it possible to extract the 7z archive from an 7z sfx installer. This is required to make PortableGit silently extract without the need for 7z.
  • This PR enables the usage of tar to unzip cmake which then can be used to decompress 7z archives via cmake -E tar eliminating the need for 7z completely.

Copy link
Contributor

@strega-nil strega-nil left a comment

Choose a reason for hiding this comment

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

I definitely appreciate fewer changes


const ExpectedS<Path>& get_system32() noexcept
{
static const ExpectedS<Path> s_system32 = get_system_root().map([](const Path& p) { return p / "system32"; });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static const ExpectedS<Path> s_system32 = get_system_root().map([](const Path& p) { return p / "system32"; });
static const ExpectedS<Path> s_system32 = get_system_root().map([](const Path& p) { return p / "System32"; });

I'd prefer it to use the canonical casing (even if it doesn't really matter)

struct ToolCache
{
virtual ~ToolCache() { }
virtual ~ToolCache();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
virtual ~ToolCache();
virtual ~ToolCache() = default;

no reason to put this in the C++ file I think

const auto code =
cmd_execute(Command{cmake_tool}.string_arg("-E").string_arg("tar").string_arg("xzf").path_arg(archive),
WorkingDirectory{to_path});
Checks::check_exit(VCPKG_LINE_INFO, code == 0, "tar failed while extracting %s", archive);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this use localized message?

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 made everything localized in the other PR but this PR is intentionally the minimal change.

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.

Thanks a bunch for extracting the hotfix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants