Skip to content

Emit the hostArchitectures attribute when building the macOS bundle. - #7232

Merged
jkoritzinsky merged 3 commits into
mainfrom
hostArchitecture-support
Apr 15, 2021
Merged

Emit the hostArchitectures attribute when building the macOS bundle.#7232
jkoritzinsky merged 3 commits into
mainfrom
hostArchitecture-support

Conversation

@jkoritzinsky

@jkoritzinsky jkoritzinsky commented Apr 13, 2021

Copy link
Copy Markdown
Member

@sdmaclea can you validate that this change allows us to build an ARM64 distribution bundle on non Big Sur MacOS machines?

Contributes to dotnet/runtime#48388

Fixes #7233

@sdmaclea sdmaclea left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That change looks almost correct. The attribute is hostArchitectures, note the final s

I don't know how to check this works correctly, so only visually inspected.

I also don't know how to test this on my machine easily. Since Rosetta is already installed. I guess I would have to figure out how to remove it....

I think we will eventually want to set os-version min to 11.3 for Apple Silicon, because 11.2 and earlier are horribly unstable.

@sdmaclea sdmaclea changed the title Emit the hostArchitecture attribute when building the macOS bundle. Emit the hostArchitectures attribute when building the macOS bundle. Apr 14, 2021
@jkoritzinsky

Copy link
Copy Markdown
Member Author

The best way to test this would be to build Arcade locally and set the MicrosoftDotNetBuildTasksInstallersTaskAssembly msbuild property in your build to point to the locally built task assembly (for example $(ArcadeRepoRoot)/artifacts/bin/Microsoft.Dotnet.Build.Tasks.Installers/Debug/netcoreapp3.1/publish/Microsoft.DotNet.Build.Tasks.Installers.dll where $(ArcadeRepoRoot) is the root of your local Arcade clone).

@sdmaclea

Copy link
Copy Markdown

I built this on my M1, the generated Distribution file looks correct.

    <options customize="never" require-scripts="false" hostArchitectures="arm64"/>
    <welcome file="welcome.html" mime-type="text/html"/>
    <conclusion file="conclusion.html" mime-type="text/html"/>
    <volume-check>
        <allowed-os-versions>
            <os-version min="10.13"/>
        </allowed-os-versions>
    </volume-check>

It even worked when there was already a hostArchitectures attribute present. Perhaps it shouldn't overwrite it if one is actually present?

@sdmaclea

Copy link
Copy Markdown

Apple has not provided a published mechanism to uninstall Rosetta 2, so I cannot check this actually fixes the issue on my M1.

@jkoritzinsky

Copy link
Copy Markdown
Member Author

It should not overwrite if the attribute is already present. It leaves the attribute as is.

@jkoritzinsky
jkoritzinsky merged commit e76fe48 into main Apr 15, 2021
@jkoritzinsky
jkoritzinsky deleted the hostArchitecture-support branch April 15, 2021 16:52
@jkoritzinsky

Copy link
Copy Markdown
Member Author

As the distribution file looks correct, we'll go with this until we know we need something else.

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.

Need a mechanism to parameterize a MacOS distribution template.

2 participants