-
Notifications
You must be signed in to change notification settings - Fork 379
Adding basic support for an ilproj sdk. #317
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
Conversation
|
FYI. @weshaggard |
|
A bare bones <?xml version="1.0"?>
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</Project>I validated locally that this works with |
|
The SDK doesn't have all the support required to open an ilproj in VS, but that can always be added in the future (if desired). |
| <?xml version="1.0" encoding="utf-8"?> | ||
| <package> | ||
| <metadata minClientVersion="2.8.1"> | ||
| <id>Microsoft.DotNet.Sdk.IL</id> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Also CC. @eerhardt |
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <OSPlatform Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))">win</OSPlatform> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="$(IlasmPackageName)" Version="$(IlasmPackageVersion)" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| <_KeyFileArgument Condition="'$(KeyOriginatorFile)' != ''">-KEY=$(KeyOriginatorFile)</_KeyFileArgument> | ||
|
|
||
| <_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <OSPlatform Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))">win</OSPlatform> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| <Target Name="CreateManifestResourceNames" | ||
| Condition="'@(EmbeddedResource)' != ''" | ||
| DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"> | ||
| <!-- Required by Microsoft.Common.targets --> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| </Exec> | ||
| <Error Text="ILAsm failed" Condition="'$(_ILAsmExitCode)' != '0'" /> | ||
|
|
||
| <CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| <PropertyGroup> | ||
| <MSBuildAllProjects>$(MSBuildThisFileFullPath);$(MSBuildAllProjects)</MSBuildAllProjects> | ||
| <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.ilproj'">$(MSBuildThisFileDirectory)..\build\Microsoft.NET.Sdk.IL.targets</LanguageTargets> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have | ||
| created a backup copy. Incorrect changes to this file will make it | ||
| impossible to load or build your projects from the command-line or the IDE. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@RussKeldorph PTAL we are doing some work to create a package for ilprojs. |
| <RuntimeIdentifier>$(OSPlatform)-$(OSArchitecture.ToLower())</RuntimeIdentifier> | ||
| <CoreCLRPackageName>runtime.$(RuntimeIdentifier).microsoft.netcore.runtime.coreclr</CoreCLRPackageName> | ||
| <IlasmPackageName>runtime.$(RuntimeIdentifier).microsoft.netcore.ilasm</IlasmPackageName> | ||
| <IlasmPackageVersion>2.0.8</IlasmPackageVersion> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="$(IlasmPackageName)" Version="$(IlasmPackageVersion)" /> | ||
| <PackageReference Include="$(CoreCLRPackageName)" Version="$(IlasmPackageVersion)" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| <Error Condition="'$(ToolsDir)' == ''" Text="ToolsDir must be set in order to build ilproj's" /> | ||
| <MakeDir Directories="$(ToolsDir)\ilasm" /> | ||
| <Copy DestinationFolder="$(ToolsDir)\ilasm" SourceFiles="@(_IlasmSourceFiles)" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| </PropertyGroup> | ||
|
|
||
| <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | ||
| <Import Project="$(MSBuildThisFileDirectory)..\build\Microsoft.NET.Sdk.IL.props" Condition="'$(MSBuildProjectExtension)' == '.ilproj'" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFrameworks>netstandard1.0</TargetFrameworks> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| <RuntimeIdentifier>$(OSPlatform)-$(OSArchitecture.ToLower())</RuntimeIdentifier> | ||
| <CoreCLRPackageName>runtime.$(RuntimeIdentifier).microsoft.netcore.runtime.coreclr</CoreCLRPackageName> | ||
| <IlasmPackageName>runtime.$(RuntimeIdentifier).microsoft.netcore.ilasm</IlasmPackageName> | ||
| <IlasmPackageVersion>2.0.8</IlasmPackageVersion> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Resolved the majority of feedback so far (that isn't part of secondary refactoring/cleanup work) |
| <OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux'))">linux</OSPlatform> | ||
| <OSPlatform Condition="$([MSBuild]::IsOSPlatform('osx'))">osx</OSPlatform> | ||
| <OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</OSArchitecture> | ||
| <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(OSPlatform)-$(OSArchitecture.ToLower())</RuntimeIdentifier> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -0,0 +1,19 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <OSPlatform Condition="$([MSBuild]::IsOSPlatform('windows'))">win</OSPlatform> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| <IlasmPackageRuntimeId Condition="'$(IlasmPackageRuntimeId)' == ''">$(OSPlatform)-$(OSArchitecture.ToLower())</IlasmPackageRuntimeId> | ||
| <CoreCLRPackageName>runtime.$(IlasmPackageRuntimeId).microsoft.netcore.runtime.coreclr</CoreCLRPackageName> | ||
| <IlasmPackageName>runtime.$(IlasmPackageRuntimeId).microsoft.netcore.ilasm</IlasmPackageName> | ||
| <IlasmPackageVersion Condition="'$(IlasmPackageVersion)' == ''">2.0.8</IlasmPackageVersion> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| <_IlasmSourceFiles Include="$(NuGetPackageRoot)\$(CoreCLRPackageName)\$(IlasmPackageVersion)\runtimes\$(IlasmPackageRuntimeId)\native\**\*" /> | ||
| </ItemGroup> | ||
|
|
||
| <Error Condition="'$(ToolsDir)' == ''" Text="ToolsDir must be set in order to build ilproj's" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| <ItemGroup> | ||
| <None Include="sdk/*.*" Pack="true" PackagePath="sdk/%(Filename)%(Extension)" /> | ||
| <None Include="build/*.*" Pack="true" PackagePath="build/%(Filename)%(Extension)" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Have we given any thought to how source-build and bootstrapping a new platform will work with these changes? Check out: https://github.com/dotnet/source-build/blob/master/Documentation/boostrap-new-os.md#use-the-bootstrap-cli-to-build-source-build for some hack workarounds I needed to do with ILAsm when trying to bootstrap a platform. One concern here is the ordering of the repos during source-build. The way we have it today is that roslyn-tools (i.e. the current 'arcade') is built first, but here are we directly dependent on coreclr. I'm wondering how someone could fix a bug in ILAsm, and then use source-build to build the product again. How could someone tell this new IL SDK package to use the local ILAsm package that they just built themself? NOTE: this initial PR doesn't need to block on this comment, just putting up some "food for thought". |
I would presume that CoreCLR builds the package and puts it into the source build feed. Source build when then consume said package from the source build feed (it should be no different from dogfooding any other native tool from the toolchain). |
But the way you have it coded, your package uses the |
It's conditionalized so anyone can override it. That being said, it isn't following the standard naming convention, which I'll update. |
|
Updated as per the new feedback so far. |
Is there any reason we don't just put it in coreclr to start with? |
ILAsm and the ILAsm package are both in CoreCLR and produced from there already... Unless you are asking about this SDK package? |
Yes I'm referring to the sdk package. Ideally we can keep everything together. We could even potentially turn the root Microsoft.NETCore.Ilasm package into the sdk package. |
I'm not sure if that is desirable.
|
|
Compare it to our other compiler NuGet package - https://www.nuget.org/packages/Microsoft.NETCore.Compilers/ has |
Right. The |
|
@tannergooding at any rate to help with source-build and other such things I think it would be good to have this SDK package build in coreclr instead of arcade so the tools can be built as a prereq for the other higher level repo's needing this. |
|
Working on porting this over to CoreCLR. Will close after the new PR is up. |
|
Porting to CoreCLR requires a change to build-tools so that the |
That's fine go ahead and make the necessary PR changes. |
|
As an update. The BuildTools changes went in: dotnet/buildtools#2100 Just waiting on the changes to be pumped back to CoreCLR now. |
|
Replaced by dotnet/coreclr#19066 |
|
CoreFX side is here: dotnet/corefx#31512 |
This adds the basic support for an ilproj sdk. The IL compilation target was taken from the CoreFX
IL.targets