-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Solution for .NET Standard using linked files #2177
Conversation
Add Orleans and OrleansRuntime Add codegen projects and execution (these do not generate anything currently) Link to all files in Orleans Target .NET Standard 1.5 AutoGenerateBindingRedirects Add README-CoreClr-port explaining the port process.
@dotnet-bot test this please |
Thanks @jdom! will review tomorrow |
Is the eventual plan to have just one .sln, or to maintain two? I'm not sure I see the intended path here |
@ReubenBond this is temporary so we can work in parallel in |
Hopefully this is a short-lived change. I appreciate the push to move .NET Standard work into the mainline branch - it should help us move much faster. |
Ideally this will not be needed once we finish the walk phase, and we are confident that we can replace the binaries with the ones targeting .Net standard. So it will be medium-term lived, or as long as it takes us to reach the end of that 2nd phase |
@@ -97,11 +97,14 @@ private static void ProcessAssembly(Assembly assembly) | |||
{ | |||
Logger.Verbose3("Processing assembly {0}", assemblyName); | |||
} | |||
|
|||
#if !NETSTANDARD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below, this is guarded by !NETSTANDARD_TODO - why the discrepancy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reflection only load, so we won't have this scenario in .net standard (that's why it's not a TODO item at least here).
I'll review tomorrow if there's another reflection only load check that I incorrectly marked as TODO and fix it, thanks. The reality is that previously they were all just NETSTANDARD, and I recently started rebasing and crafting the commits so they add the NETSTANDARD_TODO one instead, so it is very likely that I missed a few where it made sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, there were several NETSTANDARD_TODO
comments related to reflection only that I changed to NETSTANDARD
(and rebased). They were all in commit Remove some usages of ReflectionOnly and our type resolvers in .NET Standard
(which is now 00de92f8fd8da2e824b06383352c0b9261d91209)
<ItemGroup /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> | ||
<PropertyGroup> | ||
<NuGetTargetMoniker>.NETStandard,Version=v1.5</NuGetTargetMoniker> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this is by design. It is an official hack explained here: https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be replaced once the final msbuild tooling for .net standard is in place. In the meantime it allows us to do things like compile time codegen with the existing targets, instead of migrating everything to the dotnet CLI tooling which will be completely changed very soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That explains it :) Sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I'm glad you downloaded it locally for reviewing, as it is hard to get a sense of how it works without it. Let me know if you have any issues building, as this csproj stuff made me do a few hacks (the other one is that project references don't work well with this, so it is using project build dependencies to define the project build order, and then dependent projects reference the built dll in the output path).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both trees build fine & BVTs pass in main tree. Now I'm trying to get IL-serializer working on top of it :)
Assuming that we have consensus on the general approach (creating a vNext subdirectory with projects which link to files from the main tree) and that we will clean up the |
I understand, and I also explored many options to avoid this. Nevertheless this ended up being the most workable approach.
If getting there would be a week's worth of work, then this intermediate vNext solution would not be needed, but we know that's impossible. We need something that temporarily builds even if it is not functional for the community (and rest of our core team) contributions to start coming, otherwise I'm the single bottleneck to get everything 100% working before we can push to master. |
Good job !@jdom . Will take a closer look tomorrow ! |
@ReubenBond When Julian first came with the new .sln idea I was reluctant about multiple Overall, LGTM. I'll be back soon and start working on that as well. |
4b51fcf
to
a096c49
Compare
(will probably be resolved by dotnet#2147)
…ings in .NET Standard
It was only being used for assembly load tracing
…refactored to use overloads supported in .NET Standard
(need to find a workaround so that even our most basic tests can run)
a096c49
to
0766ee1
Compare
This new solution contains the working place for the migration effort to .NET Standard and .NET Core (#2143).
The
vNext
tree has a separate solution (src/Orleans.vNext.sln
) with several projects that have links to the code files in the main (non-vNext) solution.Currently not all of the original projects were migrated to target .NET Standard, and we'll add them as we need and can (for example, we first need to get a few basic test projects up so that we can start asserting the port is working as expected).
We mainly use 2 different compilation constant to differentiate between the 2 solutions (via conditional compilation):
NETSTANDARD
: When something is just different between the 2 targets. Long term we want to avoid multi-targeting library projects for full .NET Framework and .NET Standard. So it means that this compilation constant will eventually be dropped, but we do not expect this soon (at least not before the WALK phase defined in issue [WIP] Orleans 2.X #2143).NETSTANDARD_TODO
: short term temporary conditional compilation to get the project to build, but requires fixing before that feature is functional. This was mainly added to get the project bootstrapped and compiling so that the community can start contributing these pieces that were temporarily left out.Things coming soon:
NETSTANDARD_TODO
compilation constant.See this comment for rationale of this approach.
Note to committers (and reviewers): please do not squash this into a single commit. If there's feedback to address (most likely), I'll add new commits, but when this has been approved an it's ready to be merged, I'll just rebase and clean the commit history, since I tried to track each of the remaining issues into separate commits (which is a nice way to review too, if you want to go 1 commit at a time)