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

GH1540: Update to latest Roslyn #1645

Merged
merged 5 commits into from
Jul 29, 2017
Merged

GH1540: Update to latest Roslyn #1645

merged 5 commits into from
Jul 29, 2017

Conversation

patriksvensson
Copy link
Member

@patriksvensson patriksvensson commented Jun 14, 2017

This PR will do the following:

  • Update all projects to target net462 instead of net45
  • Update Roslyn to the latest version
  • Remove old Roslyn (regular and experimental)
  • Remove the Mono scripting engine
  • Unify script engine between full framework and .net core
  • Make it build on CI again
  • Add loading assembly from stream for debugging purposes (see AssemblyLoader).
  • Verify that debugging works on full framework and .NET Core
  • Clean up the code a bit

@patriksvensson patriksvensson changed the title [WIP] Update to latest Roslyn [WIP] GH1540: Update to latest Roslyn Jun 14, 2017
build/paths.cake Outdated
@@ -26,7 +26,7 @@ public class BuildPaths
var buildDir = context.Directory("./src/Cake/bin") + context.Directory(configuration);
var artifactsDir = (DirectoryPath)(context.Directory("./artifacts") + context.Directory("v" + semVersion));
var artifactsBinDir = artifactsDir.Combine("bin");
var artifactsBinNet45 = artifactsBinDir.Combine("net45");
var artifactsBinNet45 = artifactsBinDir.Combine("net462");
Copy link
Member

Choose a reason for hiding this comment

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

Also change variable name to artifactsBinNet462

@devlead
Copy link
Member

devlead commented Jun 26, 2017

@cake-build/cake-team I've removed some unused variables in path.cake and added so chocolatey/desktop CLR nuget content isn't hard coded any more. so we'll need to test so those still include all's that needed.

@devlead
Copy link
Member

devlead commented Jul 17, 2017

@cake-build/cake-team I've sorted the merge conflicts and rebased against latest develop.

@gep13
Copy link
Member

gep13 commented Jul 19, 2017

Relates to #1540

@patriksvensson patriksvensson dismissed bjorkstromm’s stale review July 23, 2017 23:05

For some reason GitHub won't "see" that the changes has been made.

@patriksvensson
Copy link
Member Author

@mholo65 Did you have a fix for the debugging that we could use?

@bjorkstromm
Copy link
Member

@patriksvensson only the AppDomain.AssemblyResolve fix, but that feels wrong. IMO we need to investigate further and ask some help from Roslyn team. How is it working with CoreCLR debugging, same thing there?

@patriksvensson
Copy link
Member Author

@mholo65 Not sure, and I won't have time to do anything with this PR until the weekend soonest.

@bjorkstromm
Copy link
Member

@patriksvensson Ok! I'll see what I can do!

@bjorkstromm
Copy link
Member

Seems to hit the FileNotFoundException when referencing addins and debugging. Will investigate further, trying to create a minimal repro and then contact Roslyn team if I can't figure it out myself.

Also, I seem to hit same exception when debugging with Cake.CoreCLR version 0.21.1. Could anyone of you verify this?

@filipw
Copy link

filipw commented Jul 24, 2017

you might consider going straight for Roslyn 3 (nightly) and avoid hand-rolled debugging code altogether 🙂 dotnet/roslyn#16489

@filipw
Copy link

filipw commented Jul 24, 2017

actually, I forgot - that made it into Roslyn 2.3.0 already

@bjorkstromm
Copy link
Member

@filipw thanks for the heads up! @patriksvensson we should update to 2.3.x and check that out!

@bjorkstromm
Copy link
Member

@filipw got any examples for using the API? Will have a look at it tonight!

@gep13
Copy link
Member

gep13 commented Jul 24, 2017

@mholo65 said...
Could anyone of you verify this?

As discussed on slack, i have been able to verify this is happening.

@filipw
Copy link

filipw commented Jul 24, 2017

@mholo65 try here https://github.com/filipw/dotnet-script/blob/master/src/Dotnet.Script.Core/ScriptCompiler.cs#L53

{
_options = options;
_nightlyFactory = nightlyFactory;
_stableFactory = stableFactory;
_loader = loader;
_log = log;
}

public IScriptSession CreateSession(IScriptHost host, IDictionary<string, string> arguments)
Copy link
Member

Choose a reason for hiding this comment

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

While we are at it breaking stuff. Maybe we should remove arguments from the interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree! 👍

@bjorkstromm
Copy link
Member

Roslyn now updated and debugging works. Unified the sessions also.

Thanks again @filipw for pointing us in the right direction!

@filipw
Copy link

filipw commented Jul 24, 2017

