Skip to content

feat(v3): add APP_TAGS, APP_LDFLAGS, APP_CGO_ENABLED build customizat…#5798

Draft
mortenolsrud wants to merge 1 commit into
wailsapp:masterfrom
mortenolsrud:feat/app-build-vars
Draft

feat(v3): add APP_TAGS, APP_LDFLAGS, APP_CGO_ENABLED build customizat…#5798
mortenolsrud wants to merge 1 commit into
wailsapp:masterfrom
mortenolsrud:feat/app-build-vars

Conversation

@mortenolsrud

Copy link
Copy Markdown
Contributor

…ion vars

Description

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 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 tags
  • APP_LDFLAGS — linker flags appended to all builds
  • 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 (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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Verified on a production Wails Android app that uses APP_TAGS: "sqlite_fts5,sqlite_foreign_keys" and APP_LDFLAGS: "-X main.Version=1.0.0":

  1. task build — tags correctly appear in go build invocation
  2. task android:build — Android build includes APP_TAGS + APP_TAGS_ANDROID
  3. EXTRA_TAGS="debug_sql" task build — env override composes correctly
  4. Empty APP_* vars — build behavior identical to before (backwards compat)
  5. Existing EXTRA_TAGS usage unchanged
  • Windows
  • macOS
  • Linux

Linux: 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:

  • (v2 only) I have updated website/src/pages/changelog.mdx with details of this PR (v3 changelog entries are added automatically)
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

…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.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef5b1a65-8188-499f-87ab-707372305f5b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant