Skip to content

React to Roslyn rename of NullableContextOptions to Nullable. #594

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

Merged
merged 2 commits into from
Jul 17, 2019

Conversation

NTaylorMullen
Copy link

@NTaylorMullen NTaylorMullen commented May 14, 2019

  • Verified the fix with VS16.2-preview1 + latest CLI with modified Nullable entry on disk
  • Updated tests.
  • Note: This change will not pass the build until we have a new CLI that has an updated Roslyn that understands Nullable.

dotnet/aspnetcore#10218

@rynowak
Copy link
Member

rynowak commented May 14, 2019

How exactly is this going to work? Are Roslyn changing this for preview 6? This means at some point anyone who wants to use the components/mvc solution will need to get onto 16.2

@natemcmaster
Copy link
Contributor

natemcmaster commented May 14, 2019 via email

@natemcmaster
Copy link
Contributor

@NTaylorMullen
Copy link
Author

@NTaylorMullen try applying this change to your PR: natemcmaster@b416204

Done, lets see if it builds 😄

@natemcmaster
Copy link
Contributor

FYI there is a new version of the compiler coming along soon. The next bot-PR which updates Arcade will have this. cref dotnet/arcade#2856

@rynowak
Copy link
Member

rynowak commented Jun 7, 2019

@NTaylorMullen - we should make this change at our earliest available point.

@NTaylorMullen
Copy link
Author

NTaylorMullen commented Jun 20, 2019

@aspnet/build looks like I need to wait for preview6 SDK to be in Arcade. Any update on that happening soon?

@dougbu
Copy link
Contributor

dougbu commented Jun 21, 2019

Turns out you should be able to use a newer SDK before then. @JunTaoLuo did you get the needed steps / doc from @markwilkie ?

@JunTaoLuo
Copy link
Contributor

Yes, in fact, it has already been applied. I have repro'ed this locally so I'm trying to see if I can figure out what's going on here.

@JunTaoLuo
Copy link
Contributor

JunTaoLuo commented Jun 21, 2019

I've resolved two issues: released preview 6 SDK does not have the compiler option rename NullableContext => Nullable, newer runtimes require a restore with Microsoft.NETCore.App.Host.{RID}.nupkg. The one remaining is that it seems like a different compiler is used for desktop apps? I see the following failures:

    Build_Components_WithDesktopMSBuild_Works [FAIL]
    Build_ProjectWithDependencyThatReferencesMvc_AddsAttribute_WhenBuildingUsingDesktopMsbuild [FAIL]
    Build_SimpleMvc_WithServer_UsingDesktopMSBuild_CanBuildSuccessfully [FAIL]
    Build_SimpleMvc_UsingDesktopMSBuildAndWithoutBuildServer_CanBuildSuccessfully [FAIL]
    Build_SimpleMvc_UsingDesktopMSBuildAndWithoutBuildServer_CanBuildSuccessfully [FAIL]

And they have the signature:

 "C:\Users\vsagent\AppData\Local\Temp\Razor\x1ejfjii.lfs\MvcWithComponents\MvcWithComponents.csproj" (Restore;Build target) (1) ->
      (WarnForExplicitVersions target) -> 
        F:\workspace\_work\1\s\.dotnet\sdk\3.0.100-preview7-012517\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(192,5): warning NETSDK1071: A PackageReference to 'Microsoft.NETCore.App' specified a Version of `3.0.0-preview7-27819-07`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs [C:\Users\vsagent\AppData\Local\Temp\Razor\x1ejfjii.lfs\MvcWithComponents\MvcWithComponents.csproj]
      
      
      "C:\Users\vsagent\AppData\Local\Temp\Razor\x1ejfjii.lfs\MvcWithComponents\MvcWithComponents.csproj" (Restore;Build target) (1) ->
      (RazorCompileComponentDeclaration target) -> 
        F:\workspace\_work\1\s\src\Razor\src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.Component.targets(224,10): error MSB4064: The "Nullable" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property. [C:\Users\vsagent\AppData\Local\Temp\Razor\x1ejfjii.lfs\MvcWithComponents\MvcWithComponents.csproj]
        F:\workspace\_work\1\s\src\Razor\src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.Component.targets(189,5): error MSB4063: The "Csc" task could not be initialized with its input parameters.  [C:\Users\vsagent\AppData\Local\Temp\Razor\x1ejfjii.lfs\MvcWithComponents\MvcWithComponents.csproj]
      
          1 Warning(s)
          2 Error(s)
      
      Time Elapsed 00:00:17.04

