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

Added TaskAssemblyLocation to TaskStartedEventArgs2 #772

Merged

Conversation

MichalPavlik
Copy link
Contributor

Fixes #771

@KirillOsenkov
Copy link
Owner

The reader looks good! Let's also update the BuildEventArgsWriter (same changes as in the MSBuild repo)

@KirillOsenkov
Copy link
Owner

Oh, also need to update this place:

string assembly = GetTaskAssembly(taskName);

Currently we compute the Task assembly by parsing Using Task messages here:

string rawMessage = Reflector.GetMessage(args);
var match = Strings.UsingTask(message, rawMessage);
if (match.Success)
{
construction.SetTaskAssembly(
Intern(match.Groups["task"].Value),
Intern(match.Groups["assembly"].Value));
return;
}

We need to first take TaskStartedEventArgs2.TaskAssemblyLocation if that's not null or empty, otherwise fall back to the existing logic.

@KirillOsenkov
Copy link
Owner

Also do you have a binlog that exercises a new resource string that you added? Does that string end up in the binlog?

@MichalPavlik
Copy link
Contributor Author

Yes, it did :)
dotnet/msbuild#9948 (comment)

I will update the MessageProcessor. I wanted to ask where can I find the code for populating Assembly node inside task, but you was faster :)

@KirillOsenkov
Copy link
Owner

Now just the writer please ;)

@KirillOsenkov
Copy link
Owner

@MichalPavlik could you please include the changes in our copy of BuildEventArgsWriter.cs as well?

@KirillOsenkov
Copy link
Owner

@MichalPavlik also please make sure the test TestBinaryLoggerRoundtrip is passing, it's failing with these changes

@MichalPavlik
Copy link
Contributor Author

Sorry, I had vacation. I will do it today.

@MichalPavlik
Copy link
Contributor Author

MichalPavlik commented Apr 16, 2024

I was debugging the test locally and I'm confused by the diff. It seems that the difference is in newline format:
image

I have to investigate more, but if you have any idea, please let me know. I don't think my changes would cause this kind of failure :|

@KirillOsenkov
Copy link
Owner

Perhaps @JanKrivanek can help here, he did a lot of work in making sure the format is roundtrippable.

@JanKrivanek
Copy link
Collaborator

The nullref exception is more concerning that the newline format - I'd suggest looking into that

@MichalPavlik
Copy link
Contributor Author

Test result was misleading :) The root cause was in writer - test is using MSBuild to build project, but it knows nothing about TaskStartedEventArgs2, so the value was missing in binlog.

@JanKrivanek
Copy link
Collaborator

Lets make sure the test is catching the similar problems for the future: MichalPavlik#1 (I do not have write access to your fork @MichalPavlik - so I created this as a PR to your branch :))

Explicitly verify there are no errors in the build nor during reading
@MichalPavlik
Copy link
Contributor Author

Great, thanks :)

Copy link
Owner

@KirillOsenkov KirillOsenkov left a comment

Choose a reason for hiding this comment

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

Thank you!

@KirillOsenkov KirillOsenkov merged commit c9763b3 into KirillOsenkov:main Apr 18, 2024
1 check passed
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.

Add support for task assembly location
3 participants