feat(v3): add APP_TAGS, APP_LDFLAGS, APP_CGO_ENABLED build customizat…#5798
Draft
mortenolsrud wants to merge 1 commit into
Draft
feat(v3): add APP_TAGS, APP_LDFLAGS, APP_CGO_ENABLED build customizat…#5798mortenolsrud wants to merge 1 commit into
mortenolsrud wants to merge 1 commit into
Conversation
…ion vars
Projects that need custom build tags (e.g. sqlite_fts5 for CGO SQLite),
custom ldflags (e.g. -X main.Version=...), or CGO overrides currently must
edit platform Taskfiles directly. This creates merge conflicts on every
Wails version bump.
Add project-level build customization variables that are defined in the
root Taskfile.yml (user-owned, never overwritten) and consumed by all
platform Taskfiles (framework-owned, safely regenerable):
- APP_TAGS: build tags included on every platform and mode
- APP_TAGS_{LINUX,DARWIN,WINDOWS,ANDROID,IOS,SERVER}: platform-specific
- APP_LDFLAGS: linker flags appended (version injection, etc.)
- APP_CGO_ENABLED: optional CGO override (empty = platform default)
- EXTRA_TAGS: unchanged semantics (per-invocation CLI override)
All variables are env-overridable for ad-hoc builds. Empty values produce
no change from current behavior (fully backwards compatible).
Desktop dev builds now always emit -tags dev (matching mobile pattern)
to simplify the conditional logic.
Also adds EXTRA_TAGS + APP_* support to Android and iOS Taskfiles, which
previously had no user-extensible tag mechanism.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
…ion vars
Description
Projects that need custom build tags (e.g.
sqlite_fts5for CGO SQLite), custom ldflags (e.g.-X main.Version=...), or CGO overrides currently must edit platform Taskfiles directly. This creates merge conflicts on every Wails version bump.Add project-level build customization variables defined in the root
Taskfile.yml(user-owned, never overwritten) and consumed by all platform Taskfiles (framework-owned, safely regenerable):APP_TAGS— build tags included on every platform and modeAPP_TAGS_{LINUX,DARWIN,WINDOWS,ANDROID,IOS,SERVER}— platform-specific tagsAPP_LDFLAGS— linker flags appended to all buildsAPP_CGO_ENABLED— optional CGO override (empty = platform default)EXTRA_TAGS— unchanged semantics (per-invocation CLI override)All variables are env-overridable for ad-hoc builds (
APP_TAGS="extra" task build). Empty values produce no change from current behavior (fully backwards compatible).Also adds
EXTRA_TAGS+APP_*support to Android and iOS Taskfiles, which previously had no user-extensible tag mechanism.Desktop dev builds now always emit
-tags dev(matching mobile pattern) to simplify the conditional logic.Type of change
How Has This Been Tested?
Verified on a production Wails Android app that uses
APP_TAGS: "sqlite_fts5,sqlite_foreign_keys"andAPP_LDFLAGS: "-X main.Version=1.0.0":task build— tags correctly appear ingo buildinvocationtask android:build— Android build includes APP_TAGS + APP_TAGS_ANDROIDEXTRA_TAGS="debug_sql" task build— env override composes correctlyEXTRA_TAGSusage unchangedLinux: Ubuntu 22.04.5 LTS
Test Configuration
Wails v3.0.0-alpha2.111
Go 1.26.4
Ubuntu 22.04.5 LTS
go-task v3.x
Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)