thrift icon indicating copy to clipboard operation
thrift copied to clipboard

Add cmake support for C# netstd

Open emmenlau opened this issue 4 years ago • 13 comments

This PR adds cmake support for the C# netstd implementation. The major changes are only in cmake and in the Visual Studio project files. The actual build is executed via dotnet (which has to be installed). cmake only orchestrates the build and can install the build artifacts.

A major change is that this PR fixes issue https://issues.apache.org/jira/browse/THRIFT-5143 for me. The required change is that the Thrift build for netstandard 2.0 can not be mixed and mingled with application builds for netstandard 2.0 or .net Framework, due to a missing dependency to reference assembly System.Threading.Tasks.Extensions, Version=4.2.0.1. This can be resolved by referencing the Thrift library artifact instead of the Thrift project file. See the Jira issue for a more detailed discussion.

I've tested the build on Windows, macOS and Linux successfully.

  • [ ] Did you create an Apache Jira ticket? (not required for trivial changes)
  • [ ] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • [x] Did you squash your changes to a single commit? (not required, but preferred)
    • Full cmake support is in a single commit. There are two other, minor changes to C# code in two other commits in this same PR.
  • [x] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • [x] If your change does not involve any code, add [skip ci] at the end of your pull request to free up build resources.

emmenlau avatar Apr 24 '20 16:04 emmenlau

+1 LGTM but not tested.

Except of course that CI is all red.

Do we need to update documents (like *md) maybe?

Jens-G avatar Apr 25 '20 13:04 Jens-G

The problem with the CI is not easily fixed for me. The issue comes from the fact that the autotools build does not resolve the dependency between tests and the Thrift library in the same way as I encoded it in cmake. A solution would be to encode these inter-dependencies in Thrift.sln.

But sadly I'm not knowledgeable enough in Visual Studio or autotools to fix either of these. Can someone help? If not, I guess this PR will need to wait...

emmenlau avatar Apr 27 '20 09:04 emmenlau

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 29 '20 08:08 stale[bot]

.

Jens-G avatar Aug 29 '20 09:08 Jens-G

This issue is no longer stale. Thank you for your contributions.

stale[bot] avatar Aug 29 '20 09:08 stale[bot]

Rebase still needed

Jens-G avatar Oct 01 '20 20:10 Jens-G

It looks like broken the automake for C# netstd,too.

zeshuai007 avatar Oct 24 '20 07:10 zeshuai007

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 25 '20 11:12 stale[bot]

This issue is no longer stale. Thank you for your contributions.

stale[bot] avatar Feb 12 '21 18:02 stale[bot]

Updated to latest master, and various minor issues fixed.

emmenlau avatar Feb 12 '21 18:02 emmenlau

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 17:04 stale[bot]

I'm generally positive about using CMake so I can only repeat my +1.

PS: What does not make me happy is to maintain two build systems, but that's not really the topic here.

Jens-G avatar Apr 16 '22 17:04 Jens-G

This issue is no longer stale. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 17:04 stale[bot]