-
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
ProjectImportedEventArgs missing from most projects #9501
Comments
Might the |
The binlog should contain it if so? |
and some imports were logged |
Not that I am aware of. |
It was just a wild quick quess. For some reason calls emiting Anyways - Alina is currently having few leads for next investigation steps, so please ignore my intervention here :-) Unless any of those turns promissing - then I suggest to quickly try to investigate if setting/unsetting repores the issue - as the env var is explicitly set by BinaryLogger - but just for current process - so that might answer why only the imports from inproc nodes are logged. |
No problem! I think we always log environment variables that start with MSBUILD, DOTNET and a third prefix that I don't remember. Good idea, if the other nodes don't set the env then it might not happen there! I think it's a regression but I might be wrong (if it's always been broken then I'll be very surprised about how come we've missed this all this time) |
Ah - didn't know about the logging of MSBUILD*,DOTNET* env vars - thanks for learning me something new today! :-) Building with vs So I believe the Regression or not - it's still worth fixing. I'd just like us to invest slightly more and introduce general way of communicating state (env, subscriptions, etc.) from main node to others - this way we wouldn't need to transmit (and ideally not even emit) events if there are no subscriber. As a workaround - setting the trait globally ( |
I'm not seeing ProjectImportedEventArgs in this list: Could it be that removing binary formatter impacted serialization of ProjectImportedEventArgs in node packet translator? |
As part of this issue let's verify that all node types mentioned here are being serialized properly: |
Btw. to make sure there are no BuildEventArgs left of off the roundtrip test (even in future) - we can easily enumerate all BuildEventArgs inheritors from the Microsoft.Build assembly. Similarly as we test the BuildException types serialization here: https://github.com/dotnet/msbuild/blob/main/src/Build.UnitTests/BackEnd/BinaryTranslator_Tests.cs#L247-L258 |
Hey folks, any progress on this issue? A bit worried that we have incomplete information in the binlogs and it could be misleading and make investigations harder. |
@AR-May is on it - just currently OOF this week |
ah ok, no rush |
Back to work, on it! |
I agree, I managed to reproduce and debug the issue and I also believe the In the case of this issue, the |
Fixes #9501 Context When the new environment is sent to msbuild node or msbuild server node, the environment is set up but the values in the Traits class are not updated. This leads to using a different configuration on the server or MSBuild node than on the main MSBuild node when the server or msbuild node was preserved from the previous builds. Changes Made Together with setting the new environment, re-create a Traits class instance to update the corresponding values. I bit of refactoring: there was a pattern in the code "unset current environment and set a new one", which is repeated in many places. Testing Manual tests, unit tests, exp VS insertion Notes This change is rather a work-around for the bigger problem of handling the environment properly in MSBuild nodes: the configuration sometimes is taken from the Traits and sometimes directly from environment variable. Also, as in this issue, sometimes code sets new environment variables but does not update the values in Traits (and sometimes it updates). We might consider fixing how we deal with configuration.
@tmat has sent me a binlog from "17.9.0-preview-23570-02+bf9d6d46d"
D:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\MSBuild.exe
It's missing ProjectImported events for all but a handful of projects:
Build.proj id:51
Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj net472 id:10601
Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj net472;net6.0 id:10501
Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj net472 id:10551
Roslyn.sln.metaproj v4.0 id:101
Roslyn.VisualStudio.Setup.csproj net472 id:2501
Ping me on teams and I can share the binlog internally.
The text was updated successfully, but these errors were encountered: