Skip to content

Conversation

@0x53A
Copy link
Contributor

@0x53A 0x53A commented Mar 14, 2018

Now that C# natively supports these access modifiers, we don't need to rely on a checked-in binary anymore.

@forki
Copy link
Contributor

forki commented Mar 14, 2018

AccessibilityTests.cs(14,27): error CS8107: Feature 'private protected' is not available in C# 7.0. Please use language version 7.2 or greater.

### SOURCE=FamOrAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamOrAssembly.fs
SOURCE=FamAndAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamAndAssembly_NoIVT.fs
### SOURCE=FamOrAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamOrAssembly_NoIVT.fs
### SOURCE=FamOrAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamOrAssembly.fs
Copy link

Choose a reason for hiding this comment

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

Can we not specify 7.2 explicit? Depending of the version of VS/MSBuild, latest could mean a version lower than 7.2 e.g. C# version 5 or 6.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes "latest" is not a good idea

Copy link
Member

Choose a reason for hiding this comment

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

Speaking with @KevinRansom we're OK with latest so long as CSC_PIPE is updated to use csc.exe from the NuGet dependency I added in #4023 (with the caveat that the C# package might need to be upgraded; I don't know when 7.2 features were added.)

Currently I think run.pl grabs a version of csc.exe from the PATH instead of the explicit package version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brettfo Should I just hardcode it in run.pl (then it would need to be adapted each time you update), or can it be passed down from somewhere?

Copy link
Member

Choose a reason for hiding this comment

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

Ideally something passed in, even if that passed in value is hard-coded in build.cmd.

Looking through the code you could add a hard-coded argument in build.cmd and then modify runall.pl to handle the new argument. I didn't immediately find a way to pass through a value to run.pl, but it appears to prefer an environment variable, so you could probably just do $ENV{CSC_PIPE} = $passedInPathToCsc; in runall.pl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be enough if I set CSC_PIPE from externally, right?

https://github.com/Microsoft/visualfsharp/blob/2d2104b1fce6ed0bae26695f28fb9913c9ff9bf5/tests/fsharpqa/Source/run.pl#L140-L143

Here it seems to read the env-var, and only defaults it to csc if it isn't already set.

Copy link
Member

Choose a reason for hiding this comment

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

Good call, simpler is better.

@brettfo
Copy link
Member

brettfo commented Mar 15, 2018

Good news is that the environment variable worked. Bad news is that either the C# syntax is wrong, the compiler is too old, or both. I don't know enough about the C# syntax to comment on that, but version 2.7.0 of Microsoft.Net.Compilers should be new enough for the added syntax.

Copy link
Member

@brettfo brettfo left a comment

Choose a reason for hiding this comment

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

I like the changes. @KevinRansom do you have any additional feedback?

@brettfo brettfo merged commit c87da60 into dotnet:master Mar 15, 2018
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.

4 participants