Skip to content

Support Go buildvcs metadata in filtered Dagger builds #13

@dagger-codex

Description

@dagger-codex

Filtered Dagger builds break Go's native buildvcs metadata by giving go build an incoherent Git worktree.

  • Mounts filtered source without a complete tracked worktree, so Git reports omitted files as deleted and stamps clean binaries as modified.
  • Omits required Git objects in some build contexts, causing go build to fail while collecting VCS status.
  • Forces users to choose between cache-friendly Dagger inputs and standard Go metadata, where projects expect debug.ReadBuildInfo and go version -m to work.
  • Lacks an explicit native-buildvcs mode, making incorrect or missing metadata surprising.

Desired: add a documented native buildvcs mode that prepares a coherent full or sparse Git worktree, while keeping ordinary filtered builds from emitting misleading VCS metadata.

Acceptance:

  • Builds a tiny binary with vcs.revision set.
  • Reports vcs.modified=false for clean source.
  • Reports vcs.modified=true when an included tracked source file changes.
  • Does not mark binaries dirty because unrelated tracked files were intentionally excluded.
  • Does not require tags or remote refs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions