dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.12k stars 4.04k forks source link

LSIF generator can sometimes write non-LSIF to stdout #69137

Closed gundermanc closed 1 month ago

gundermanc commented 1 year ago

In some cases the LSIF generator has been observed to emit non-JSON lines, breaking ingestion, which expects to only record LSIF lines.

Here's one such example:

Image

It seems to be localized to the https://devdiv.visualstudio.com/DevDiv/_git/Gladstone repo.

I can probably furnish you with the precise LSIF, if needed.

CyrusNajmabadi commented 1 year ago

We use stdout at all? Ick. Can we switch to always just writing to a file?

gundermanc commented 1 year ago

We use stdout at all? Ick. Can we switch to always just writing to a file?

Yeah absolutely! FWIW I'm currently working on a proposal for additional diagnostics between the tool and its consumers to help collect more actionable information about how it performs.

Writing to file(s) (ideally one per project) is on the list. Lmk what other modifications you have in mind.

jasonmalinowski commented 11 months ago

@gundermanc Even if we haven't moved to file writing generally, is this specific problem still causing issues for that repo? The non-LSIF output looks like it might have been output from the SDK discovery, and hopefully newer builds aren't doing that in the LSIF process anymore. stdout is still dangerous, but at least in this case it should be better?

CyrusNajmabadi commented 1 month ago

Closing out due to lack of response.