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

Build arm64 in CI #11210

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Build arm64 in CI #11210

wants to merge 2 commits into from

Conversation

AArnott
Copy link

@AArnott AArnott commented Sep 14, 2023

Per discussion in #10649, the work to build for arm64 has been done, but not the work to include that in official builds.

This PR adds the arm64 build to CI so that it can ship with each release.

@ghost ghost assigned AArnott Sep 14, 2023
appveyor.yml Outdated Show resolved Hide resolved
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
@AArnott
Copy link
Author

AArnott commented Sep 14, 2023

Some more observations:

  • I can't tell from the appveyor log where the built binaries go, because of the 'quiet' verbosity setting. So while appveyor isn't capturing any arm64 artifact, it's difficult to understand why.
  • I can't build locally because of a build break as described here.
  • The MSI built seems to only build for x64. I'm not sure if a single MSI can pick up binaries for multiple architectures or if we need two build two MSIs.

@RussKie
Copy link
Member

RussKie commented Sep 21, 2023

Some more observations:

  • I can't tell from the appveyor log where the built binaries go, because of the 'quiet' verbosity setting. So while appveyor isn't capturing any arm64 artifact, it's difficult to understand why.

We can temporarily increase the verbosity, if necessary. Feel free to open a PR with the necessary change.
We use the artifacts layout similar to what's used by the .NET Arcade SDK, the layout is defined here:

<PropertyGroup>
<RepositoryToolsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', '.tools'))</RepositoryToolsDir>
<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', '$(Configuration)'))</ArtifactsDir>
<ArtifactsToolsetDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'toolset'))</ArtifactsToolsetDir>
<ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'obj'))</ArtifactsObjDir>
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
<ArtifactsPluginsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'GitExtensions', '$(SolutionTargetFramework)', 'Plugins'))</ArtifactsPluginsDir>
<ArtifactsTestsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'tests'))</ArtifactsTestsDir>
<ArtifactsLogDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'log'))</ArtifactsLogDir>
<ArtifactsTmpDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tmp'))</ArtifactsTmpDir>
<ArtifactsTestResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'TestResults'))</ArtifactsTestResultsDir>
<ArtifactsPackagesDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'packages'))</ArtifactsPackagesDir>
<ArtifactsUnitTestsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsTestsDir)', 'UnitTests'))</ArtifactsUnitTestsDir>
<ArtifactsIntegrationTestsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsTestsDir)', 'IntegrationTests'))</ArtifactsIntegrationTestsDir>
<ArtifactsPublishDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'publish'))</ArtifactsPublishDir>
<AppPublishDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsPublishDir)', 'GitExtensions'))</AppPublishDir>
</PropertyGroup>

According to the discussion you were able to find a remedy. Is that correct?

  • The MSI built seems to only build for x64. I'm not sure if a single MSI can pick up binaries for multiple architectures or if we need two build two MSIs.

The wix is very finicky, and we have very limited knowledge of it. Generally, it may be simpler to create two different installers - one for each platform.

We currently don't produce an msi for arm64 builds:

<Target Name="CreateMsi" Condition="'$(Arm64Build)' != 'true'" AfterTargets="CreatePortable">
<PropertyGroup>
<_AppVeyorSuffix>$(ARTIFACT_BUILD_SUFFIX)</_AppVeyorSuffix>
<_PublishMsiVersionSuffix>-$(CurrentBuildVersion.ToString())$(_AppVeyorSuffix)</_PublishMsiVersionSuffix>
<_PublishMsiCommitHashSuffix Condition="'$(GitCommit)' != ''">-$(GitCommit)</_PublishMsiCommitHashSuffix>
<_PublishMsiCommitHashSuffix Condition="'$(env:APPVEYOR_REPO_COMMIT)' != ''">-$(env:APPVEYOR_REPO_COMMIT)</_PublishMsiCommitHashSuffix>
<_PublishMsiCommitHashSuffix Condition="'$(env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)' != ''">-$(env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)</_PublishMsiCommitHashSuffix>
<_PublishMsiFileName>GitExtensions$(_PublishMsiVersionSuffix)$(_PublishMsiCommitHashSuffix)</_PublishMsiFileName>
<_PublishMsiPath>$([MSBuild]::NormalizePath('$(ArtifactsPublishDir)'))</_PublishMsiPath>
</PropertyGroup>
<!-- Determine WiX version from the referenced package -->
<ItemGroup>
<_WiX Include="@(PackageReference)" Condition="$([System.String]::Copy('%(Identity)')) == 'WiX'" />
</ItemGroup>
<Error Text="WiX package reference can't be found" Condition="'@(_WiX->Count())' != 1" />
<PropertyGroup>
<_WiXVersion>%(_WiX.Version)</_WiXVersion>
</PropertyGroup>
<!-- Work out VS installation path, so we can find MSBuild.exe -->
<PropertyGroup>
<VSWherePath>$([MSBuild]::NormalizePath('$(Pkgvswhere)', 'tools'))</VSWherePath>
</PropertyGroup>
<Exec
Command="vswhere.exe -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild"
WorkingDirectory="$(VSWherePath)"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="_VSInstallPath" />
</Exec>
<PropertyGroup>
<_MSBuildCurrentPath>$([MSBuild]::NormalizePath('$(_VSInstallPath)', 'MSBuild', 'Current', 'Bin'))</_MSBuildCurrentPath>
<_SetupArgs>/p:Configuration=$(Configuration);Platform=x86;WiXVersion=$(_WiXVersion);Version=$(CurrentBuildVersion);ArtifactsBinPath=$(ArtifactsBinDir);ArtifactsPublishPath=$(AppPublishDir);OutputPath=$(_PublishMsiPath.TrimEnd('\'));TargetName=$(_PublishMsiFileName)</_SetupArgs>
</PropertyGroup>
<!-- WiX isn't yet compatible with .NET. See: https://github.com/wixtoolset/issues/issues/5627
So can't use the normal tool chain (i.e. dotnet publish or MSBuild task) and must fall back
to manually invoke msbuild.exe.
When WiX becomes .NET compatible we may be able to invoke the following:
<MSBuild
Projects="$(ProjectDir)\..\Setup\Setup.wixproj"
Targets="Build"
Properties="Configuration=$(Configuration);Platform=x86;WiXVersion=$(_WiXVersion);Version=$(CurrentBuildVersion);ArtifactsBinPath=$(ArtifactsBinDir);ArtifactsPublishPath=$(AppPublishDir);OutputPath=$(_PublishMsiPath.TrimEnd('\'));TargetName=$(_PublishMsiFileName)"
StopOnFirstFailure="true"
/>
-->
<Exec
Command="msbuild.exe $(ProjectDir)\..\Setup\Setup.wixproj /v:q /t:Build $(_SetupArgs) /bl:$(ArtifactsLogDir)\setup.binlog"
WorkingDirectory="$(_MSBuildCurrentPath)"
EchoOff="true"
ConsoleToMsBuild="true"
StandardOutputImportance="High">
</Exec>
</Target>

The setup should be configurable, meaning it should package files from an arbitrary "publish" directory supplied as a cli argument (like this):

<PluginManagerSourceDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinPath)', '..', 'publish'))</PluginManagerSourceDir>
<DefineConstants>Version=$(Version);NumericVersion=$(Version);ArtifactsBinPath=$(ArtifactsBinPath);ArtifactsPublishPath=$(ArtifactsPublishPath);PluginManagerSourceDir=$(PluginManagerSourceDir)\GitExtensions.PluginManager\Output</DefineConstants>
<DefineConstants Condition=" '$(Configuration)' == 'Debug' ">Debug;$(DefineConstants)</DefineConstants>

@AArnott
Copy link
Author

AArnott commented Sep 21, 2023

I haven't overcome my inability to build locally yet, no. Still waiting on the VC++ team to help me understand why.

@MagicAndre1981
Copy link

WiX v4.0.3 has arm64 fixes, so try the new version:

https://wixtoolset.org/docs/releasenotes/#v4

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.

None yet

3 participants