Skip to content

Plugin contract: stdout reserved for go-plugin handshake, logs must use stderr #98

@mwaldheim

Description

@mwaldheim

Critical constraint from hashicorp/go-plugin: the host reads the subprocess stdout at startup to get the gRPC socket address. Any write to stdout by a plugin corrupts this handshake and silently breaks the connection.

Rule: plugins must NEVER write to stdout. Use hclog with Output: os.Stderr exclusively.

Tasks:

  • Add hclog scaffolding to plugin SDK template
  • Add golangci-lint custom rule or go vet check flagging os.Stdout writes in plugins
  • Document stdout/stderr contract in docs/plugin-development.md
  • Add test verifying plugin stdout violation produces a clear CI error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions