Skip to content

feat: add inheritable-only field to filter processor-level targets#5270

Open
gandarez wants to merge 1 commit intotinygo-org:devfrom
gandarez:feat/inheritable-only
Open

feat: add inheritable-only field to filter processor-level targets#5270
gandarez wants to merge 1 commit intotinygo-org:devfrom
gandarez:feat/inheritable-only

Conversation

@gandarez
Copy link
Copy Markdown
Contributor

@gandarez gandarez commented Mar 30, 2026

Summary

  • Adds an "inheritable-only": true JSON field to processor-level target files (esp32, esp32c3, esp32s3, esp8266, rp2040, rp2350, rp2350b) so they no longer appear in tinygo targets output
  • GetTargetSpecs() reads the raw JSON before inheritance resolution to check the field, avoiding propagation to child board targets
  • Existing heuristic filter (no flash config) is kept as a safety net for targets like cortex-m.json
  • Targets marked as inheritable-only remain loadable via tinygo build -target=esp32 for backward compatibility

Closes #5178

Test plan

  • Verify tinygo targets no longer lists esp32, esp32c3, esp32s3, esp8266, rp2040, rp2350, rp2350b
  • Verify board targets like esp32-coreboard-v2, pico still appear in tinygo targets
    • Verify tinygo build -target=esp32 still works (backward compat)
  • Run go test ./compileopts/... to validate new test cases

🤖 Generated with Claude Code

@gandarez gandarez closed this Mar 30, 2026
@gandarez gandarez reopened this Mar 30, 2026
@gandarez gandarez closed this Mar 31, 2026
@gandarez gandarez reopened this Mar 31, 2026
… listing

Processor-level targets like esp32, rp2040, etc. have flash-method set
so they leak through the existing heuristic filter in GetTargetSpecs and
appear in `tinygo targets` output. Add an "inheritable-only" JSON field
that is checked on raw JSON before inheritance resolution, preventing
these non-board targets from being listed while keeping them loadable
for direct builds and inheritance.

Ref: tinygo-org#5178

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gandarez gandarez force-pushed the feat/inheritable-only branch from 1e8a6eb to c5dddd4 Compare March 31, 2026 22:25
@soypat
Copy link
Copy Markdown
Contributor

soypat commented Apr 3, 2026

Looks good- though I would have thought there were far more inheritable-only targets. Are these it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: need a way to determine targets that cannot be built by themselves without a board.

2 participants