-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Permit a task to disable MSB4181 Fixes #5203 #5207
Conversation
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.
A few places are returning IBuildEngine6 rather than IBuildEngine7.
src/Utilities/Task.cs
Outdated
/// <summary> | ||
/// Retrieves the <see cref="IBuildEngine7" /> version of the build engine interface provided by the host. | ||
/// </summary> | ||
public IBuildEngine6 BuildEngine7 => (IBuildEngine7)BuildEngine; |
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.
Shouldn't this return IBuildEngine7?
@@ -197,6 +197,7 @@ public abstract partial class Task : Microsoft.Build.Framework.ITask | |||
public Microsoft.Build.Framework.IBuildEngine4 BuildEngine4 { get { throw null; } } | |||
public Microsoft.Build.Framework.IBuildEngine5 BuildEngine5 { get { throw null; } } | |||
public Microsoft.Build.Framework.IBuildEngine6 BuildEngine6 { get { throw null; } } | |||
public Microsoft.Build.Framework.IBuildEngine6 BuildEngine7 { get { throw 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.
Shouldn't this return IBuildEngine7?
@@ -352,6 +352,7 @@ public abstract partial class Task : Microsoft.Build.Framework.ITask | |||
public Microsoft.Build.Framework.IBuildEngine4 BuildEngine4 { get { throw null; } } | |||
public Microsoft.Build.Framework.IBuildEngine5 BuildEngine5 { get { throw null; } } | |||
public Microsoft.Build.Framework.IBuildEngine6 BuildEngine6 { get { throw null; } } | |||
public Microsoft.Build.Framework.IBuildEngine6 BuildEngine7 { get { throw 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.
Shouldn't this return IBuildEngine7?
/// <summary> | ||
/// Enables or disables emitting MSB4134 to log when a task fails without logging errors | ||
/// </summary> | ||
public void SetEnableMSB4134(bool enableError) |
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.
Why is this an explicit set method rather than a setter?
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.
You mean a property with {get; set;}
? I don't think you can access that with reflection.
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.
You can, with Type.GetProperty
src/Build/Resources/Strings.resx
Outdated
@@ -1064,8 +1064,8 @@ | |||
</comment> | |||
</data> | |||
<data name="TaskReturnedFalseButDidNotLogError"> | |||
<value>MSB4132: The "{0}" task returned false but did not log an error.</value> | |||
<comment>{StrBegin="MSB4132: "}</comment> | |||
<value>MSB4134: The "{0}" task returned false but did not log an error.</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.
This appears to have been used, too:
MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine.
That's coming entirely from the Deprecated\Engine
folder, but we still shouldn't recycle.
src/Framework/IBuildEngine7.cs
Outdated
/// </summary> | ||
public interface IBuildEngine7 : IBuildEngine6 | ||
{ | ||
public void SetEnableMSB4134(bool errorEnabled); |
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.
Don't include the error code in the name of this method. Give it a descriptive name instead, like maybe
public void SetEnableMSB4134(bool errorEnabled); | |
public void AllowFailureWithoutError(bool errorEnabled); |
?
@@ -93,7 +93,7 @@ public void AssemblyFoldersFromConfigPlatformSpecificAssemblyFirstTest() | |||
} | |||
|
|||
[Fact] | |||
public void AasemblyFoldersFromConfigNormalizeNetFrameworkVersion() |
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.
Please separate this into its own PR.
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.
Ping
Team triage: we'd like to reserve |
@rainersigwald If this fix has to be deferred to 16.7 is there any chance of reverting the original change that caused this issue until 16.7 also? Failing that, please at least correct the error code so that it will be consistent between releases. |
551aea7
to
583561a
Compare
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.
Can you rebase onto current master instead of merging?
@@ -93,7 +93,7 @@ public void AssemblyFoldersFromConfigPlatformSpecificAssemblyFirstTest() | |||
} | |||
|
|||
[Fact] | |||
public void AasemblyFoldersFromConfigNormalizeNetFrameworkVersion() |
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.
Ping
60177dd
to
5287c38
Compare
This adds back support for logging an error when a task returns false without logging an error. This was originally added in dotnet#4940 but was reverted because of multiple difficulties.
5287c38
to
db1feb2
Compare
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.
Merge please, don't squash.
Using IBuildEngine7, one can disable MSB4132 in a task.
Fixes #5203
Also fixes #2036