Build targets task 1: Basic Target Parameter Support for llgo build/run/test commands#1193
Merged
xushiwei merged 9 commits intogoplus:mainfrom Aug 1, 2025
cpunion:targets-refactor-1176
Merged
Build targets task 1: Basic Target Parameter Support for llgo build/run/test commands#1193xushiwei merged 9 commits intogoplus:mainfrom cpunion:targets-refactor-1176
xushiwei merged 9 commits intogoplus:mainfrom
cpunion:targets-refactor-1176
Conversation
This was referenced Jul 29, 2025
Add comprehensive target configuration parsing and inheritance system: - Create internal/targets package with config structures - Support JSON configuration loading with inheritance resolution - Implement multi-level inheritance (e.g., rp2040 → cortex-m0plus → cortex-m) - Add 206 target configurations from TinyGo for embedded platforms - Support core fields: name, llvm-target, cpu, features, build-tags, goos, goarch, cflags, ldflags - Provide high-level resolver interface for target lookup - Include comprehensive unit tests with 100% target parsing coverage This foundation enables future -target parameter support for cross-compilation to diverse embedded platforms beyond current GOOS/GOARCH limitations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add license attribution for target configuration files derived from TinyGo project: - Document source from https://github.com/tinygo-org/tinygo/tree/release/targets - Include complete BSD 3-Clause license from TinyGo project - Clarify licensing terms for target configuration files - Ensure proper attribution to TinyGo Authors and Go Authors - Maintain compliance with original license requirements This ensures proper license compliance when using TinyGo's target configurations in the llgo project. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1193 +/- ##
==========================================
+ Coverage 87.84% 87.93% +0.09%
==========================================
Files 29 32 +3
Lines 7298 7653 +355
==========================================
+ Hits 6411 6730 +319
- Misses 821 844 +23
- Partials 66 79 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ration - Add LLVMTarget, CPU, Features, BuildTags fields to Export struct - Implement UseTarget() function for target name-based configuration loading - Add UseWithTarget() function combining target and goos/goarch fallback - Include comprehensive unit tests for target integration - Support 206+ embedded platform configurations with inheritance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add Target field to build.Config struct - Update build system to use crosscompile.UseWithTarget() - Enable target-based cross-compilation in build pipeline - Maintain backward compatibility with existing GOOS/GOARCH workflow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add Target flag variable to support -target parameter - Update AddBuildFlags to include target platform option - Enable syntax: -target platform (e.g., rp2040, wasi) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update build command: llgo build -target platform - Update run command: llgo run -target platform - Update test command: llgo test -target platform - Wire target flag to build configuration - Update usage documentation for new parameter Examples: - llgo build -target rp2040 ./firmware - llgo run -target wasi ./main.go - llgo test -target cortex-m ./tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Impl #1194
crosscompile.UseWithTargetto suppport build .o with targetSeparate PR 1: support shared/static library
llgo build -buildmode=c-archive -target xxxSeparate PR 2: support executable
Separate PR 3: supports linker scripts and emulator (Task 2)
llgo run/test -target xxx