wailsapp / wailsapp/wails

wails3 task not properly forwarding variables to task call

Open
#5,136 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting feedback Bug cli P2 v3 Windows
Dominant language
Go
Stars
36.3k
Forks
1.9k
Avg merge
2d 11h
Merged PRs (30d)
33

Description

Description

I want to make some minor modifications to the Taskfiles called and found that variables weren't being passed through properly

Tl;DR
call.Vars is not visible to top-level vars:
e.Taskfile.Vars is visible everywhere
the bug = vars injected too late in the lifecycle

To Reproduce

Step 1

  • open one of the Taskfiles relevant to your platform (for example build/darwin/Taskfile.yml)
  • add a var such as DEBUG_MODE: '{{default "false" .DEBUG_MODE}}'.
  • Replace the contents of the run task with
- |
        if [ "{{.DEBUG_MODE}}" = "true" ]; then
          echo "Running in debug mode"
        else
          echo "Running in normal mode"
        fi

Step 2

  • Open the atterpac/refresh config for your project and modify the execution list (comment out tasks unimportant for the test) and add the debug mode property as shown below
  executes:
#    - cmd: wails3 build DEV=true
#      type: blocking
#    - cmd: wails3 task common:dev:frontend
#      type: background
    - cmd: wails3 task run DEBUG_MODE=true
      type: primary

Step 3

Run wails3 dev

Expected behaviour

I would expect to see the message Running in debug mode

Screenshots

No response

Attempted Fixes

No response

System Details
# System 

┌──────────────────────────────────────────────────┐
| Name          | MacOS                            |
| Version       | 26.4.1                           |
| ID            | 25E253                           |
| Branding      | MacOS 26.4.1                     |
| Platform      | darwin                           |
| Architecture  | arm64                            |
| Apple Silicon | true                             |
| CPU           | Apple M4 Pro                     |
| CPU 1         | Apple M4 Pro                     |
| CPU 2         | Apple M4 Pro                     |
| GPU           | 20 cores, Metal Support: Metal 4 |
| Memory        | 64 GB                            |
└──────────────────────────────────────────────────┘

# Build Environment 

┌──────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-dev                                          |
| Go Version     | go1.26.2                                            |
| Revision       | bb4fbf95744fafe5acf84e143a419bfffc2159e6            |
| Modified       | true                                                |
| -buildmode     | exe                                                 |
| -compiler      | gc                                                  |
| CGO_CFLAGS     |                                                     |
| CGO_CPPFLAGS   |                                                     |
| CGO_CXXFLAGS   |                                                     |
| CGO_ENABLED    | 1                                                   |
| CGO_LDFLAGS    |                                                     |
| DefaultGODEBUG | cryptocustomrand=1,tlssecpmlkem=0,urlstrictcolons=0 |
| GOARCH         | arm64                                               |
| GOARM64        | v8.0                                                |
| GOOS           | darwin                                              |
| vcs            | git                                                 |
| vcs.modified   | true                                                |
| vcs.revision   | bb4fbf95744fafe5acf84e143a419bfffc2159e6            |
| vcs.time       | 2026-03-01T03:10:56Z                                |
└──────────────────────────────────────────────────────────────────────┘
Additional context

#5135 has been created to address this issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with build/darwin/Taskfile.yml and the atterpac/refresh configuration, then run wails3 dev and trace how the run task receives DEBUG_MODE=true. Compare call.Vars with e.Taskfile.Vars during task evaluation; done when the task prints the expected debug-mode message and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.