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
GOOS=darwin GOARCH=amd64 go build ./packages/orchestrator/pkg/template/metadata/...
- 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.
What's wrong
PR #3299 removed the
//go:build linuxconstraints fromtemplate_metadata.goandprefetch.goinpackages/orchestrator/pkg/template/metadata, making those files eligible for non-Linux builds. But both still importgithub.laiyagushi.com/e2b-dev/infra/packages/orchestrator/pkg/sandbox/block, and theblockpackage is almost entirely Linux-only (range.go,cache.go,memfd.go,overlay.go,device.go,tracker.go, etc. all carry//go:build linux). Onlyprefetch_tracker.gosupplies the shared data types.As a result,
GOOS=darwinbuilds 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
packages/orchestrator/pkg/template/metadata/template_metadata.go(importssandbox/block, no build tag): https://github.com/e2b-dev/infra/blob/main/packages/orchestrator/pkg/template/metadata/template_metadata.go#L1-L15packages/orchestrator/pkg/template/metadata/prefetch.go(same import, no build tag): https://github.com/e2b-dev/infra/blob/main/packages/orchestrator/pkg/template/metadata/prefetch.go#L1-L11packages/orchestrator/pkg/sandbox/block/range.gostill//go:build linux(representative of the package): https://github.com/e2b-dev/infra/blob/main/packages/orchestrator/pkg/sandbox/block/range.go#L1How to reproduce
GOOS=darwin GOARCH=amd64 go build ./packages/orchestrator/pkg/template/metadata/...sandbox/blockpackage has no Go files buildable for Darwin.Suggested fix
Separate the portable metadata/prefetch data types (e.g.
PrefetchBlockEntry) from the Linux-onlyblockimplementation so the metadata package can compile cross-platform, or add a minimal non-Linux stub for theblockpackage. 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.