-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
@khyperia, |
@@ -23,8 +23,10 @@ internal class MSBuildForwardingAppWithoutLogging | |||
new Dictionary<string, string> | |||
{ | |||
{ "MSBuildExtensionsPath", AppContext.BaseDirectory }, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
// otherwise grab it from the environment | ||
path = System.Environment.GetEnvironmentVariable("PATH"); | ||
} |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
// otherwise, join it with the rest of the path, | ||
// putting it in front so it takes priority | ||
path = containingDirectory + Path.PathSeparator + path; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -200,41 +198,72 @@ | |||
Condition=" '$(DISABLE_CROSSGEN)' == '' " | |||
AfterTargets="PublishMSBuildExtensions"> | |||
<ItemGroup> | |||
<RoslynFiles Include="$(PublishDir)Roslyn\bincore\**\*" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
// this means that the up-to-date dotnet command is resolved by the | ||
// old-runtime-targeting RunCsc/Roslyn, causing compatability issues. | ||
// So, detect if we're running a dotnet that's not just a plain "dotnet", | ||
// and if so, make sure it's on the PATH. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
build/DependencyVersions.props
Outdated
@@ -4,7 +4,6 @@ | |||
<CLI_SharedFrameworkVersion>2.0.0</CLI_SharedFrameworkVersion> | |||
<CLI_MSBuild_Version>15.3.409</CLI_MSBuild_Version> | |||
<CLI_Roslyn_Version>2.3.2-beta1-61921-05</CLI_Roslyn_Version> | |||
<CLI_Roslyn_Satellites_Version>2.3.0-pre-20170624-6</CLI_Roslyn_Satellites_Version> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This is related to dotnet/cli#7311
string path; | ||
if (!Environment.TryGetValue("PATH", out path)) | ||
{ | ||
// otherwise grab it from the environment |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
string path; | ||
if (!Environment.TryGetValue("PATH", out path)) | ||
{ | ||
// otherwise grab it from the environment |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Note that in the latest commit, I had to bump the Roslyn version to Additionally, I rebased this PR to current CLI master, as it was getting kind of stale (especially for fast-moving areas like insertion of external APIs). |
Also, I think the |
I really don't like the comments. I may refactor it later
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.
Don't we need to set DOTNET_HOST_PATH
at some point before dotnet build
?
Just tested locally, this is the basic repro of the error. It seems that some of the runtime-swapping behavior the CLI packaging is doing is not valid on OSX. Advice on how to resolve this would be appreciated.
(for completeness, the same command works fine in the normal
|
Update on the As such, leaving the setting of An initial sketch for how it could be fixed:
This solution also allows subcommands that are not the CLI (such as Roslyn) to use Suggestions for what
|
I've filed #7396 for the issue where |
{A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU | ||
{A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x64.Build.0 = Release|Any CPU | ||
{A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU | ||
{A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x86.Build.0 = Release|Any CPU |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
https://github.com/dotnet/cli/issues/7396#issuecomment-321389629 |
@nguerrera Could you give advice on what you meant by:
(or more specifically, where exactly should we be setting |
The goal of this PR is meant to make it easier for us to insert Roslyn packages. It seems like we're pushing it to make the underlying scripts more reliable, implement features that don't yet exist, etc ... I'd prefer we keep this PR focussed on the goal: simplifying insertion. This is just one step in the larger effort of making the C# experience in CLI better. I agree with the principle behind many of the suggestions around abstracting out host. But that should be tackled in a different PR (in particular because we need a design that takes into account the broader picture like Mono). |
@jaredpar I don't disagree with that at all. My only concern is that we don't regress things. If we're having to set something in tests, but don't make the same arrangement in the product, then we risk a backwards step. If I've understood correctly, the steps at https://github.com/dotnet/cli/issues/7396#issuecomment-321389629 would start to fail if we just merge as-is. I'm giving some thought to the most tactical fix to keep things moving in the right direction and I will reply back in a bit on it. |
I think the simplest approach would be to set DOTNET_HOST_PATH where we set CscToolExe to the script that we're expecting to honor DOTNET_HOST_PATH if present: https://github.com/dotnet/cli/pull/7311/files#diff-5f48ce6cbfb26992402a6c8044d370c9. To obtain it, I think we should use My more long term thinking was that the native booting process would simply set DOTNET_HOST_PATH and we wouldn't have to do anything in CLI. I will open a bug on core-setup to discuss, but I'm fine with above to get this unblocked. It may well turn out to be a fine long term solution. |
Ping on this, could I have a review? (@nguerrera?) |
Made a PR to Roslyn to respect this (see above). I'll need to wait until that's merged and in a nuget package before updating this PR to match. |
be added to the TPA when we crossgen and we won't be able to crossgen tool_roslyn --> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(CLI_Roslyn_Version)" /> | ||
<PackageReference Include="Microsoft.NETCore.Compilers" Version="$(CLI_Roslyn_Version)"> | ||
<ExcludeAssets>All</ExcludeAssets> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ "CscToolExe", GetRunCscPath() }, | ||
{ "VbcToolExe", GetRunVbcPath() }, | ||
{ "MSBuildSDKsPath", GetMSBuildSDKsPath() } | ||
{ "CscToolPath", GetRunToolPath() }, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Roslyn nuget is updated with that change, so I've added a new commit here that updates that. Additionally, I have work in progress that allows the CLI to remove |
Looping @dotnet/msbuild in here: the changes with |
@nguerrera Rebased onto release/15.5 and changed the PR target to that. Obviously, existing comments are going to be broken, due to the rebase (took the opportunity to squash as well). Sorry about that. |
Re-asking - If we are targeting 15.5, would you like me to append the |
@khyperia are you working on porting the CscToolPath change to this PR? We need to get this change in today. |
Sorry, @livarcocc (was working on something else, didn't realize this was super high-pri). Hopefully that cherry-pick succeeds CI, I didn't do local testing at all. |
@nguerrera @livarcocc |
These failed due to my get, retrying... @dotnet-bot Test CentOS7.1 x64 Debug Build |
@dotnet-bot Test RHEL7.2 x64 Release Build |
Merging #7731 caused a merge conflict in |
Why the sudden urgency on this? |
Because this carries the roslyn that is inserted into 15.5 and this will be the CLI in 15.5. We don't really want them to mismatch, specially when the VS one will support more than the CLI one. |
@jaredpar, @khyperia FYI, dotnet/roslyn#22478 is why just bumping the roslyn version without taking this PR (as in #7734) didn't work. |
Is this change in a nuget package? (It's needed for my work on the cross-platform compiler server) |
@khyperia, it's not in a nuget package (because CLI doesn't ship as one), but you can grab a 15.5-preview build via installer or zip from https://github.com/dotnet/cli/tree/release/15.5#installers-and-binaries and it will have your changes. |
I think what I was actually asking for is a version number with this change in it (and I got mixed up with how Roslyn obtains things). Roslyn uses dotnet-install.ps1/sh so it'd be nice to see somehow which branches are what versions, or even just a list of versions that exist (I was using this as a source of version numbers, but I can't seem to find one with this change) |
15.5.0-preview-007082 is latest 15.5.x and should have this change. |
@nguerrera I was able to download the package for 15.5.0-preview-007082. |
Nevermind, the link above has the 15.5.0 installer: https://github.com/dotnet/cli/tree/release/15.5#installers-and-binaries Thanks! :-) |
In particular, use the Microsoft.NETCore.Compilers package, instead of manually patching together various bits.
This is the first part of work that will allow Roslyn to be more independent from CLI, and be able to implement optimizations and improve performance without having to coordinate with the CLI.
This PR may not be ready to merge, as the
RetargetRuntimeConfig
hack is not something that we would like to continue doing into the future (even though I believe we're already doing so today?). The fix for that depends on Microsoft.NETCore.Compilers using netcoreapp2.0, which I believe might not happen until 2.0 ships (@jaredpar likely could explain more on why that is, I'm not 100% sure on the reasoning). However, I wanted to start the code review process on other aspects of this change.A major change in this PR is changing the way crossgen works - before, we were crossgenning all assemblies simultaneously, with pulled-in packages allowing to stomp on each other's dependencies and change versions, etc.. This caused a lot of issues, especially with the new Roslyn bits. I have changed the way crossgenning works to crossgen batches of assemblies - where each batch is in its own isolated world, and cannot see assemblies from other batches. (At runtime, each "batch" is always in a separate process, so this is okay). The currently-defined batches are the F# dir, the Roslyn dir, and "everything else". F# gets a little complicated, since they have an assembly (
FSharp.Build.dll
) that is intended to be used by the process running in the "everything else" dir, and doesn't reference anything in the FSharp dir. (The way Roslyn handles this is having its Build.dll be in the root Roslyn folder, and then the out-of-proc compiler stuff is in thebincore
folder - so it's simple to just crossgen the bincore folder as a batch, and include the Roslyn dir in the "everything else" batch.)Ping @livarcocc, as they were included in the planning of this PR.