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

Fixes: #4822 --- Support for arbitrary value in AssemblyInformationalVersionAttribute #5336

Merged
merged 5 commits into from
Jul 18, 2018

Conversation

KevinRansom
Copy link
Member

@KevinRansom KevinRansom commented Jul 12, 2018

Fix: #4822, #5052
The F# compiler erroneously validated that the AssemblyInformationalVersionAttribute started with a Version number.

This changes relaxes that requirement.

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.

In our own code we've suppressed this warning, can you update this line?

@KevinRansom
Copy link
Member Author

@brettfo can you take another look.

@KevinRansom KevinRansom merged commit 6014fe2 into dotnet:master Jul 18, 2018
jwosty pushed a commit to jwosty/fsharp that referenced this pull request Jul 19, 2018
…tionalVersionAttribute (dotnet#5336)

* remove TypeChecker validation

* update testcase baselines

* Update fsharpqa tests

* Feedback

* Update nowarn test
jwosty added a commit to jwosty/fsharp that referenced this pull request Jul 19, 2018
…yInformationalVersionAttribute (dotnet#5336)"

This reverts commit b5ab862.
jwosty pushed a commit to jwosty/fsharp that referenced this pull request Jul 19, 2018
…tionalVersionAttribute (dotnet#5336)

* remove TypeChecker validation

* update testcase baselines

* Update fsharpqa tests

* Feedback

* Update nowarn test
@KevinRansom KevinRansom deleted the informationalversionattribute branch August 2, 2018 18:27
@vincenzoml
Copy link

I need this fix in dotnet-sdk and I'm not sure I understand the above messages; is it already released? In which sdk version?

@cartermp
Copy link
Contributor

This should be in the latest .NET SDK as per: dotnet/cli#10199

If it is not, then @KevinRansom can speak more towards this fix.

@vincenzoml
Copy link

I get this warning, but the functionality works fine and I get my whole version string in the AssemblyInformationalVersion attribute.

warning FS2003: The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '0.5.1.1-WIP', but this value is invalid and has been ignored [/home/vincenzo/data/jesus/repos/imgql/src/VoxLogicA.fsproj]

@KevinRansom
Copy link
Member Author

This fix will appear in VS2019 preview 1. VS2017.9 does not have the fix.

VS2017.9 was intended to be a stabilizing build, with a very high bar for and a very low number of bug fixes.

@cartermp
Copy link
Contributor

@KevinRansom It's in the latest .NET SDK and @vincenzoml was able to confirm it works for him. Since this doesn't have VS bits, I'm not sure if a particular VS releases matters in this case...

@KevinRansom
Copy link
Member Author

@cartermp, I am now a little confused:

This is the dev15.9 branch source code: https://github.com/Microsoft/visualfsharp/blob/dev15.9/src/fsharp/TypeChecker.fs#L17350

This is the source code for the dev15.8 branch:
https://github.com/Microsoft/visualfsharp/blob/dev15.8/src/fsharp/TypeChecker.fs#L17344

As you can in both see it warns on invalid AssemblyInformationalVersionAttribute. This source was used to build the distributed VS2017.8 desktop and coreclr compilers, VS2017.9 desktop compiler, and the associated release of the dotnet cli.

Master branch and dev16.0 and dev16.0 preview 1 all contain the fix. So to the best of my understanding no release or preview has yet shipped with this fix.

Kevin

@cartermp
Copy link
Contributor

I'm confused as well, as it's not clear why a fix that is in the .NET SDK 2.1.5xx is not available in .NET SDK 2.1.5xx .. I suppose we'll learn one way or another when dev16 preview 1 is out.

@KevinRansom
Copy link
Member Author

@cartermp

This is a decompilation of the compiler dll from :
dotnet\sdk\2.1.500

It seems to have the check for AssemblyInformationalVersionAttribute
I hope this clears it up for you.

        string item = str.item;
        Tast.EntityRef ref2 = _arg3.item1;
        Range.range range = @const.item2;
        string fullName = ref2.Deref.CompiledRepresentationForNamedType.FullName;
        if (!string.Equals(fullName, "System.Reflection.AssemblyInformationalVersionAttribute"))
        {
            if (string.Equals(fullName, "System.Reflection.AssemblyFileVersionAttribute"))
            {
                if (TypeChecker.isValid@17346(item, null))
                {
                    goto Label_00CD;
                }
            }
            else if (!string.Equals(fullName, "System.Reflection.AssemblyVersionAttribute") || TypeChecker.isValid@17346(item, null))
            {
                goto Label_00CD;
            }
        }
        else if (TypeChecker.isValid@17346(item, null))
        {
            goto Label_00CD;
        }
        Exception exn = new ErrorLogger.Error(SR.fscBadAssemblyVersion(fullName, item), range);
        ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Warning(ErrorLogger.CompileThreadStatic.ErrorLogger, exn);
        return null;
    Label_00CD:
        return null;
    Label_0101:
        return null;
    }
}



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