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

Add support for passing custom build tags #1538

Closed
Stoyvo opened this issue Nov 15, 2020 · 6 comments
Closed

Add support for passing custom build tags #1538

Stoyvo opened this issue Nov 15, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@Stoyvo
Copy link

Stoyvo commented Nov 15, 2020

Describe the bug:

Fyne offers a package command, however package is also building. In my case, I need to compile my binary with TAGLIB, I use the following:
go build --tags "darwin libtag" -v

Fyne package should be responsible for the certificate, versioning, packaging, and the building should be optional, or provide a way to allow additional tags to be configured.

@andydotxyz
Copy link
Member

You can do this by telling the fyne tool that the binary already exists with the -executable parameter.
If that file is found it should not trigger a build.

@Stoyvo
Copy link
Author

Stoyvo commented Nov 15, 2020

@andydotxyz Yes, but the fyne tool has its own parameters for windows builds, Eg:
https://github.com/fyne-io/fyne/blob/master/cmd/fyne/commands/build.go#L24

	if goos == "windows" {
		if b.release {
			cmd = exec.Command("go", "build", "-ldflags", "-s -w -H=windowsgui", ".")
		} else {
			cmd = exec.Command("go", "build", "-ldflags", "-H=windowsgui", ".")
		}
	} else {
		if b.release {
			cmd = exec.Command("go", "build", "-ldflags", "-s -w", ".")
		} else {
			cmd = exec.Command("go", "build", ".")
		}
	}

If we provide that path, these flags aren't set unless we specify them specifically?

@andydotxyz
Copy link
Member

Yes that is correct. Currently you either build manually, or you get fyne to handle it for you.

@andydotxyz
Copy link
Member

Perhaps this ticket changes from a bug "Unable to package with custom build tags" to a feature request "Add support for passing custom build tags"?

@andydotxyz
Copy link
Member

This could be related to fyne-io/fyne-cross#5

@Stoyvo
Copy link
Author

Stoyvo commented Nov 15, 2020

Perhaps this ticket changes from a bug "Unable to package with custom build tags" to a feature request "Add support for passing custom build tags"?

@andydotxyz I agree with this, or we can track this as a documentation enhancement to better define what parameters are required for each OS.

@andydotxyz andydotxyz added the enhancement New feature or request label Nov 15, 2020
@Stoyvo Stoyvo changed the title Unable to package with custom build tags Add support for passing custom build tags Nov 15, 2020
@lucor lucor self-assigned this Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants