Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with fyne release does not set Metadata().Release to true #4711

Closed
2 tasks done
rad756 opened this issue Mar 10, 2024 · 11 comments
Closed
2 tasks done

Building with fyne release does not set Metadata().Release to true #4711

rad756 opened this issue Mar 10, 2024 · 11 comments
Labels
information-needed Further information is requested

Comments

@rad756
Copy link

rad756 commented Mar 10, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Building with fyne release does not set Metadata().Release to true.
Also affects building with fyne-cross

How to reproduce

Build the code in example with fyne release or fyne-cross and it prints out test to the terminal where it should print out prod.

Screenshots

No response

Example code


import (
	"fmt"

	"fyne.io/fyne/v2/app"
)

func main() {
	a := app.New()

	if a.Metadata().Release {
		a = app.NewWithID("com.example.app")
		fmt.Println("prod")
	} else {
		a = app.NewWithID("com.example.app.test")
		fmt.Println("test")
	}
}```

### Fyne version

2.4.4

### Go compiler version

go version go1.21.8 linux/amd64

### Operating system and version

openSUSE Tumbleweed x86_64

### Additional Information

When building with fyne build --release it prints out prod to terminal
@rad756 rad756 added the unverified A bug that has been reported but not verified label Mar 10, 2024
@andydotxyz
Copy link
Member

What is the release of the fyne command line? (fyne --version)

@andydotxyz andydotxyz added bug Something isn't working blocker Items that would block a forthcoming release and removed unverified A bug that has been reported but not verified labels Apr 2, 2024
@andydotxyz andydotxyz added this to the D fixes (v2.4.x) milestone Apr 2, 2024
@andydotxyz andydotxyz added information-needed Further information is requested and removed bug Something isn't working blocker Items that would block a forthcoming release labels Apr 2, 2024
@andydotxyz
Copy link
Member

I thought I could replicate this but I cannot. The fyne release command hard-codes release bool to true so I'm at a loss as to what is happening here...

@rad756
Copy link
Author

rad756 commented Apr 2, 2024

The output of fyne --version is "fyne version v2.4.4"

I tried to run the above code with

  • go run .
  • fyne build (the built binary)
  • fyne release (the built binary)

For each the string printed to terminal was test
The release should print out prod, correct?

@rad756
Copy link
Author

rad756 commented Apr 2, 2024

Maybe this is for some reason a platform specific bug, are you trying to check this only on MacOS? Or also tried it on Windows and Linux? I do not have a windows install with the dev enviornment setup right now, I could check it another day on Windows if it could help track down the core of this issue

@andydotxyz
Copy link
Member

I tried to run the above code with

go run .
fyne build (the built binary)
fyne release (the built binary)

The last "the built binary" is concerning me - did you clear out the previous one before testing release? What was the path to the release binary that you tested?

@rad756
Copy link
Author

rad756 commented Apr 3, 2024

I deleted the binary that built with fyne build first. Then I ran fyne release which created an archive which I extracted and ran that extracted binary

@andydotxyz
Copy link
Member

Can you please compile the tool locally with a log of "b.release" on line 199 of cmd/fyne/internal/commands/build.go (inside build() function). That way we can see if false is being passed in somehow. If so then a "debug.PrintStack" would help a lot.

@rad756
Copy link
Author

rad756 commented Apr 3, 2024

Just so I understand you correctly, you would like for me to compile fyne v2.4.4 locally with the changes you requested above?

@rad756
Copy link
Author

rad756 commented Apr 3, 2024

Locally compiled source code (go install .) for fyne v2.4.4 with the addition of "log.Println(b.release)".
Compiling the above code snippet with fyne release and running the built binary, metadata is false but the log during compiling is true.

Tried to do the same with "fyne package - os linux --release". Log during compile was true but after running the executed binary the metadata was true this time.

Doing the same with "fyne package - os linux" goes to false on both compile log and print of executed binary.

@andydotxyz
Copy link
Member

Thanks this has been very helpful, PR inbound

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Apr 4, 2024
Fixes fyne-io#4711 which was somehow Linux specific
@andydotxyz
Copy link
Member

Resolved for v2.4.5 and 2.5 on develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information-needed Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants