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 experimental CoreCLR support #6104

Merged
merged 22 commits into from
Jun 22, 2016
Merged

Conversation

jtattermusch
Copy link
Contributor

@jtattermusch jtattermusch commented Apr 6, 2016

Adds experimental support for building gRPC C# under CoreCLR (https://dotnet.github.io/).

Also enables support for running tests with run_tests.py:
tools/run_tests/run_tests.py -l csharp --compiler coreclr [--use_docker]

@ah-
Copy link

ah- commented Apr 14, 2016

Cool, I like this a lot!

@jtattermusch
Copy link
Contributor Author

I'll try to rebase this PR soon, so that it's usable by others.

@jtattermusch
Copy link
Contributor Author

Missing pieces here:
-- signing the assemblies that get packaged (should be easy enough)
-- VersionInfo.cs should file should be link-included in multiple projects (to provide version number)
-- (support compilation in x86 mode - that's that default for .NET 4.5)
-- some files are generated using templates (like VersionInfo.cs) and this hasn't been reflected in this PR yet.
-- NativeDeps.targets is used to copy prebuilt native libraries to the output directory when in development mode (working with gRPC repo itself). This PR doesn't support that yet (mostly because project.json has limited support for such things).

@ah-
Copy link

ah- commented Jun 14, 2016

About that last bit, NuGet v3 and dotnet cli now have good support for prebuilt native libraries. No need for special steps anymore, they just need to be in a special folder structure to get picked up.
See https://www.nuget.org/packages/libuv and https://github.com/aspnet/libuv-package.

@jtattermusch
Copy link
Contributor Author

@ah- thanks for the tip. I was aware that libuv does some interesting tricks (and what we do I inspired by that to some extent), but we also need to make things work properly on .NET 4.5 and with mono.

@jtattermusch
Copy link
Contributor Author

Also, project.json seems to be getting deprecated, so we might need to approach things differently (I think eventually, the XML-based projects will make things simpler to us, but currently it's unclear what exactly needs to be done).

@jtattermusch
Copy link
Contributor Author

rebased.

@bobbytables
Copy link

If there's anything outstanding on this that needs to be done, let me know!

@jtattermusch
Copy link
Contributor Author

@bobbytables see above "missing pieces".

Also, we need to figure out how to address the problem with project.json files getting deprecated.

@ah-
Copy link

ah- commented Jun 14, 2016

Do we need to do anything about project.json? Once the nuget package is built it doesn't matter if it came from a project.json project or an old-school msbuild one. The files are the same. So grpc could build with project.json for now until the replacement is in place.

Not sure what to do about VersionInfo.cs though.

@jtattermusch
Copy link
Contributor Author

Updated this PR with a bunch of improvements:

  • Grpc.Core.Tests and Grpc.Examples.Tests are now passing with dotnet5.4
  • make old style and new style project files not collide when using VS2015 (used projectname.project.json trick from Ignore PROJECT.JSON when using .CSPROJ dotnet/msbuild#394).
  • make code build under dotnet5.4 again
  • use the new "copyToOutput" mappings setting to copy native libraries to the right folder when building (currently only for windows, but good as a proof of concept)

@jtattermusch
Copy link
Contributor Author

jtattermusch commented Jun 15, 2016

Grpc.InteropTesting project is still not compatible with dotnet5.4, the biggest problem being that
some of the dependencies don't support dotnet5.4:

  • CommandLineParser
  • Moq
  • (Google.Apis.Auth might be problematic as well, as the GetApplicationDefaultCredentials code is currently only available for .NET 4.5)

@jskeet
Copy link
Contributor

jskeet commented Jun 17, 2016

I started skimming for the later project.json files, as basically once you've got one right for each "type" of project (core library, tests, sample) the rest will be the same. Hope it's useful.

@jtattermusch
Copy link
Contributor Author

I addressed the comments from Jon (thanks!) and added templates for generating the project.json files.

Currently, all the tests are passing under CoreCLR under linux, windows and mac (except the few tests that are disabled using conditional compilation when compiling under netstandard1.5).

At this stage, it seems the PR is worth integrating.

@stanley-cheung
Copy link
Contributor

LGTM

@jtattermusch
Copy link
Contributor Author

tests.tools/buildgen/generate_projects.sh failure in sanity tests is unrelated (seen and fixed on master).

@jtattermusch jtattermusch merged commit cfce066 into grpc:master Jun 22, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 27, 2019
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.

6 participants