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

Buildalyzer hangs if build does not start #271

Closed
slang25 opened this issue May 7, 2024 · 0 comments · Fixed by #272 or #273
Closed

Buildalyzer hangs if build does not start #271

slang25 opened this issue May 7, 2024 · 0 comments · Fixed by #272 or #273

Comments

@slang25
Copy link
Contributor

slang25 commented May 7, 2024

@martincostello found that adding global properties with ; in would result in Buildalyzer hanging.

I've done some investigating and have created a minimal repro here:
main...slang25:Buildalyzer:msbuild-hang-repro

If you run that test you will see that it just hangs. There are really two issues here, the first is minor, which is that we should escape the property values as outlined here to work around the fact that msbuild doesn't like ; in property values.

The second is a bit more fundamental, if the build doesn't start for whatever reason, Buildalyzer should not hang. I've been thinking about this and looking into the best way of supporting this, and there's not an obvious fix due to the way AnonymousPipeLoggerServer works, but the simple workaround I've found is to dispose of the underlying stream when:

  1. We've received no build events
  2. The process has exited with a non-zero return code

With this in place we should still get an overall result from Buildalyzer, but with an OverallSuccess of false as expected.

I'll create two PRs, one fixing the value escaping, the other with a (not ideal) fix for the general hang scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant