Skip to content

Conversation

@Forgind
Copy link
Contributor

@Forgind Forgind commented Mar 27, 2020

Using IBuildEngine7, one can disable MSB4132 in a task.

Fixes #5203
Also fixes #2036

Copy link

@sae42 sae42 left a 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.

Copy link

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?

Copy link

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?

Copy link

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?

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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

Suggested change
public void SetEnableMSB4134(bool errorEnabled);
public void AllowFailureWithoutError(bool errorEnabled);

?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Ping

@Forgind Forgind changed the title Permit a task to disable MSB4132 Fixes #5203 Permit a task to disable MSB4181 Fixes #5203 Apr 3, 2020
@rainersigwald
Copy link
Member

Team triage: we'd like to reserve IBuildEngine7 for some changes going into 16.7 that are already planned. Let's delay this change until then as well.

@rainersigwald rainersigwald added this to the MSBuild 16.7 milestone Apr 3, 2020
@sae42
Copy link

sae42 commented Apr 6, 2020

@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.

Copy link
Member

@rainersigwald rainersigwald left a 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?

Copy link
Member

Choose a reason for hiding this comment

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

Ping

Forgind added 4 commits April 28, 2020 08:48
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.
Copy link
Member

@rainersigwald rainersigwald left a 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.

@Forgind Forgind merged commit f4dacba into dotnet:master Apr 28, 2020
@Forgind Forgind deleted the MSB4132-opt-out branch April 28, 2020 21:20
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.

MSB4132 is emitted when a task logs errors in custom format Log our own error if a task returned false but didn't log any errors

3 participants