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

Add LangVersion 7.2 for C# #19846

Merged
merged 1 commit into from
May 31, 2017
Merged

Add LangVersion 7.2 for C# #19846

merged 1 commit into from
May 31, 2017

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented May 29, 2017

@dotnet/roslyn-compiler for review (15.6).

@jcouv
Copy link
Member Author

jcouv commented May 30, 2017

microbuild_prtest failed with a connection failure (details). I will retest.

09:37:03 GitHub pull request #19846 of commit 2eaede586e424d6bde146f0c0f44c812dcf2e4b8, no merge conflicts.
09:37:03 Notifying endpoint with id 'HTTP:helix-int-notification-url'
09:52:12 ERROR: Failed to notify endpoint with id 'HTTP:helix-int-notification-url'
09:52:12 
hudson.remoting.RequestAbortedException: java.io.IOException: Connection aborted: org.jenkinsci.remoting.nio.NioChannelHub$MonoNioTransport@6c2d6432[name=win201-76cf11]
09:52:12 	at hudson.remoting.Request.abort(Request.java:303)
09:52:12 	at hudson.remoting.Channel.terminate(Channel.java:863)
09:52:12 	at hudson.remoting.Channel$1.terminate(Channel.java:509)
09:52:12 	at hudson.remoting.AbstractByteArrayCommandTransport$1.terminate(AbstractByteArrayCommandTransport.java:71)
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub$NioTransport.abort(NioChannelHub.java:208)
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:629)
09:52:12 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
09:52:12 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
09:52:12 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09:52:12 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
09:52:12 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
09:52:12 	at java.lang.Thread.run(Thread.java:748)
09:52:12 	at ......remote call to win201-76cf11(Native Method)
09:52:12 	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1433)
09:52:12 	at hudson.remoting.Request.call(Request.java:172)
09:52:12 	at hudson.remoting.Channel.call(Channel.java:796)
09:52:12 	at hudson.EnvVars.getRemote(EnvVars.java:405)
09:52:12 	at hudson.model.Computer.getEnvironment(Computer.java:1152)
09:52:12 	at jenkins.model.CoreEnvironmentContributor.buildEnvironmentFor(CoreEnvironmentContributor.java:30)
09:52:12 	at hudson.model.Run.getEnvironment(Run.java:2241)
09:52:12 	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
09:52:12 	at com.tikal.hudson.plugins.notification.Phase.buildJobState(Phase.java:80)
09:52:12 	at com.tikal.hudson.plugins.notification.Phase.handle(Phase.java:42)
09:52:12 	at com.tikal.hudson.plugins.notification.JobListener.onStarted(JobListener.java:31)
09:52:12 	at hudson.model.listeners.RunListener.fireStarted(RunListener.java:240)
09:52:12 	at hudson.model.Run.execute(Run.java:1716)
09:52:12 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
09:52:12 	at hudson.model.ResourceController.execute(ResourceController.java:98)
09:52:12 	at hudson.model.Executor.run(Executor.java:404)
09:52:12 Caused by: java.io.IOException: Connection aborted: org.jenkinsci.remoting.nio.NioChannelHub$MonoNioTransport@6c2d6432[name=win201-76cf11]
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub$NioTransport.abort(NioChannelHub.java:208)
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:629)
09:52:12 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
09:52:12 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
09:52:12 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09:52:12 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
09:52:12 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
09:52:12 	at java.lang.Thread.run(Thread.java:748)
09:52:12 Caused by: java.io.IOException: Connection timed out
09:52:12 	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
09:52:12 	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
09:52:12 	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
09:52:12 	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
09:52:12 	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
09:52:12 	at org.jenkinsci.remoting.nio.FifoBuffer$Pointer.receive(FifoBuffer.java:137)
09:52:12 	at org.jenkinsci.remoting.nio.FifoBuffer.receive(FifoBuffer.java:310)
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:561)
09:52:12 	... 6 more
09:52:12 Failed to notify endpoint with id 'HTTP:helix-int-notification-url' - hudson.remoting.RequestAbortedException: java.io.IOException: Connection aborted: org.jenkinsci.remoting.nio.NioChannelHub$MonoNioTransport@6c2d6432[name=win201-76cf11]
09:52:12 Notifying endpoint with id 'HTTP:helix-prod-notification-url'
09:52:12 ERROR: Failed to notify endpoint with id 'HTTP:helix-prod-notification-url'
09:52:12 hudson.remoting.ChannelClosedException: channel is already closed
09:52:12 	at hudson.remoting.Channel.send(Channel.java:578)
09:52:12 	at hudson.remoting.Request.call(Request.java:130)
09:52:12 	at hudson.remoting.Channel.call(Channel.java:796)
09:52:12 	at hudson.EnvVars.getRemote(EnvVars.java:405)
09:52:12 	at hudson.model.Computer.getEnvironment(Computer.java:1152)
09:52:12 	at jenkins.model.CoreEnvironmentContributor.buildEnvironmentFor(CoreEnvironmentContributor.java:30)
09:52:12 	at hudson.model.Run.getEnvironment(Run.java:2241)
09:52:12 	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
09:52:12 	at com.tikal.hudson.plugins.notification.Phase.buildJobState(Phase.java:80)
09:52:12 	at com.tikal.hudson.plugins.notification.Phase.handle(Phase.java:42)
09:52:12 	at com.tikal.hudson.plugins.notification.JobListener.onStarted(JobListener.java:31)
09:52:12 	at hudson.model.listeners.RunListener.fireStarted(RunListener.java:240)
09:52:12 	at hudson.model.Run.execute(Run.java:1716)
09:52:12 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
09:52:12 	at hudson.model.ResourceController.execute(ResourceController.java:98)
09:52:12 	at hudson.model.Executor.run(Executor.java:404)
09:52:12 Caused by: java.io.IOException: Connection aborted: org.jenkinsci.remoting.nio.NioChannelHub$MonoNioTransport@6c2d6432[name=win201-76cf11]
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub$NioTransport.abort(NioChannelHub.java:208)
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:629)
09:52:12 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
09:52:12 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
09:52:12 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
09:52:12 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
09:52:12 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
09:52:12 	at java.lang.Thread.run(Thread.java:748)
09:52:12 Caused by: java.io.IOException: Connection timed out
09:52:12 	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
09:52:12 	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
09:52:12 	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
09:52:12 	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
09:52:12 	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
09:52:12 	at org.jenkinsci.remoting.nio.FifoBuffer$Pointer.receive(FifoBuffer.java:137)
09:52:12 	at org.jenkinsci.remoting.nio.FifoBuffer.receive(FifoBuffer.java:310)
09:52:12 	at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:561)
09:52:12 	... 6 more
09:52:12 Failed to notify endpoint with id 'HTTP:helix-prod-notification-url' - hudson.remoting.ChannelClosedException: channel is already closed
09:52:12 Notifying endpoint with id 'HTTP:legacy-notification-url'
09:52:13 Setting status of 2eaede586e424d6bde146f0c0f44c812dcf2e4b8 to PENDING with url https://ci.dot.net/job/dotnet_roslyn/job/dev15.6/job/microbuild_prtest/90/ and message: 'Started.'
09:52:13 Using context: microbuild_prtest
09:52:13 FATAL: null
09:52:13 java.lang.NullPointerException
09:52:13 [Current build status] check if current [FAILURE] is worse or equals then [ABORTED] and better or equals then [FAILURE]

@jcouv
Copy link
Member Author

jcouv commented May 30, 2017

retest microbuild_prtest please

@@ -120,6 +126,8 @@ internal static ErrorCode GetErrorCode(this LanguageVersion version)
return ErrorCode.ERR_FeatureNotAvailableInVersion7;
case LanguageVersion.CSharp7_1:
return ErrorCode.ERR_FeatureNotAvailableInVersion7_1;
case LanguageVersion.CSharp7_2:
return ErrorCode.ERR_FeatureNotAvailableInVersion7_2;
Copy link
Contributor

@AlekseyTs AlekseyTs May 30, 2017

Choose a reason for hiding this comment

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

ERR_FeatureNotAvailableInVersion7_2 [](start = 37, length = 35)

What is the benefit of having an error code per version? It looks like we could easily use one parameterized error message. In fact, for some features in some situations we do this (use parameterized error message) when these errors cannot be used. #Closed

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd raised that question before. Someone (maybe Vlad or Neal) had previously suggested this helps telemetry.
Filed follow-up issue #19871

Copy link
Member Author

Choose a reason for hiding this comment

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

Dug up the telemetry comment (from Cyrus): #17435 (comment)

@CyrusNajmabadi Could you expand on why separate error codes and diagnostics is preferable for LanguageVersion, rather than one parameterized set?

