fyne-io / fyne-cross

Cross compiler tool for Fyne apps
BSD 3-Clause "New" or "Revised" License
234 stars 48 forks source link

Failed to inject metadata init file, omitting metadata #253

Closed pinpox closed 2 months ago

pinpox commented 3 months ago

Describe the bug:

When trying to build windows executables on Github Actions I run into the following error:

 99993ea1b455: Pull complete
252d4577251a: Pull complete
Digest: sha256:f4194bdf6a5bd72b077a4d853d1c74400c485c79dee83e490056787c17d54b47
Status: Downloaded newer image for fyneio/fyne-cross-images:windows
[✓] "bin" dir cleaned: /app/fyne-cross/bin/windows-amd64
[✓] "dist" dir cleaned: /app/fyne-cross/dist/windows-amd64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/windows-amd64
[i] Checking for go.mod: /home/runner/work/tmx-uploader/tmx-uploader/go.mod
[✓] go.mod found
[i] Packaging app...
2024/05/15 10:44:58 Fyne error:  Failed to inject metadata init file, omitting metadata
2024/05/15 10:44:58   Cause: invalid character 'g' looking for beginning of value
2024/05/15 10:44:58   At: /go/pkg/mod/fyne.io/fyne/v2@v2.3.5/cmd/fyne/internal/commands/build.go:215

The full output is available here: https://github.com/pinpox/tmx-uploader/actions/runs/9094292418/job/24995039586

I'm linking to the GitHub Action logs, because I'm not able to reproduce it locally, probably I have a different local setup somehow, but wasn't able to find out what the difference is so I assume it is a bug related to fyne-cross + GitHub

222 Seemed to have a similar error message ("invalid character 'g' looking for beginning of value"). Opening a new issue as requested by @andydotxyz

To Reproduce:

Steps to reproduce the behaviour:

  1. Go to https://github.com/pinpox/tmx-uploader/tree/36935242b2411559d7b8ba44cf90bc183bc89f5a
  2. Run the command fyne-cross windows -arch=amd64 -app-id=pinpox.tmx.uploader
  3. See error

Example code:

The full code of the application can be viewed here: https://github.com/pinpox/tmx-uploader/tree/36935242b2411559d7b8ba44cf90bc183bc89f5a

It is build using this script: https://github.com/pinpox/tmx-uploader/blob/36935242b2411559d7b8ba44cf90bc183bc89f5a/.github/workflows/build.yaml

Device and debug info (please complete the following information):

Device info
Debug info

```bash
Run fyne-cross version && fyne-cross windows -arch=amd64 -app-id=pinpox.tmx.uploader -debug --no-cache .
fyne-cross version v1.5.0
[i] Target: windows/amd64
&command.localContainerImage{baseContainerImage:command.baseContainerImage{arch:"amd64", os:"windows", id:"windows-amd64", env:map[string]string{"CC":"zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows", "CXX":"zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows", "GOARCH":"amd64", "GOOS":"windows"}, tags:[]string(nil), mount:[]command.containerMountPoint{command.containerMountPoint{name:"project", localHost:"/home/runner/work/tmx-uploader/tmx-uploader", inContainer:"/app"}}, DockerImage:"docker.io/fyneio/fyne-cross-images:windows"}, runner:(*command.localContainerEngine)(0xc000194000)}
[i] Cleaning target directories...
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e GOOS=windows docker.io/fyneio/fyne-cross-images:windows rm -rf /app/fyne-cross/bin/windows-amd64
Unable to find image 'fyneio/fyne-cross-images:windows' locally
windows: Pulling from fyneio/fyne-cross-images
0bc8ff246cb8: Pulling fs layer
0ea4431cabe6: Pulling fs layer
ffd44f50f2ea: Pulling fs layer
ded93963744d: Pulling fs layer
4f4fb700ef54: Pulling fs layer
3f42a6f68a35: Pulling fs layer
cce7d39fd11a: Pulling fs layer
67c0e0b910ae: Pulling fs layer
def2e0229815: Pulling fs layer
99993ea1b455: Pulling fs layer
252d4577251a: Pulling fs layer
3f42a6f68a35: Waiting
99993ea1b455: Waiting
252d4577251a: Waiting
cce7d39fd11a: Waiting
def2e0229815: Waiting
67c0e0b910ae: Waiting
ded93963744d: Waiting
4f4fb700ef54: Waiting
0ea4431cabe6: Verifying Checksum
0ea4431cabe6: Download complete
0bc8ff246cb8: Verifying Checksum
0bc8ff246cb8: Download complete
ded93963744d: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
cce7d39fd11a: Verifying Checksum
cce7d39fd11a: Download complete
ffd44f50f2ea: Verifying Checksum
ffd44f50f2ea: Download complete
def2e0229815: Verifying Checksum
def2e0229815: Download complete
99993ea1b455: Verifying Checksum
99993ea1b455: Download complete
0bc8ff246cb8: Pull complete
252d4577251a: Verifying Checksum
252d4577251a: Download complete
3f42a6f68a35: Verifying Checksum
3f42a6f68a35: Download complete
67c0e0b910ae: Verifying Checksum
67c0e0b910ae: Download complete
0ea4431cabe6: Pull complete
ffd44f50f2ea: Pull complete
ded93963744d: Pull complete
4f4fb700ef54: Pull complete
3f42a6f68a35: Pull complete
cce7d39fd11a: Pull complete
67c0e0b910ae: Pull complete
def2e0229815: Pull complete
99993ea1b455: Pull complete
252d4577251a: Pull complete
Digest: sha256:f4194bdf6a5bd72b077a4d853d1c74400c485c79dee83e490056787c17d54b47
Status: Downloaded newer image for fyneio/fyne-cross-images:windows
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows mkdir -p /app/fyne-cross/bin/windows-amd64
[✓] "bin" dir cleaned: /app/fyne-cross/bin/windows-amd64
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows rm -rf /app/fyne-cross/dist/windows-amd64
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows mkdir -p /app/fyne-cross/dist/windows-amd64
[✓] "dist" dir cleaned: /app/fyne-cross/dist/windows-amd64
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows rm -rf /app/fyne-cross/tmp/windows-amd64
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows mkdir -p /app/fyne-cross/tmp/windows-amd64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/windows-amd64
[i] Checking for go.mod: /home/runner/work/tmx-uploader/tmx-uploader/go.mod
[✓] go.mod found
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows cp /app/Icon.png /app/fyne-cross/tmp/windows-amd64/Icon.png
[i] Packaging app...
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows /usr/local/bin/fyne version
fyne cli version: v2.3.5
/usr/bin/docker run --rm -t -w /app -v /home/runner/work/tmx-uploader/tmx-uploader:/app:z --platform linux/amd64 --user 1001 -e HOME=/tmp -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e GOOS=windows -e GOARCH=amd64 -e CC=zig cc -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows -e CXX=zig c++ -target x86_64-windows-gnu -Wdeprecated-non-prototype -Wl,--subsystem,windows docker.io/fyneio/fyne-cross-images:windows /usr/local/bin/fyne package -os windows -name tmx-uploader.exe -icon /app/fyne-cross/tmp/windows-amd64/Icon.png -appBuild 1 -appVersion 1.0.0 -appID pinpox.tmx.uploader -release
2024/05/15 13:13:37 Fyne error:  Failed to inject metadata init file, omitting metadata
2024/05/15 13:13:37   Cause: invalid character 'g' looking for beginning of value
2024/05/15 13:13:37   At: /go/pkg/mod/fyne.io/fyne/v2@v2.3.5/cmd/fyne/internal/commands/build.go:215
```

andydotxyz commented 3 months ago

I'm guessing but it would be good to clarify - the build completes correctly? The error is strangely specific to what sounds like a formatting error, but it seems like you don't use the FyneApp.toml file at all, is that correct also?

pinpox commented 3 months ago

I'm guessing but it would be good to clarify - the build completes correctly?

Yes, it finishes. I think it just does not apply any metdata

The error is strangely specific to what sounds like a formatting error, but it seems like you don't use the FyneApp.toml file at all, is that correct also?

That is correct, I have no toml file. Just the parameters as seen in the link above

andydotxyz commented 3 months ago

I think it just does not apply any metdata

The metadata won't be injected because it comes from the .toml file - it will use whatever parameters are passed instead.

The error is strange and confusing so something is not correct internally, but I think the output is completely correct given that your Fyne-cross execution did not pass in any metadata...

andydotxyz commented 2 months ago

Just for clarification (especially for the linked change) this is not an error that causes the build to exit, it is merely a error during processing that is printed to the console. Unless your CI assumes that logging = problem then this should not be an issue, it does not impact the return code.