-
Notifications
You must be signed in to change notification settings - Fork 265
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
Migrate to .NET Core #778
Closed
Closed
Migrate to .NET Core #778
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR builds on top of #773 to allow referencing the .NET Core boogie dependencies more easily.
Changes
Mono.Cecil
since it is no longer needed.Source/Dafny/cce.cs
in favor of this Boogie version which seems slightly better. This solves ambiguous references that occurred in the .NET Core build. It's not clear why didn't occur before.ModelViewer
package from Boogie, which is used byDafnyServer
has not been ported to .NET Core, and I assume it can not be because it uses .NET framework libraries. It's unclear whether theModelViewer
package has a future in Boogie, since they want to get rid of their .NET framework support altogether. The files used fromModelViewer
have been copied intoDafnyServer
to resolve the issue.CompileTargetProgram
method inCompiler-CSharp.cs
so it uses Roslyn'sMicrosoft.CodeAnalysis.CSharp
to Compile C#, because the existing method of compiling withSystem.CodeDom
throws a platform not supported exception for Ubuntu in .NET Core. See this thread for more information.dotnet run
to get a platform independent way to run, instead of using Mono to runDafny.exe
.Caveats
No more .NET Framework support
This PR adds support for the .NET Core framework but removes it for the .NET framework. Supporting both platforms at the same time would be difficult, since this PR contains source level changes. To support both platforms at the same time we'd have to duplicate some files and customize each platform to use the right file, but in that case I would suggest considering a fork for .NET Framework support.
Building Boogie
Building Boogie Core 2.4.21 is a pain! The following problems occur, all because of GitVersionTask:
The above problems can all be solved with some small manual actions, but it's not great asking Dafny devs to perform those steps as part of setting up their Dafny dev environment.
My recommendation is that we can create a Boogie fork that does not have GitVersionTask, so Boogie can be built without manual steps. I would create the boogie fork in the
dafny-lang
org but I don't have the permissions for that. It would only be a temporary fork until we start consuming Boogie from NuGet.Alternatively, we can add a script to Dafny to perform these actions.
TestAttribute
The
dafny\Test\DafnyTests\TestAttribute.dfy
test has been turned off because it calls the NuGet package dafny.msbuild which doesn't work with .NET Core. I'm not sure what that NuGet package is for, where it's built from, and what this test is trying to test, so I'm not sure how to proceed.Testing
MSBUILDSINGLELOADCONTEXT=1
that is required for GitVersionTask. I will try to resolve this, but it's also solved by the above suggestion of using a Boogie fork without GitVersionTask.