Skip to content

Allow individual project to override the default LangVersion settings #37498

Closed

Description

@cshung

Because of our collaboration with ILSpy, we need to make sure ILCompiler.Reflection.ReadyToRun do not use C# features that are not available in C# 7.3

This problem is not particularly severe, we had it just a couple of times in the past, such as #32460, or #37451.

It would be nice if we could fix the build so that the offending of that rule is caught at build time. However, because of a forceful setting in

<LangVersion>preview</LangVersion>

Make overriding the LangVersion in ILCompiler.Reflection.ReadyToRun.csproj does not work.

It is possible to fix by introducing a LangVersionOverride like this:

    <LangVersion Condition="'$(LangVersionOverride)' == ''">preview</LangVersion>
    <LangVersion Condition="'$(LangVersionOverride)' != ''">$(LangVersionOverride)</LangVersion>

Not being an MSBuild expert, I don't know what is the best practice.

This issue is meant to leave this problem to the experts.

Activity

  1. added
    untriaged
    on Jun 5, 2020
  2. Dotnet-GitSync-Bot commented on Jun 5, 2020

    @Dotnet-GitSync-Bot
    Collaborator

    I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

  3. added
    area-R2RDump-coreclr
    on Jun 5, 2020
  4. removed
    area-R2RDump-coreclr
    on Jun 5, 2020
  5. added a commit that references this issue on Jun 5, 2020
    d236faf
  6. added a commit that references this issue on Jun 8, 2020
    84abb55
  7. ghost locked as resolved and limited conversation to collaborators on Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Infrastructureuntriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions