Open sbomer opened 1 year ago
Documenting an issue I encountered with GitHub Actions Runner ubuntu22/20231115.7 (includes .NET 8) when building a .NET 7 project.
I use GitHub Actions for publishing trimmed .NET binaries, my workflow consists of a restore
step and all subsequent steps use --no-restore
, I found that builds were no longer being trimmed due to ILLink having disappeared. I eventually stumbled upon this issue and its linked PRs which noted that a restore would be required for ILLink to be downloaded, because I use /p:PublishTrimmed=true
and --no-restore
on the publish
command ILLink is never downloaded.
The solution is to add /p:PublishTrimmed=true
to the restore command or alternatively avoid using --no-restore
to ensure that ILLink is present.
I believe there should be a warning or error when PublishTrimmed is specified but ILLink isn't present.
Thanks for reporting @LXGaming, let's track that in https://github.com/dotnet/sdk/issues/37049.
With the change to download a linker package that matches the target framework (https://github.com/dotnet/sdk/pull/29441), ILLink is no longer bundled with the SDK and therefore is no longer going to be crossgen'd (see https://github.com/dotnet/installer/pull/15151#issuecomment-1363190864).
Opening this as a tracking issue in case we want to do something about that. Let's keep an eye on the build performance. If we need to, we could probably ship RID-specific ILLink packages that are crossgen'd as part of the runtime build.