public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe
@ 2024-07-17 18:56 dmalcolm at gcc dot gnu.org
  2024-07-17 19:02 ` [Bug other/115970] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-07-17 18:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115970

            Bug ID: 115970
           Summary: RFE: add support for sending SARIF output to a pipe
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: SARIF
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3358r0.html#msvc
describes a feature of Visual Studio 2022 version 17.8. which can send its
diagnostics in SARIF form to a pipe:

https://learn.microsoft.com/en-us/cpp/build/reference/sarif-output?view=msvc-170#retrieving-sarif-through-a-pipe

This looks useful for IDE consumption.

Maybe GCC should implement a similar feature?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/115970] RFE: add support for sending SARIF output to a pipe
  2024-07-17 18:56 [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe dmalcolm at gcc dot gnu.org
@ 2024-07-17 19:02 ` pinskia at gcc dot gnu.org
  2024-07-17 19:05 ` dmalcolm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-07-17 19:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115970

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Isn't this just writing through a named pipe?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/115970] RFE: add support for sending SARIF output to a pipe
  2024-07-17 18:56 [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe dmalcolm at gcc dot gnu.org
  2024-07-17 19:02 ` [Bug other/115970] " pinskia at gcc dot gnu.org
@ 2024-07-17 19:05 ` dmalcolm at gcc dot gnu.org
  2024-07-31 15:28 ` dmalcolm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-07-17 19:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115970

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
One difference here is that VS code is sending the diagnostics one at a time as
JSON-RPC messages containing SARIF "result" objects as they occur, whereas
currently we write all our SARIF output at once on exit as a single "sarifLog"
object.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/115970] RFE: add support for sending SARIF output to a pipe
  2024-07-17 18:56 [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe dmalcolm at gcc dot gnu.org
  2024-07-17 19:02 ` [Bug other/115970] " pinskia at gcc dot gnu.org
  2024-07-17 19:05 ` dmalcolm at gcc dot gnu.org
@ 2024-07-31 15:28 ` dmalcolm at gcc dot gnu.org
  2024-08-06 21:56 ` [Bug other/115970] RFE: add support for sending SARIF output via IPC dmalcolm at gcc dot gnu.org
  2024-08-06 21:56 ` dmalcolm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-07-31 15:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115970

--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
From what I can tell, in Microsoft's implementation the JSON-RPC messages are
being "packaged" or "framed" via LSP's base protocol, as per:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#baseProtocol

but the notifications are a subset of SARIF.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/115970] RFE: add support for sending SARIF output via IPC
  2024-07-17 18:56 [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe dmalcolm at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-07-31 15:28 ` dmalcolm at gcc dot gnu.org
@ 2024-08-06 21:56 ` dmalcolm at gcc dot gnu.org
  2024-08-06 21:56 ` dmalcolm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-08-06 21:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115970

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Created attachment 58854
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58854&action=edit
WIP patch to output diagnostics as SARIF notifications to a unix domain socket

The attached patch is very much a prototype.  If the environment has
SARIF_SOCKET set to a path to a socket, then GCC diagnostics are emitted as
JSON-RPC notifications to the socket in a manner akin to that for
"SARIF_OUTPUT_PIPE" in P3358R0, albeit with Unix domain sockets.  The patch
also implements a trivial "sarif-listener" program that creates the socket and
listens for notifications.

The patch adds a -fdiagnostics-format=sarif-socket which currently is also
required, but it might be good to simply have the environment variable.  That
way an IDE could make the socket and set the env var when invoking a build
framework, and then all diagnostics would go to the IDE, rather than textually.
 Or we could do both text *and* socket output, but that would require more
surgery to the diagnostics framework.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/115970] RFE: add support for sending SARIF output via IPC
  2024-07-17 18:56 [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe dmalcolm at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-08-06 21:56 ` [Bug other/115970] RFE: add support for sending SARIF output via IPC dmalcolm at gcc dot gnu.org
@ 2024-08-06 21:56 ` dmalcolm at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-08-06 21:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115970

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |dmalcolm at gcc dot gnu.org
   Last reconfirmed|                            |2024-08-06
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-06 21:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17 18:56 [Bug other/115970] New: RFE: add support for sending SARIF output to a pipe dmalcolm at gcc dot gnu.org
2024-07-17 19:02 ` [Bug other/115970] " pinskia at gcc dot gnu.org
2024-07-17 19:05 ` dmalcolm at gcc dot gnu.org
2024-07-31 15:28 ` dmalcolm at gcc dot gnu.org
2024-08-06 21:56 ` [Bug other/115970] RFE: add support for sending SARIF output via IPC dmalcolm at gcc dot gnu.org
2024-08-06 21:56 ` dmalcolm at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).