@NTaylorMullen can you take a look? I might be able to help out tomorrow if needed, but I'll let you take the first stab at it.

@NTaylorMullen
Copy link
Author

released preview 6 SDK does not have the compiler option rename NullableContext => Nullable

Oh damn that's nuts. That means Roslyn inserted a different version into VS for preview6 than exists in the CLI. This is a non-starter for this release then. We don't want to move AspNetCore all the way up to using preview7 bits but that's what this PR would require for both repos. I'll postpone this until preview7 is released and we've moved both our repos to preview7.

@JunTaoLuo Really appreciate your help looking into this, saved us from catastrophic failure 😉.

@JunTaoLuo
Copy link
Contributor

Double check the Roslyn version in VS and CLI, I'm surprised that they inserted different versions.

@NTaylorMullen
Copy link
Author

Double check the Roslyn version in VS and CLI, I'm surprised that they inserted different versions.

It's possible they inserted a preview7 flavor into VS; however, I do know they inserted it because we were exploding VS without their fix 😄

@rynowak
Copy link
Member

rynowak commented Jul 15, 2019

@NTaylorMullen - should this be closed?

@NTaylorMullen
Copy link
Author

@NTaylorMullen - should this be closed?

Nope, waiting for preview7 to be released and then for this repo to consume the preview7 sdk.

- Verified the fix with VS16.2-preview2 + latest CLI with modified `Nullable` entry on disk
- Updated tests.
- Note: This change will not pass the build until we have a new CLI that has an updated Roslyn that understands `Nullable`.

dotnet/aspnetcore#10218
@NTaylorMullen NTaylorMullen force-pushed the nimullen/10218 branch 2 times, most recently from 679bcae to be0b794 Compare July 16, 2019 21:51
- This is a temporary workaround until we're able to get on the latest SDK which includes the latest Roslyn bits. Without them we can't properly publish testapps in a standalone fashion without investing in temporary infrastructure.
@@ -38,4 +38,26 @@

<Import Project="After.Directory.Build.props" Condition="Exists('After.Directory.Build.props')" />

<!--
NOTE, BELOW
Copy link
Author

@NTaylorMullen NTaylorMullen Jul 17, 2019

Choose a reason for hiding this comment

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

@pranavkm This entire commit was the reason why the test apps weren't publishing/running properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't these settings coming from /Directory.Build.targets and /eng/Versions.props -- at least indirectly? The Roslyn version there gets updated daily if there are new packages available.

Copy link
Author

Choose a reason for hiding this comment

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

We don't have access to either of those when these apps are tested (they're published to a temp directory).

I could have written logic in the test project to harvest that info but it was a bit more complex than I felt was warranted given all of this is temporary. Once we get a preview 7 SDK I'll delete all of this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not delete this logic or something that solves the problem without breaking automatic updates. The preview 7 SDK represents a temporary point of time when the Roslyn version aligns.

I'm wondering if this is a problem something in the AspNetCore repo has already solved in its test infrastructure. Probably worth asking around…

NOTE, BELOW

These bits are a temporary workaround until we're able to get on the latest SDK which includes the latest Roslyn bits.
Without them we can't properly publish testapps in a standalone fashion without investing in temporary infrastructure.
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be a temporary fix. Should always test against the Roslyn version that will ship with the rest of the release.

The SDK isn't relevant in this case either. We have no plans to rev the .NET SDK faster than it is released. While a lot of our build infrastructure is about building and using what's coming in that release, the SDK itself has to stay back.

Copy link
Author

Choose a reason for hiding this comment

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

Of course, this is blocking several repos though. Getting in this hack to unblock that.

Copy link
Author

Choose a reason for hiding this comment

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

Filed an issue to track "doing the right thing": dotnet/aspnetcore#12268

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.

5 participants