Copy link
Member

Choose a reason for hiding this comment

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

My telemetry comment was about you instantiating SolutionChangeAction directly. You need to create a subclass of that.

I do not care if you use a single diagnostic ID or different diagnostic IDs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the clarification.

I have a follow-up issue to use a generic diagnostic ID.
@AlekseyTs Any other feedback?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @gafter was the person who pointed out the telemetry issue to me. He can confirm if that is still an issue or not.

@AlekseyTs
Copy link
Contributor

AlekseyTs commented May 30, 2017

Done with review pass. #Closed

Conflicts:
	src/Compilers/CSharp/Portable/CSharpResources.resx
	src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
@jcouv
Copy link
Member Author

jcouv commented May 30, 2017

Rebased to resolve conflicts.
@dotnet/roslyn-compiler for a second review. Thanks

@@ -120,6 +126,8 @@ internal static ErrorCode GetErrorCode(this LanguageVersion version)
return ErrorCode.ERR_FeatureNotAvailableInVersion7;
case LanguageVersion.CSharp7_1:
return ErrorCode.ERR_FeatureNotAvailableInVersion7_1;
case LanguageVersion.CSharp7_2:
return ErrorCode.ERR_FeatureNotAvailableInVersion7_2;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @gafter was the person who pointed out the telemetry issue to me. He can confirm if that is still an issue or not.

@@ -1488,5 +1488,9 @@ internal enum ErrorCode
ERR_PatternWrongGenericTypeInVersion = 8314,

#endregion diagnostics introduced for C# 7.1

#region diagnostics introduced for C# 7.2
ERR_FeatureNotAvailableInVersion7_2 = 8320,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is going into master, and there are no concers of conflicts, we can just use 8315?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is going into 15.6 branch. 7.1 is not closed yet, so I left some buffer. (Just today I had to use a new error code for a 7.1 fix).

@@ -2705,7 +2705,7 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
<value>This warning occurs if the assembly attributes AssemblyKeyFileAttribute or AssemblyKeyNameAttribute found in source conflict with the /keyfile or /keycontainer command line option or key file name or key container specified in the Project Properties.</value>
</data>
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to do a string search/replace over the modified error strings in the tests project, to make sure that the error comments in tests are updated as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

The resource strings I modified do not exist in tests. But I do have a test to extract the versions that appear on that line and verifies that it's complete: https://github.com/dotnet/roslyn/pull/19113/files#diff-492ea20f4ae7785ece041adfb13b4e7d

@OmarTawfik
Copy link
Contributor

Approved, suggesting that this is accompanied by the project system PR as well.

@jcouv
Copy link
Member Author

jcouv commented May 30, 2017

Thanks for the reminder. I'm starting on the project-system change.

@jcouv
Copy link
Member Author

jcouv commented May 31, 2017

Here's the project system change to add the drop-down entry in Settings page: dotnet/project-system#2334

image

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM

@jcouv
Copy link
Member Author

jcouv commented May 31, 2017

VS integration tests failed on Roslyn.VisualStudio.IntegrationTests.CSharp.CSharpCodeActions.FastDoubleInvoke (details)>

@dotnet/roslyn-infrastructure FYI. I'll re-run this leg.

@jcouv
Copy link
Member Author

jcouv commented May 31, 2017

@dotnet-bot retest windows_release_vs-integration_prtest please

@jcouv jcouv merged commit c5d9858 into dotnet:dev15.6 May 31, 2017
@jcouv jcouv deleted the langver-72 branch May 31, 2017 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants