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

Portable RID PublishAOT doesn't work from source-build VMR .NET 9 Preview 5 #41727

Closed
omajid opened this issue Jun 21, 2024 · 10 comments · Fixed by #41754
Closed

Portable RID PublishAOT doesn't work from source-build VMR .NET 9 Preview 5 #41727

omajid opened this issue Jun 21, 2024 · 10 comments · Fixed by #41754
Labels
untriaged Request triage from a team member

Comments

@omajid
Copy link
Member

omajid commented Jun 21, 2024

Describe the bug

Trying to publish a hello-world console application with a source-build VMR targeting a portable RID doesn't work. Neither does using --use-current-runtime.

To Reproduce

[omajid@828429dd39b9 ~]$ dotnet publish -r linux-x64 /p:PublishAot=true
    /home/omajid/omajid.csproj : error NU1101: Unable to find package runtime.fedora.40-x64.Microsoft.DotNet.ILCompiler. No packages exist with this id in source(s): nuget.org

Restore failed with 1 error(s) in 12.6s
[omajid@828429dd39b9 ~]$ dotnet publish --use-current-runtime /p:PublishAot=true
    /home/omajid/omajid.csproj : error NU1101: Unable to find package runtime.fedora.40-x64.Microsoft.DotNet.ILCompiler. No packages exist with this id in source(s): nuget.org

Restore failed with 1 error(s) in 0.7s

Further technical details

  • Include the output of dotnet --info
[omajid@828429dd39b9 ~]$ dotnet --info
.NET SDK:
 Version:           9.0.100-preview.5.24307.1
 Commit:            35b2c21ea6
 Workload version:  9.0.100-manifests.9b4ca231
 MSBuild version:   17.11.0-preview-24279-02+b963c24ef

Runtime Environment:
 OS Name:     fedora
 OS Version:  40
 OS Platform: Linux
 RID:         fedora.40-x64
 Base Path:   /usr/lib64/dotnet/sdk/9.0.100-preview.5.24307.1/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      9.0.0-preview.5.24306.7
  Architecture: x64
  Commit:       a5cc707d97

.NET SDKs installed:
  9.0.100-preview.5.24307.1 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.5.24306.11 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.5.24306.7 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/lib64/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

cc @tmds

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jun 21, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@am11
Copy link
Member

am11 commented Jun 21, 2024

It probably needs #41198 (latest preview 6 build)

@omajid
Copy link
Member Author

omajid commented Jun 21, 2024

I was expecting that would fix matching/non-portable RID builds. Will that also fix portable RID builds?

@am11
Copy link
Member

am11 commented Jun 21, 2024

dotnet-publish will use the bundled ILCompiler package with that change (and skip looking for it in nuget feeds).

@omajid
Copy link
Member Author

omajid commented Jun 21, 2024

Even if the user wants to target portable RIDs?

@tmds
Copy link
Member

tmds commented Jun 21, 2024

No, then it should download the linux-x64 ILCompiler.
I'll take a closer look after the weekend.

@am11
Copy link
Member

am11 commented Jun 21, 2024

dotnet publish -r linux-x64 should work. --use-current-runtime or --ucr will get us non-portable RID on non-portable build.

@tmds
Copy link
Member

tmds commented Jun 21, 2024

--use-current-runtime or --ucr will get us non-portable RID on non-portable build.

No, it will use the portable rid to enable a consistent user-experience between portable and non-portable builds.

The issue with preview5 is that it knows about the non-portable ILCompiler and ProcessFrameworkReferences prefers that for the host over the portable one. We need to fix this. This is the desired behavior: dotnet/source-build#1215 (comment).

@am11
Copy link
Member

am11 commented Jun 21, 2024

No, it will use the portable rid to enable a consistent user-experience between portable and non-portable builds.

Ah, I forgot that --ucr refers to NETCoreSdkPortableRuntimeIdentifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants