Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix ILLink when run from VS/desktop/direct - #42266

Merged
safern merged 1 commit into
dotnet:masterfrom
ericstj:fixIlLink.outside.dotnet
Oct 31, 2019
Merged

safern merged 1 commit into
dotnet:masterfrom
ericstj:fixIlLink.outside.dotnet

Conversation

@ericstj

@ericstj ericstj commented Oct 31, 2019

Copy link
Copy Markdown
Member

ILLink needs the path to dotnet.exe and was relying on an optional
environment variable to find it.

Instead use the NetCoreRoot property set by the SDK.

This is a direct copy of
https://github.com/dotnet/sdk/blob/b28a8efbfb30d84019351abb3aa9a2b15e008662/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L74-L80

We should try to eliminate our custom illink.targets and just configure
the built in ones if we can.

ILLink needs the path to dotnet.exe and was relying on an optional
environment variable to find it.

Instead use the NetCoreRoot property set by the SDK.

This is a direct copy of
https://github.com/dotnet/sdk/blob/b28a8efbfb30d84019351abb3aa9a2b15e008662/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L74-L80

We should try to eliminate our custom illink.targets and just configure
the built in ones if we can.

@sbomer sbomer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing this!

@safern
safern merged commit 18d2d60 into dotnet:master Oct 31, 2019
@eiriktsarpalis

Copy link
Copy Markdown
Member

A bit late to this, but while the change does fix builds in regular VS sessions, it does not do the same with VS instances started via build -vs. Rebuilding System.Text.RegularExpressions.sln now results in the following error:

2>ILLINK : error :
2>  An assembly specified in the application dependencies manifest (Microsoft.NETCore.App.deps.json) was not found:
2>    package: 'Microsoft.NETCore.App', version: '5.0.0'
2>    path: 'runtimes/rid/lib/netcoreapp0.0/System.Text.RegularExpressions.dll'
2>Done building project "System.Text.RegularExpressions.csproj" -- FAILED.

It seems like it's picking up the testhost sdk. I think we probably need to explicitly set DOTNET_HOST_PATH at build.ps1.

sbomer added a commit to sbomer/coreclr that referenced this pull request Nov 1, 2019
I'm not sure we ever build corelib using desktop MSBuild, but this
should prevent problems like
dotnet/corefx#42266 if we do.
sbomer added a commit to sbomer/coreclr that referenced this pull request Nov 1, 2019
I'm not sure we ever build corelib using desktop MSBuild, but this
should prevent problems like
dotnet/corefx#42266 if we do.
sbomer added a commit to dotnet/coreclr that referenced this pull request Nov 1, 2019
* Update ILLink.Tasks

This adds a few roots that are needed by reflection APIs, experimental
(internal) APIs, and by the runtime.

* Remove MemoryLoadChangeNotification root

The Register/Unregister methods were already being removed by the
linker, so we do not need to introduce them.

* Keep ThreadPoolBoundHandle implementation of IDisposable

* Update to linker version with unusedinterfaces opt

* GeneratePackagePath -> GeneratePathProperty

This wasn't causing any problems since these packages happened to have
tools folders, which always get the path property generated. We could
get rid of them, but perhaps it's better to be explicit.

* Prevent problems when running on desktop

I'm not sure we ever build corelib using desktop MSBuild, but this
should prevent problems like
dotnet/corefx#42266 if we do.
@karelz karelz added this to the 5.0 milestone Dec 19, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
ILLink needs the path to dotnet.exe and was relying on an optional
environment variable to find it.

Instead use the NetCoreRoot property set by the SDK.

This is a direct copy of
https://github.com/dotnet/sdk/blob/dotnet/corefx@b28a8efbfb30d84019351abb3aa9a2b15e008662/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L74-L80

We should try to eliminate our custom illink.targets and just configure
the built in ones if we can.

Commit migrated from dotnet/corefx@18d2d60
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants