fyne-io / fyne-cross

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

"flag provided but not defined: -profile" when trying to build a MacOS release application #223

Open philiplb opened 8 months ago

philiplb commented 8 months ago

Describe the bug:

I'm trying to use fyne-cross to build and package a MacOS application in the release mode. When I do so, I get the error message "flag provided but not defined: -profile".

To Reproduce:

Steps to reproduce the behaviour:

Run the command

version="1.0.0"
fyne-cross darwin -arch=arm64,amd64 -app-id=<appId> -release -profile <profileName> -name <myName> -app-version "$version"

With the app-id and the name being the same as in the profile.

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

Device info
Debug info
flag provided but not defined: -profile

Usage: fyne-cross darwin [options] [package]

Build and package a fyne application for the darwin OS

Options:
  -app-build int
        Build number, should be greater than 0 and incremented for each build (default 1)
  -app-id string
        Application ID used for distribution [required]
  ...
andydotxyz commented 8 months ago

Isn't the profile parameter only needed for iOS builds?

philiplb commented 8 months ago

It's asking for it if I don't give it:

missing required -profile parameter for macOS release Here is the output of fyne-cross darwin -arch=arm64,amd64 -app-id=<appId> -release -name <myName> -app-version "$version" -no-cache -debug

[i] Target: darwin/arm64
&command.localContainerImage{baseContainerImage:command.baseContainerImage{arch:"arm64", os:"darwin", id:"darwin-arm64", env:map[string]string{"CC":"zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks", "CGO_LDFLAGS":"--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib", "CXX":"zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks", "GOARCH":"arm64", "GOOS":"darwin"}, tags:[]string(nil), mount:[]command.containerMountPoint{command.containerMountPoint{name:"project", localHost:"/Users/<user>/repos/<appname>/src", inContainer:"/app"}}, DockerImage:"docker.io/fyneio/fyne-cross-images:darwin"}, runner:(*command.localContainerEngine)(0x1400009e000)}
[i] Cleaning target directories...
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin -e GOARCH=arm64 docker.io/fyneio/fyne-cross-images:darwin rm -rf /app/fyne-cross/bin/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin docker.io/fyneio/fyne-cross-images:darwin mkdir -p /app/fyne-cross/bin/darwin-arm64
[✓] "bin" dir cleaned: /app/fyne-cross/bin/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin docker.io/fyneio/fyne-cross-images:darwin rm -rf /app/fyne-cross/dist/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOOS=darwin -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib docker.io/fyneio/fyne-cross-images:darwin mkdir -p /app/fyne-cross/dist/darwin-arm64
[✓] "dist" dir cleaned: /app/fyne-cross/dist/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOOS=darwin -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib docker.io/fyneio/fyne-cross-images:darwin rm -rf /app/fyne-cross/tmp/darwin-arm64
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib -e GOOS=darwin docker.io/fyneio/fyne-cross-images:darwin mkdir -p /app/fyne-cross/tmp/darwin-arm64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/darwin-arm64
[i] Checking for go.mod: /Users/<user>/repos/<appname>/src/go.mod
[✓] go.mod found
/usr/local/bin/docker run --rm -t -w /app -v /Users/<user>/repos/<appname>/src:/app --platform linux/arm64 --user 501 -e HOME=/tmp -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e "GOFLAGS=-ldflags=-s -ldflags=-w" -e GOOS=darwin -e GOARCH=arm64 -e CC=zig cc -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CXX=zig c++ -v -target aarch64-macos.11.1 -isysroot /sdk -iwithsysroot /usr/include -iframeworkwithsysroot /System/Library/Frameworks -e CGO_LDFLAGS=--sysroot /sdk -F/System/Library/Frameworks -L/usr/lib docker.io/fyneio/fyne-cross-images:darwin cp /app/Icon.png /app/fyne-cross/tmp/darwin-arm64/Icon.png
[i] Packaging app...
fyne cli version: v2.4.3
/Users/<user>/go/bin/fyne release -os darwin -name <appname> -icon /Users/<user>/repos/<appname>/src/fyne-cross/tmp/darwin-arm64/Icon.png -appBuild 1 -appVersion 1.0.0 -appID com.<appname>
missing required -profile parameter for macOS release
[✗] could not package the Fyne app: could not package the Fyne app: exit status 1
andydotxyz commented 8 months ago

Oh I remember now. Are you trying to ship it for the macOS store?

philiplb commented 8 months ago

Not for the App-store, but you have to sign it when you want to execute an app being distributed in a .dmg. MacOS just says that it is damaged if it is downloaded. Rightclick and selecting "Open" doesn't work, too. If I execute the app directly after building, everything is fine.

andydotxyz commented 8 months ago

Ah. Release mode is for the store distribution. I guess you're referring to the notarisation issue mentioned at https://docs.fyne.io/faq/troubleshoot

philiplb commented 8 months ago

Ah, yes, that might be :) But as I already enrolled now in the Apple developer program and created a certificate and distribution profile, I will go through this process now: https://stackoverflow.com/questions/69354021/how-do-i-go-about-code-signing-a-macos-application And see how it goes. Looks a bit tedious...

Antiarchitect commented 5 months ago

Seems kinda similar to me:

fyne-cross darwin -macosx-sdk-path ~/Downloads/SDKs/MacOSX11.3.sdk/ -arch amd64,arm64 ./cmd/seenday/
flag provided but not defined: -w"
usage: link [options] main.o
andydotxyz commented 5 months ago

The error may seem similar but it's very different - that is an error with the compilation process, but this ticket is reporting an issue with command line parameters into Fyne-cross itself