great! 🎉

@patriksvensson
Copy link
Member Author

@cake-build/cake-team OK! I think this PR is ready to be merged. Do you mind taking a look at it and also take it for a final spin if you have time.

Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

Just one thing...

@@ -166,16 +166,6 @@ private bool ParseOption(string name, string value, CakeOptions options)
options.PerformDebug = ParseBooleanValue(value);
}

if (name.Equals("mono", StringComparison.OrdinalIgnoreCase))
Copy link
Member

Choose a reason for hiding this comment

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

@patriksvensson @mholo65 I am not sure if these should be removed completely. I think we should deprecate these commands. i.e. leave them in just now, but have them only emit an error that the Mono scripting engine has been removed with an explanation as to why. Then in a future version, we can remove them completely. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removing them won't break anything afaik.

@patriksvensson
Copy link
Member Author

Copy link
Member

@agc93 agc93 left a comment

Choose a reason for hiding this comment

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

With the new warning in place, LGTM at least 👍

Copy link
Member

@bjorkstromm bjorkstromm left a comment

Choose a reason for hiding this comment

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

LGTM! Could we also start integration tests on this branch prior to merging?

@devlead
Copy link
Member

devlead commented Jul 26, 2017

@mholo65 triggered an integration test on Ubuntu with Bitrise now.

@patriksvensson
Copy link
Member Author

@gep13 Not sure why, but your review doesn't seem to close although the changes has been addressed.

@gep13
Copy link
Member

gep13 commented Jul 28, 2017

@patriksvensson fixed

@patriksvensson
Copy link
Member Author

@gep13 Thanks!
@devlead What was the result of the integration test?

@devlead
Copy link
Member

devlead commented Jul 28, 2017

@patriksvensson it didn't complete but don't think it's a PR issue will try to get them to rerun

build.cake Outdated
VersionSuffix = parameters.Version.DotNetAsterix,
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.ArtifactsBinNet45,
OutputDirectory = parameters.Paths.Directories.ArtifactsBinFullFx,
Verbosity = DotNetCoreVerbosity.Minimal
Copy link
Member

Choose a reason for hiding this comment

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

@patriksvensson Currently getting an error with copy files on Linux

/usr/share/dotnet/sdk/1.0.4/Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/cake/src/Cake/Cake.csproj]
An error occurred when executing task 'Copy-Files'.

Adjusting copy files task like below seems to sort it

    // .NET 4.6.2
    DotNetCorePublish("./src/Cake", new DotNetCorePublishSettings
    {
        Framework = "net462",
        VersionSuffix = parameters.Version.DotNetAsterix,
        Configuration = parameters.Configuration,
        OutputDirectory = parameters.Paths.Directories.ArtifactsBinFullFx,
-        Verbosity = DotNetCoreVerbosity.Minimal,
+       MSBuildSettings = msBuildSettings
    });

    // .NET Core
    DotNetCorePublish("./src/Cake", new DotNetCorePublishSettings
    {
        Framework = "netcoreapp1.0",
        Configuration = parameters.Configuration,
        OutputDirectory = parameters.Paths.Directories.ArtifactsBinNetCore,
-        Verbosity = DotNetCoreVerbosity.Minimal,
+       MSBuildSettings = msBuildSettings
    });

Copy link
Member

@devlead devlead left a comment

Choose a reason for hiding this comment

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

LGTM now, but think we should rebase and squash a few commits before the final review & merge

@bjorkstromm
Copy link
Member

Squash is Ok as long as individual authors changes are kept intact. I.e. Should be squashed to 4 or 5 commits.

@devlead
Copy link
Member

devlead commented Jul 29, 2017

Squash is Ok as long as individual authors changes are kept intact. I.e. Should be squashed to 4 or 5 commits.

@mholo65 agreed 👍

patriksvensson and others added 5 commits July 29, 2017 18:41
* Updated projects to net462.
* Cleaned up the project files.
* Removed old versions of Roslyn.
* Removed Mono scripting engine.
* Added Roslyn script engine for full fx.
* Removed unused build script variables.
* Cleaned up the build script.
* Update Roslyn to 2.3.1.
* Use standardized way of emitting debug symbols for debug build.
* Unify script sessions.
* Removed Mono.CSharp from license information.
* Removed Roslyn NuGet source constant.
* Added release notes for libraries.
* Do not run integration tests with mono flag anymore.
* Added warning when trying to use the Mono script engine.
* Use MSBuild settings with 'dotnet publish' command.
Copy link
Member

@devlead devlead left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member

@bjorkstromm bjorkstromm left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Successfully merging this pull request may close these issues.

8 participants