Skip to content

fix(orchestrator): restore //go:build linux tags on template metadata package - #3342

Closed
AdaAibaby wants to merge 2 commits into
e2b-dev:mainfrom
AdaAibaby:fix/template-metadata-linux-build-tags
Closed

AdaAibaby wants to merge 2 commits into
e2b-dev:mainfrom
AdaAibaby:fix/template-metadata-linux-build-tags

Conversation

@AdaAibaby

@AdaAibaby AdaAibaby commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • packages/orchestrator/pkg/template/metadata/template_metadata.go and prefetch.go both import packages/orchestrator/pkg/sandbox/block, which is a Linux-only package (all its files carry //go:build linux).
  • The build constraints on these two files were dropped in a prior refactor, causing compilation failures on Darwin and other non-Linux platforms.
  • Restores //go:build linux at the top of both files.

Fixes #3316

Test plan

  • go build ./packages/orchestrator/... passes on Linux (verified on dev)
  • GOOS=darwin go build ./packages/orchestrator/... no longer fails on the metadata package
    /cc @jakubno @dobrac @ValentaTomas @arkamar @tvi Looking forward to your code review.

@cla-bot cla-bot Bot added the cla-signed label Jul 23, 2026
@ValentaTomas
ValentaTomas force-pushed the main branch 2 times, most recently from 5aad415 to d71980e Compare July 25, 2026 22:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ffdba6df1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,3 +1,5 @@
//go:build linux

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep template metadata available off Linux

On Darwin, the documented go run ./cmd/copy-build command imports this package, but these are its only two non-test files; constraining both to Linux makes Go reject the import because all package files are excluded. pkg/sandbox/block/prefetch_tracker.go is already cross-platform and provides the data types used here, so these tags should remain removed or portable metadata files must be provided.

Useful? React with 👍 / 👎.

@arkamar

arkamar commented Jul 26, 2026

Copy link
Copy Markdown
Member

I am bit surprised with this as I think I tested it with GOOS=darwin go build ./packages/orchestrator/pkg/template/metadata. Anyway, this will break the copy-build command. Not sure if any darwin user uses it.

@tvi
tvi self-requested a review July 26, 2026 11:22
@arkamar

arkamar commented Jul 26, 2026

Copy link
Copy Markdown
Member

Anyway, #3299 should have add only those parts from block and metadata packages that should be OS agnostic.

… package

template_metadata.go and prefetch.go import packages/orchestrator/pkg/sandbox/block
which is Linux-only. The build constraints were dropped in a prior refactor,
causing compilation failures on Darwin and other non-Linux platforms.

Fixes e2b-dev#3316
@AdaAibaby
AdaAibaby force-pushed the fix/template-metadata-linux-build-tags branch from 5ffdba6 to ec95729 Compare July 26, 2026 14:16
@arkamar

arkamar commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

I don't think this is fixing the real issue, see my comments in related issue #3316, metadata package builds just fine with GOOS=darwin.

@arkamar arkamar closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants