Skip to content

orchestrator/pkg/template/metadata fails to compile on non-Linux (Darwin) after build tags removed #3316

Description

@evanmarshall

What's wrong

PR #3299 removed the //go:build linux constraints from template_metadata.go and prefetch.go in packages/orchestrator/pkg/template/metadata, making those files eligible for non-Linux builds. But both still import github.com/e2b-dev/infra/packages/orchestrator/pkg/sandbox/block, and the block package is almost entirely Linux-only (range.go, cache.go, memfd.go, overlay.go, device.go, tracker.go, etc. all carry //go:build linux). Only prefetch_tracker.go supplies the shared data types.

As a result, GOOS=darwin builds of the metadata/prefetch packages fail: they import a package with no buildable Go files on Darwin. This blocks local development and tooling on macOS.

Where

How to reproduce

  1. GOOS=darwin GOARCH=amd64 go build ./packages/orchestrator/pkg/template/metadata/...
  2. Build fails because the imported sandbox/block package has no Go files buildable for Darwin.

Suggested fix

Separate the portable metadata/prefetch data types (e.g. PrefetchBlockEntry) from the Linux-only block implementation so the metadata package can compile cross-platform, or add a minimal non-Linux stub for the block package. If Darwin builds of this package aren't intended to be supported, restoring a build constraint on the metadata files would also resolve the mismatch.

Found while running Ito (AI code review, free for open source) against recently merged PRs — full analysis: https://app.ito.ai/share/dacb5bb0-ce18-415f-aa26-0c706e869d42.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions