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 system CMake to unpack if available during 7z bootstrap #793

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

vicroms
Copy link
Member

@vicroms vicroms commented Nov 4, 2022

A user provided CMake can be used to extract vcpkg's copy of CMake during the downloads/tools bootstrap process.

The current fallbacks are:

  • System32/tar
  • User CMake
  • 7zip MSI

@BillyONeal
Copy link
Member

I'm getting really uncomfortable with the castle we're building here. We need a cmake to get a 7z to get a cmake to get a ....

At what point to we just deploy libarchive?

@vicroms
Copy link
Member Author

vicroms commented Nov 4, 2022

I'm getting really uncomfortable with the castle we're building here. We need a cmake to get a 7z to get a cmake to get a ....

At what point to we just deploy libarchive?

That would be a reasonable alternative. This PR is specifically in service of a user running build machines on Windows Server 2012 R2 (no System32/tar.exe) and not enough privilege to run MSI installers.

@BillyONeal
Copy link
Member

Server 2012 R2

People running out-of-support OSes makes Bill sad :(. And whatever is making this machine they're using can't put 7z on the box in the first place?

@BillyONeal
Copy link
Member

What's the system version of CMake they're using? Could we just be more lax and use that all the time (maybe behind a switch?)

@vicroms
Copy link
Member Author

vicroms commented Nov 4, 2022

Server 2012 R2

People running out-of-support OSes makes Bill sad :(. And whatever is making this machine they're using can't put 7z on the box in the first place?

We still would need to make changes to consider using a system 7z for this bootstrap. I could try modifying the provider to search 7zip in PATH and use it if available.

What's the system version of CMake they're using? Could we just be more lax and use that all the time (maybe behind a switch?)

Oldest documented CMake version I could find was 2.6 (from way back in 2008) and that one already had cmake -E tar ... so it could be possible to use that.

@BillyONeal
Copy link
Member

Oldest documented CMake version I could find was 2.6 (from way back in 2008) and that one already had cmake -E tar ... so it could be possible to use that.

I'm not worried about that not existing, I'm trying to find a path here that avoids "building the stack higher"; I'm not comfortable with an outcome that requires bootstrapping ~3 things in a row to go perfectly for the world to be functional. If we need to we need to but I think it's worth the investigation to avoid if possible.

If the customer you're working with deployed something somewhat recent like 3.20 but we look for 3.24, we could give them instructions that would make us just use 3.20 full stop if the ports they want don't care, for example.

@vicroms
Copy link
Member Author

vicroms commented Nov 7, 2022

If the customer you're working with deployed something somewhat recent like 3.20 but we look for 3.24, we could give them instructions that would make us just use 3.20 full stop if the ports they want don't care, for example.

What do you think about adding a <minVersion> tag to vcpkgTools.xml?

@BillyONeal
Copy link
Member

What do you think about adding a <minVersion> tag to vcpkgTools.xml?

version already means min-version by default.

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

After discussion today that this doesn't add more "servers that have to be up" I'm OK with this.

I would like to see a comment added that describes the intended path for these scenarios:

// Windows 10+: system32 tar -> unzip locked cmake -> unpack 7z .7z
// Windows 8.1-, but we find a system CMake: system cmake to unpack -> unzip locked cmake -> unpack 7z .7z
// Windows 8.1-, but no system cmake: msiexec /a 7z msi -> unzip locked cmake -> unpack 7z .7z

@vicroms vicroms force-pushed the pr/extract_system_cmake_fallback branch from 29ae594 to 7bcd6b7 Compare November 10, 2022 03:21
@vicroms vicroms merged commit 3c8138a into microsoft:main Nov 10, 2022
@vicroms vicroms deleted the pr/extract_system_cmake_fallback branch November 11, 2022 08:58
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.

2 participants