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

Add x64 emulation support to pkg installers #11813

Merged
merged 6 commits into from
Sep 20, 2021

Conversation

sfoslund
Copy link
Member

@sfoslund sfoslund commented Sep 1, 2021

No description provided.

@sfoslund
Copy link
Member Author

sfoslund commented Sep 1, 2021

Test run to generate assets (see Artifacts/BlobArtifacts/*.pkg): https://dev.azure.com/dnceng/internal/_build/results?buildId=1335379&view=results

Installers are being generated and installing to correct locations but when both arm64 and x64 are installed the hostFXR files only show up in the most recent installation (that is, if x64 is installed last then these files are not present in the main dotnet dir, but they are in the dotnet/x64 dir), I'm investigating if this is a result of something special in the hostfxr pkg generation or something else.

Edit: The files that are being removed are coming from packages com.microsoft.dotnet.hostfxr.6.0.0-rc.2.21451.3.component.osx.x64.pkg and com.microsoft.dotnet.sharedhost.6.0.0-rc.2.21451.3.component.osx.x64.pkg. I haven't found anything in these 2 packages' PackageInfo files or payloads that differ from the other 4 that are installing correctly.

@ericstj
Copy link
Member

ericstj commented Sep 2, 2021

Does ARM64 and X64 use the same package identifier for host? That would cause it. My understanding of the way that MacOS identifies "upgrades" is by comparing the package identifier. If there is already a receipt on the machine for that same identifer, then it will look at the files installed by the new package to see if they are the same as the old, for any files missing from the new one it will remove them.

I can't find the docs I read about this at the moment, but sharing in case that gives a clue.

You should also be able to see this happening in the installer log. When you install the bundle, open the installer log (Windows > Installer Log) and change the view to show all logged entries.

@sfoslund
Copy link
Member Author

sfoslund commented Sep 2, 2021

I think you're right, it does have something to do with pkg ids. When I check what pkgs were installed, I get the following:

After installing arm64:

pkgutil --pkgs
...
com.microsoft.dotnet.sharedframework.Microsoft.NETCore.App.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.netstandard.pack.targeting.2.1.0.component.osx.x64
com.microsoft.dotnet.pack.apphost.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.dotnet.dev.6.0.100-rc.2.21451.26.component.osx.arm64
com.microsoft.dotnet.hostfxr.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.dotnet.pack.targeting.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.dotnet.sharedhost.component.osx.x64
...

After installing x64 (on the same machine):

pkgutil --pkgs
...
com.microsoft.dotnet.sharedframework.Microsoft.NETCore.App.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.netstandard.pack.targeting.2.1.0.component.osx.x64
com.microsoft.dotnet.pack.apphost.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.dotnet.dev.6.0.100-rc.2.21451.26.component.osx.arm64
com.microsoft.dotnet.hostfxr.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.dotnet.pack.targeting.6.0.0-rc.2.21451.3.component.osx.x64
com.microsoft.dotnet.sharedhost.component.osx.x64
com.microsoft.dotnet.dev.6.0.100-rc.2.21451.26.component.osx.x64

Note that the pkg generated by dotnet/installer is the only one that has the correct .arm64 suffix in the first installer and as a result we see it twice (one arm64 one x64) in the second result. It appears this comes from this line in the arcade logic, which uses x64 in the pkg id regardless of the target architecture: https://github.com/dotnet/arcade/blob/fe787bd48ed72e51a98eb5e4e5e5af74edb531e5/src/Microsoft.DotNet.Build.Tasks.Installers/build/installer.singlerid.targets#L379

I've confirmed that replacing the x64 instances in the arm64 installer fixes the issue, so I'll make a PR to arcade to take architecture into account for package id.

@ericstj
Copy link
Member

ericstj commented Sep 2, 2021

Nice find!

@sfoslund sfoslund reopened this Sep 9, 2021
@sfoslund sfoslund changed the base branch from release/6.0.1xx to release/6.0.1xx-rc2 September 16, 2021 23:04
@sfoslund sfoslund marked this pull request as ready for review September 16, 2021 23:04
Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

We should file an issue to remove duplication here and leverage the arcade task

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
@sfoslund
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sfoslund sfoslund merged commit a9c86cb into dotnet:release/6.0.1xx-rc2 Sep 20, 2021
@sfoslund sfoslund deleted the MacInstallersChoice branch September 20, 2021 22:52
@ericstj
Copy link
Member

ericstj commented Sep 29, 2021

@sfoslund @marcpopMSFT -- what tracks getting this change into main and release/6.0.1xx? Will that be automatic? Today it's missing and it's causing those daily builds to regress this fix.

@sfoslund
Copy link
Member Author

sfoslund commented Sep 29, 2021

It isn't automatic, we do manual merges periodically. I was planning on merging rc2 into GA and main branches later this week once tell mode had passed, but if you need me to do it before then let me know

@ericstj
Copy link
Member

ericstj commented Sep 29, 2021

Later this week should be fine. Right now everyone needs to be testing the RC2 builds so I think it's just about messaging to folks where to get the latest bits.

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