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 Microsoft.NET.ILLink package #82407

Merged
merged 3 commits into from
Feb 23, 2023
Merged

Add Microsoft.NET.ILLink package #82407

merged 3 commits into from
Feb 23, 2023

Conversation

tlakollo
Copy link
Contributor

@tlakollo tlakollo commented Feb 20, 2023

Add is Packable property to produce the lib part of illink
Add Target to produce the ref part of illink
Adds logic to use API compat the way it was being used in dotnet/linker

Fixes xamarin/xamarin-macios#17518

Add Target to produce the ref part of illink
@tlakollo tlakollo self-assigned this Feb 20, 2023
@ghost ghost added the linkable-framework Issues associated with delivering a linker friendly framework label Feb 20, 2023
@ghost
Copy link

ghost commented Feb 20, 2023

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr
See info in area-owners.md if you want to be subscribed.

Issue Details

Add is Packable property to produce the lib part of illink
Add Target to produce the ref part of illink
Adds logic to use API compat the way it was being used in dotnet/linker

Author: tlakollo
Assignees: tlakollo
Labels:

linkable-framework

Milestone: -

@tlakollo tlakollo added this to the 8.0.0 milestone Feb 20, 2023

<PropertyGroup>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AssemblyName>illink</AssemblyName>
<Description>IL Linker</Description>
<RootNamespace>Mono.Linker</RootNamespace>
<IsPackable>true</IsPackable>
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to add <IsShipping>false</IsShipping> so we don’t ship this package to NuGet.

Copy link
Contributor Author

@tlakollo tlakollo Feb 21, 2023

Choose a reason for hiding this comment

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

Seems like this package is being shipped to Nuget by dotnet/linker (https://www.nuget.org/packages/Microsoft.NET.ILLink), I'm not sure if it's necessary for xamarin purposes though.

Copy link
Member

Choose a reason for hiding this comment

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

If this package is already shipping, then we shouldn't mark it as non-shipping.

Copy link
Contributor

Choose a reason for hiding this comment

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

That package should not be on public nuget.org and it was not until net8 p1. We are shipping it via internal feeds only, please remove it from nuget.org.

Copy link
Member

Choose a reason for hiding this comment

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

cc @sbomer

Copy link
Member

Choose a reason for hiding this comment

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

Looking into this

Copy link
Member

@sbomer sbomer Feb 24, 2023

Choose a reason for hiding this comment

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

I've requested for the package to be removed from nuget.

It sounds like we should also set IsPackable IsShipping to false here. Per @jkoritzinsky this means that it will be published to the dotnet8-transport feed only (not the dotnet8 feed which is intended for packages that will eventually be published to nuget when we release). Consumers will need to make sure to use that feed as a nuget source. Does this sound ok @marek-safar?

Copy link
Member

@ViktorHofer ViktorHofer Feb 24, 2023

Choose a reason for hiding this comment

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

No, we need to keep the <IsPackable>true</IsPackable> property. That indicates that the library is packable, i.e. it makes a dotnet pack invocation work locally. If you set it to false, this library will never generate a package, neither locally nor on CI.

To control whether a library should be published to a transport feed but not to a stable feed (i.e. nuget.org), you want to use <IsShipping>false</IsShipping>.

Copy link
Member

@sbomer sbomer Feb 24, 2023

Choose a reason for hiding this comment

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

🤦 sorry, I meant to write IsShipping.

</PropertyGroup>

<!-- The default pack logic will include the implementation assembly in lib.
This also adds the reference assembly under ref. -->
<Target Name="_AddReferenceAssemblyToPackage">
Copy link
Member

Choose a reason for hiding this comment

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

@ViktorHofer - is there a reason why the ref assemblies doesn't get added automatically?

Copy link
Member

Choose a reason for hiding this comment

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

Reference assemblies aren't part of our core stack packages anymore since .NET 6. AFAIK this package needs the reference assembly, but it would be good to understand why.

…nes the reference files into a variable that can be used to add them to a package
@tlakollo tlakollo marked this pull request as ready for review February 23, 2023 18:56
@tlakollo tlakollo merged commit ad5bc70 into dotnet:main Feb 23, 2023
@tlakollo tlakollo deleted the AddRefToNuget branch February 23, 2023 21:32
sbomer added a commit that referenced this pull request Mar 2, 2023
This package should not be published to nuget. See #82407 (comment) for context.
@ghost ghost locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants