- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.2k
 
Various loose ends in preparation for merging refout feature #19326
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
Conversation
| 
               | 
          ||
| [Theory] | ||
| [InlineData("")] | ||
| [InlineData(@"[assembly: System.Reflection.AssemblyVersion(""1"")]")] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the /deterministic flag affects two things: (1) whether wildcards are allowed in AssemblyVersion attribute, and (2) how PEs are emitted.
Would you know what the rationale is for (1)? It doesn't seem "non-deterministic".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the docs:
You can specify all the values or you can accept the default build number, revision number, or both by using an asterisk (*). [...] The default build number increments daily. The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2.
That is nondeterministic.
There was a problem hiding this comment.
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 see that VersionHelper.GenerateVersionFromPatternAndCurrentTime replaces the wildcard (maxValue) with the timestamp of the build.
That means if you use a wildcard, the ref assembly will not be deterministic. I wonder if I should switch the compilation to be deterministic if either /refonly or /refout is used.
| 
               | 
          ||
| foreach (var member in this.GetMembers()) | ||
| { | ||
| // PROTOTYPE(refout) Do something here? | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Explicit interface implementations should be included. My understanding is that they are virtual, and we already concluded that all virtual methods should be included in ref assemblies. I'll add a test to lock that in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just the one question. The rest looks good.
| <member name=""M:C.Main""> | ||
| <summary>Main method</summary> | ||
| </member> | ||
| <member name=""F:C.field""> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unexpected. We don't eliminate private fields of a class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such fields are stripped from the ref assembly, but not from the doc output. I'll take a stab tomorrow to strip it out.
| AddDiagnostic(diagnostics, diagnosticOptions, ErrorCode.ERR_NoRefOutWhenRefOnly); | ||
| } | ||
| 
               | 
          ||
| if (metadataReferences.Any(r => r.Properties.EmbedInteropTypes) && (refOnly || outputRefFilePath != null)) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps check second && operand first since that might be cheaper.
| AddDiagnostic(diagnostics, ERRID.ERR_NoRefOutWhenRefOnly) | ||
| End If | ||
| 
               | 
          ||
| If metadataReferences.Any(Function(r) r.Properties.EmbedInteropTypes) AndAlso (refOnly OrElse outputRefFileName IsNot Nothing) Then | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider checking second AndAlso operand first.
| <value>Do not use refout when using refonly.</value> | ||
| </data> | ||
| <data name="ERR_NoEmbeddedTypeWhenRefOutOrRefOnly" xml:space="preserve"> | ||
| <value>Cannot compile embed types when using /refout or /refonly.</value> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot embed types ...
| 
           LGTM  | 
    
… assembly. Hook assembly redirect.
| 
           @gafter @cston Thanks for the feedback. I added a fix for assembly redirect. This is a problem with System.IO.FileSystem, which I also encountered in the corefx repo. More details in this issue https://github.com/dotnet/corefx/issues/16322#issuecomment-286179535. I'll merge as soon as green, so that I can produce a new VS validation build.  | 
    
| 
           Build correctness leg failed with: I'll re-run.  | 
    
| 
           @dotnet-bot test windows_build_correctness_prtest please  | 
    
A few things:
@dotnet/roslyn-compiler for review. Thanks