Skip to content

Commit 559b026

Browse files
committed
Merge branch 'release/v2.5.x'
2 parents 2360626 + c6ba6d7 commit 559b026

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
This file lists the main changes with each version of the Fyne toolkit.
44
More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases).
55

6+
## 2.5.5 - 13 March 2025
7+
8+
### Fixed
9+
10+
* Correct wasm build for Go 1.24 onwards
11+
12+
613
## 2.5.4 - 1 February 2025
714

815
### Changed

cmd/fyne/internal/commands/package-web.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ func (w webData) packageWebInternal(appDir string, exeWasmSrc string, exeJSSrc s
7171
return err
7272
}
7373

74-
wasmExecSrc := filepath.Join(runtime.GOROOT(), "misc", "wasm", "wasm_exec.js")
74+
goroot := runtime.GOROOT()
75+
wasmExecSrc := filepath.Join(goroot, "lib", "wasm", "wasm_exec.js")
76+
if !util.Exists(wasmExecSrc) { // Fallback for Go < 1.24:
77+
wasmExecSrc = filepath.Join(goroot, "misc", "wasm", "wasm_exec.js")
78+
}
7579
wasmExecDst := filepath.Join(appDir, "wasm_exec.js")
7680
err = util.CopyFile(wasmExecSrc, wasmExecDst)
7781
if err != nil {

cmd/fyne/internal/commands/package_test.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,27 @@ func Test_PackageWasm(t *testing.T) {
238238
return expectedEnsureSubDirRuns.verifyExpectation(t, parent, name)
239239
}
240240

241+
// Handle lookup for wasm_exec.js from lib folder in Go 1.24 and newer:
242+
goroot := runtime.GOROOT()
243+
wasmExecJSPath := filepath.Join(goroot, "lib", "wasm", "wasm_exec.js")
244+
_, err := os.Stat(wasmExecJSPath)
245+
execJSLibExists := err == nil || !os.IsNotExist(err)
246+
241247
expectedExistRuns := mockExistRuns{
242248
expected: []mockExist{
243249
{"myTest.wasm", false},
244250
{"myTest.wasm", true},
251+
{wasmExecJSPath, execJSLibExists},
245252
},
246253
}
247254
utilExistsMock = func(path string) bool {
248255
return expectedExistRuns.verifyExpectation(t, path)
249256
}
250257

258+
if !execJSLibExists { // Expect location from Go < 1.24 to have been copied:
259+
wasmExecJSPath = filepath.Join(goroot, "misc", "wasm", "wasm_exec.js")
260+
}
261+
251262
expectedWriteFileRuns := mockWriteFileRuns{
252263
expected: []mockWriteFile{
253264
{filepath.Join("myTestTarget", "wasm", "index.html"), nil},
@@ -265,15 +276,15 @@ func Test_PackageWasm(t *testing.T) {
265276
expectedCopyFileRuns := mockCopyFileRuns{
266277
expected: []mockCopyFile{
267278
{source: "myTest.png", target: filepath.Join("myTestTarget", "wasm", "icon.png")},
268-
{source: filepath.Join(runtime.GOROOT(), "misc", "wasm", "wasm_exec.js"), target: filepath.Join("myTestTarget", "wasm", "wasm_exec.js")},
279+
{source: wasmExecJSPath, target: filepath.Join("myTestTarget", "wasm", "wasm_exec.js")},
269280
{source: "myTest.wasm", target: filepath.Join("myTestTarget", "wasm", "myTest.wasm")},
270281
},
271282
}
272283
utilCopyFileMock = func(source, target string) error {
273284
return expectedCopyFileRuns.verifyExpectation(t, false, source, target)
274285
}
275286

276-
err := p.doPackage(wasmBuildTest)
287+
err = p.doPackage(wasmBuildTest)
277288
assert.Nil(t, err)
278289
wasmBuildTest.verifyExpectation()
279290
expectedTotalCount(t, len(expectedEnsureSubDirRuns.expected), expectedEnsureSubDirRuns.current)

0 commit comments

Comments
 (0)