feat: add inheritable-only field to filter processor-level targets#5270
feat: add inheritable-only field to filter processor-level targets#5270deadprogram merged 3 commits intotinygo-org:devfrom
Conversation
1e8a6eb to
c5dddd4
Compare
|
Looks good- though I would have thought there were far more inheritable-only targets. Are these it? |
|
Also @gandarez please amend your commits to remove Claude. Any commits made by people are considered made by those people regardless of the tooling they use. Thank you. |
… 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
c5dddd4 to
424005d
Compare
|
@deadprogram done it |
The InheritableOnly bool field was propagating from parent to child targets through overrideProperties, which would hide board targets from GetTargetSpecs. Fix by preserving/restoring the field across resolveInherits. Also simplify GetTargetSpecs by removing the raw JSON pre-check workaround and remove nonexistent esp32c6 from tests.
|
I cannot test right this moment due to having uncommited changes in process in my local branch. Question: what happens in this branch if you try to run a command like this: |
Yes it blinks if I add support for |
|
What I mean is, what message is displayed if someone tries to use a target that is |
|
oh sorry! ec64a79 |
|
OK excellent! Thank you @gandarez for working on this, and to @soypat and @HattoriHanzo031 for your feedback and reviews. Now squash/merging. |
…5270) * feat: add inheritable-only field to hide processor-level targets from 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: #5178 * fix: prevent inheritable-only from propagating to child targets The InheritableOnly bool field was propagating from parent to child targets through overrideProperties, which would hide board targets from GetTargetSpecs. Fix by preserving/restoring the field across resolveInherits. Also simplify GetTargetSpecs by removing the raw JSON pre-check workaround and remove nonexistent esp32c6 from tests. * prevent build commands to use inheritable only targets
Summary
"inheritable-only": trueJSON field to processor-level target files (esp32, esp32c3, esp32s3, esp8266, rp2040, rp2350, rp2350b) so they no longer appear intinygo targetsoutputGetTargetSpecs()reads the raw JSON before inheritance resolution to check the field, avoiding propagation to child board targetscortex-m.jsoninheritable-onlyremain loadable viatinygo build -target=esp32for backward compatibilityCloses #5178
Test plan
tinygo targetsno longer listsesp32,esp32c3,esp32s3,esp8266,rp2040,rp2350,rp2350besp32-coreboard-v2,picostill appear intinygo targetstinygo build -target=esp32still works (backward compat)go test ./compileopts/...to validate new test cases