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

Support Windows Arm64 Build #1801

Merged
merged 3 commits into from
Jul 24, 2024
Merged

Conversation

shibayan
Copy link
Contributor

@shibayan shibayan commented Jul 16, 2024

Relate #1270

A build for Windows on Arm will be added to Volta.

The changes I made include creating an msi and zip for Arm64 in my repository, and I have confirmed that it works on Windows on Arm machines.

Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me overall! I had a bunch of questions, but they are questions where I literally just do not understand the reasoning, so do not take them as implying you’re wrong in making those changes—merely that I would like to understand them and make sure we have the reason for the change captured for posterity!

Also, @charlespierce can you take a gander here?

Comment on lines -24 to -28
<?if $(var.Platform) = x64 ?>
<?define Win64 = "yes" ?>
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define Win64 = "no" ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the Win64 changes here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Win64 and Platform settings have been removed as they are now deprecated in wix. The details are described in the following pull request from cargo-wix, which is shared here.

volks73/cargo-wix#113 (comment)

I took the opportunity to remove use of Win64 and Platform in the wxs: those attributes are deprecated according to the wix documentation, passing -arch on the command line should be prefered (which this PR now does). var.Platform is replaced by sys.BUILDARCH.

Comment on lines +194 to +198
<?if $(sys.BUILDARCH) = x64 ?>
<Feature Id='VCRedistributable' Title='Visual C++ Runtime' AllowAdvertise='no' Display='hidden' Level='1'>
<MergeRef Id='VCRedist'/>
</Feature>
<?endif ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise, why the addition of the BUILDARCH check here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a condition that the VC++ redistribution runtime should not be included on arm64 since it was included for x64.

However, I do not know why the redistribution runtime is included. In my opinion, it seems unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like that was added in #592, as it's needed to actually run Volta and not always available on the system.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked into it because I couldn't find a merge module for Arm64, and it seems that it is now deprecated.

Merge modules (.msm files) for Visual C++ Redistributable files are deprecated. We don't recommend you use them for application deployment. Instead, we recommend central deployment of the Visual C++ Redistributable package.

https://learn.microsoft.com/en-us/cpp/windows/redistributing-visual-cpp-files?view=msvc-170#install-the-redistributable-merge-modules

Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252'
Platform='$(var.Platform)'/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you dropping the Platform value here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am deleting it for the same reason as here: #1801 (comment)

Comment on lines +62 to +64
<?if $(sys.BUILDARCH) = x64 ?>
<Merge Id='VCRedist' SourceFile='wix\Microsoft_VC140_CRT_x64.msm' DiskId='1' Language='0'/>
<?endif ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you dropping this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the VC++ redistribution runtime was only available for x64, I have added a condition so that it is only included for x64 as before.

</Directory>

<ComponentGroup Id='Binaries' Directory='INSTALLDIR'>
<Component Id='voltaBinary' Guid='*' Win64='$(var.Win64)'>
<Component Id='voltaBinary' Guid='*'>
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and throughout, why are you removing Win64=?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am deleting it for the same reason as here: #1801 (comment)

Copy link
Contributor

@charlespierce charlespierce left a comment

Choose a reason for hiding this comment

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

LGTM! We've never actually supported / done builds for 32-bit Windows anyway, so the removal of the 64-bit checks is even more welcome!

@chriskrycho
Copy link
Contributor

Excellent – and @shibayan answered all my questions (thank you!).

@chriskrycho chriskrycho merged commit a8f4ecb into volta-cli:main Jul 24, 2024
12 checks passed
@shibayan shibayan deleted the windows-arm branch July 26, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants