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

Packaging for crossgen2 as a framework dependent application. #27296

Merged
merged 9 commits into from
Oct 25, 2019

Conversation

fadimounir
Copy link

@fadimounir fadimounir commented Oct 18, 2019

This requires us to manually emit a runtimeconfig json for now, since the build produces a self-contained version of crossgen2.

Also includes some minor cleanups to the way we build crossgen2:

  • Removed from build.proj since we explicitly build it as a self-contained application from build.cmd/build.sh
  • Removed the output path property from the csproj files. We use an explicit -o argument when publishing to specify the output folder

The crossgen2 tools folder will include the following files:

  • clrjitilc.dll
  • crossgen2.exe
  • crossgen2.dll
  • crossgen2.runtimeconfig.json
  • ILCompiler.DependencyAnalysisFramework.dll
  • ILCompiler.ReadyToRun.dll
  • ILCompiler.TypeSystem.ReadyToRun.dll
  • jitinterface.dll
  • Microsoft.DiaSymReader.dll
  • System.CommandLine.dll

This requires us to manually emit a runtimeconfig json for now, since the build produces a self-contained version of crossgen2.

Also includes some minor cleanups to the way we build crossgen2:
- Removed from build.proj since we explicitly build it as a self-contained application from build.cmd/build.sh
- Removed the output path property from the csproj files. We use an explicit -o argument when publishing to specify the output folder
two simple scenarios we want to support in the short term: win_x64 to win_x64 and linux_x64 to linux_x64 compilations.
Once we have more complex targets, especially cross-platform and cross-architecture, crossgen2 should move to its own
package, and become a self-contained package. -->
<Crossgen2RuntimeConfigFile>$(ArtifactsObjDir)crossgen2\crossgen2.runtimeconfig.json</Crossgen2RuntimeConfigFile>
Copy link
Author

Choose a reason for hiding this comment

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

This will go away in dotnet 6.0 when crossgen2 moves to its own package

@fadimounir
Copy link
Author

BTW, is crossgen2 the name we want to keep long term?

@jkotas
Copy link
Member

jkotas commented Oct 21, 2019

is crossgen2 the name we want to keep long term?

I do not think so. It is ugly name.

@MichalStrehovsky
Copy link
Member

is crossgen2 the name we want to keep long term?

Last time this was discussed ("CPAOT directory structure on the CoreCLR side" internal email thread), the plan was to finalize the name before preview. Simon also threw an idea we could just call it crossgen (sans 2) once the native crossgen is retired.

Like they say - there's only two hard problems in computer science...

Fadi Hanna added 2 commits October 22, 2019 15:59
Renaming crossgen2 to just crossgen (still keeping crossgen2 for the publish folder name)
@fadimounir
Copy link
Author

fadimounir commented Oct 22, 2019

I renamed the crossgen2 to just crossgen. I kept the publish folder name unchanged for now.
cc @MichalStrehovsky @nattress

@fadimounir
Copy link
Author

fadimounir commented Oct 22, 2019

@dagood Could you please review this?
The goal is to publish crossgen2 into its own package. There's most likely a piece of work that'll need to be done in dotnet/core-setup too, which i'll do once this is merged.
The goal is to have the Microsoft.NETCore.<RID> packages that the SDK downloads and uses to compile apps into R2R.
For dotnet5.0, this will only be a scenario for linux/windows x64, with no cross-architecture compilations.

Also, is there anything else I need to do to have this new package published to the feed?

@fadimounir fadimounir requested a review from dagood October 22, 2019 23:33
@MichalStrehovsky
Copy link
Member

I renamed the crossgen2 to just crossgen. I kept the publish folder name unchanged for now.

Did something change since we last discussed this? In the "CPAOT directory structure on the CoreCLR side" internal email thread, Sergiy said "We should keep ‘2’ in the exe name for the move in order to avoid confusion at least in the nearest future. We can finalize the name before preview.".

Copy link
Member

@dagood dagood left a comment

Choose a reason for hiding this comment

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

I don't have experience with the recent stuff like Microsoft.Build.Traversal, but some comments.

Copy link
Author

@fadimounir fadimounir left a comment

Choose a reason for hiding this comment

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

Did something change since we last discussed this? In the "CPAOT directory structure on the CoreCLR side" internal email thread, Sergiy said "We should keep ‘2’ in the exe name for the move in order to avoid confusion at least in the nearest future. We can finalize the name before preview.".

The problem is that any renaming down the line now will cause some headache because it will require:

  1. Fixing packaging in this repo
  2. Fixing packaging in the dotnet/core-setup repo (although this might go away)
  3. Fixing the dotnet/sdk repo to reflect name changes.

After a chat with @davidwrighton yesterday, we realized that it would make more sense to just assume crossgen2 will be renamed to crossgen in the future when the current crossgen retires, and doing the rename right now aligns us with the most likely long term plan. Plus, we wouldn't have to fix the SDK again in the future when we rename.
To address the confusion issue, i kept the output folder name unchanged, and just renamed the binary itself.

Fixes to the Linux arm/arm64 builds.
Fix CI test failure.
@fadimounir
Copy link
Author

cc @sergiy-k

Copy link
Member

@dagood dagood left a comment

Choose a reason for hiding this comment

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

Packaging infra LGTM.

@fadimounir
Copy link
Author

To address the confusion issue, i kept the output folder name unchanged, and just renamed the binary itself.

I had an offline discussion with @MichalStrehovsky regarding the renaming and he pointed out that the SuperILC tool needs to be fixed too. It started to look like the value of a rename at this point was less than the confusion that could result.
We agreed that it would be better to do all the renames in a separate PR, so for the sake of reducing confusion and making it easy to findstr all "crossgen2" instances later when doing the work, i'll keep "crossgen2" as the name for now and undo some of my changes.

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

<!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
the same bits tests expect to see in bin/crossgen2. That way we never need to wonder which
binaries are up to date and which are stale. -->
<OutputPath>$(BinDir)/crossgen2</OutputPath>
Copy link
Member

Choose a reason for hiding this comment

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

Can we leave the conditioned OutputPath in the other projects (like in crossgen2.csproj)?

Copy link
Author

@fadimounir fadimounir Oct 24, 2019

Choose a reason for hiding this comment

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

There is no need for those. Building the main crossgen2 project takes care of putting these dependent files in the correct place (one of the scenarios I tested from VS)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants