Background
PR #5337 adds Garble obfuscation support. It works, but the user experience requires two manual steps every build:
# Step 1 — generate stable ID file
wails3 generate bindings -obfuscated
# Step 2 — build with garble
wails3 build --obfuscated
This issue tracks making the workflow single-command and config-driven.
Problems to fix
1. build/config.yml has no obfuscation option
Users must remember to pass --obfuscated on every wails3 build invocation. There is no project-level setting to make it permanent.
Fix: add an obfuscated (bool) and garble_args (string) field to build/config.yml and the config struct so that wails3 build reads them automatically — no flag required.
2. Taskfile caching silently skips ID-file regeneration
generate:bindings has sources: / generates: set for Taskfile fingerprinting. wails_obfuscated.gen.go is not listed in generates:, so Taskfile does not know the file is missing and skips the generation step when Go sources are otherwise unchanged (e.g. first run after git clean, or first switch from a non-obfuscated build).
The build still compiles — but without the stable ID registrations, binding IDs resolve via the FNV hash on obfuscated names, which breaks at runtime.
Fix: add wails_obfuscated.gen.go (or a glob) to the generates: list in generate:bindings inside Taskfile.tmpl.yml so Taskfile detects its absence and forces regeneration.
3. OBFUSCATED is not explicitly forwarded through the dep chain
build:frontend calls generate:bindings as a dep and only forwards BUILD_FLAGS in its vars: block. OBFUSCATED reaches generate:bindings only via global CLI-var scoping — correct today but fragile and not obvious to contributors.
Fix: explicitly forward OBFUSCATED (and GARBLE_ARGS) in the vars: block where build:frontend calls generate:bindings.
Documentation that must be updated
The following docs pages must be updated as part of this issue (not as a follow-up):
Acceptance criteria
Related
Background
PR #5337 adds Garble obfuscation support. It works, but the user experience requires two manual steps every build:
This issue tracks making the workflow single-command and config-driven.
Problems to fix
1.
build/config.ymlhas no obfuscation optionUsers must remember to pass
--obfuscatedon everywails3 buildinvocation. There is no project-level setting to make it permanent.Fix: add an
obfuscated(bool) andgarble_args(string) field tobuild/config.ymland the config struct so thatwails3 buildreads them automatically — no flag required.2. Taskfile caching silently skips ID-file regeneration
generate:bindingshassources:/generates:set for Taskfile fingerprinting.wails_obfuscated.gen.gois not listed ingenerates:, so Taskfile does not know the file is missing and skips the generation step when Go sources are otherwise unchanged (e.g. first run aftergit clean, or first switch from a non-obfuscated build).The build still compiles — but without the stable ID registrations, binding IDs resolve via the FNV hash on obfuscated names, which breaks at runtime.
Fix: add
wails_obfuscated.gen.go(or a glob) to thegenerates:list ingenerate:bindingsinsideTaskfile.tmpl.ymlso Taskfile detects its absence and forces regeneration.3.
OBFUSCATEDis not explicitly forwarded through the dep chainbuild:frontendcallsgenerate:bindingsas a dep and only forwardsBUILD_FLAGSin itsvars:block.OBFUSCATEDreachesgenerate:bindingsonly via global CLI-var scoping — correct today but fragile and not obvious to contributors.Fix: explicitly forward
OBFUSCATED(andGARBLE_ARGS) in thevars:block wherebuild:frontendcallsgenerate:bindings.Documentation that must be updated
The following docs pages must be updated as part of this issue (not as a follow-up):
docs/src/content/docs/reference/cli.mdxwails3 buildrow: remove "the only build-time flag is--tags"; document--obfuscatedand--garbleargsgenerate bindingsrow: add-obfuscatedand-obfuscated-outputto the flags listNew guide:
docs/src/content/docs/guides/build/obfuscation.mdxcovering:@v0.16.0, Go 1.24+)json:"..."tag requirement on service struct fields (and why — garble renames exported fields when types cross aninterface{}boundary)obfuscated: trueinbuild/config.yml, then justwails3 buildwails_obfuscated.gen.gois, whether to commit it, and what-obfuscated-outputis forAcceptance criteria
build/config.ymlsupportsobfuscated: trueand optionalgarble_argswails3 build(no flags) obfuscates whenobfuscated: trueis set in configwails3 generate bindings(no flags) emitswails_obfuscated.gen.gowhenobfuscated: trueis set in configwails_obfuscated.gen.gois in thegenerates:list so Taskfile detects it as a targetOBFUSCATEDis explicitly forwarded in thebuild:frontend→generate:bindingsdepvars:blockTaskfile.tmpl.yml(andupdate build-assets) produces Taskfiles that include the above changes for new and existing projectscli.mdx) updated —wails3 buildandgenerate bindingsrows correctguides/build/obfuscation.mdx) written and linked from the sidebarRelated