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

Propagate tags when building with fyne cross #200

Open
vboehr opened this issue Jul 21, 2023 · 10 comments
Open

Propagate tags when building with fyne cross #200

vboehr opened this issue Jul 21, 2023 · 10 comments

Comments

@vboehr
Copy link

vboehr commented Jul 21, 2023

Describe the bug:

I am trying to cross package from ubuntu an windows fyne app that uses the following torrent library:
github.com/anacrolix/torrent

Yet after and running it the app stops.

Even though normaly --tags=disable_libutp should have fixed the torrent library "github.com/anacrolix/torrent" it does not. This means that fyne cross do not propagate tags when cross building.

Note this bug is similar to the one discribed here;
fyne-io/fyne#3641

To Reproduce:

create a new go mod
go mod init fynetorrentguiapp

go get fyne.io/fyne/v2

go get github.com/anacrolix/torrent

touch main.go

add the example code include below

package the app with fyne cross as follow:
sudo ./fc windows -arch=* -app-id=fynetorrentapp.app.testapp -icon=./Icon.png --tags=disable_libutp

run it on windows.

Example code:

'''go
package main
import (
"log"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/canvas"
"image/color"
"time"
"fmt"
"github.com/anacrolix/torrent"
)
var mainapp fyne.App
var AppLocation string
var MainTorrent string//magnet
var MainFile string//filepath
var AppIsClosing bool
func main() {
mainapp= app.New()
AppIsClosing=false
AppLocation=mainapp.Storage().RootURI().String()
fmt.Println("AppLocation :",AppLocation)
mainwin := mainapp.NewWindow("wetorrent")
mainwin.Resize(fyne.NewSize(400, 710))
go initmainclient()
tabs := container.NewAppTabs(
container.NewTabItem("Home", homeScreen(mainwin)),
)
tabs.SetTabLocation(container.TabLocationTop)
mainwin.SetContent(tabs)
mainwin.ShowAndRun()
AppIsClosing=true
}
func homeScreen(win fyne.Window) fyne.CanvasObject {
data := binding.BindStringList(
//&[]string{"Item 1", "Item 2", "Item 3"},
&[]string{},
)
list := widget.NewListWithData(data,
func() fyne.CanvasObject {
return widget.NewLabel("template")
},
func(i binding.DataItem, o fyne.CanvasObject) {
o.(*widget.Label).Bind(i.(binding.String))
})
text := canvas.NewText("Text Object"+AppLocation, color.Black)
add := widget.NewButton("Open New Webapp Tab", func() {
//val := fmt.Sprintf("Item %d", data.Length()+1)
//data.Append(val)
fmt.Println("coool")
})
return container.NewBorder( text,add, nil, nil, list)
}
var mainclient * torrent.Client
func initmainclient() {
cfg := torrent.NewDefaultClientConfig()
//cfg.Seed = true
cfg.DataDir=AppLocation//
//cfg.NoDHT = true
//cfg.DisableTCP = true
//cfg.DisableUTP = true
//cfg.DisableAggressiveUpload = false
//cfg.DisableWebtorrent = false
//cfg.DisableWebseeds = false
var err error
mainclient, err = torrent.NewClient(cfg)
if err != nil {
log.Print("new torrent client: %w", err)
return //fmt.Errorf("new torrent client: %w", err)
}
log.Print("new torrent client INITIATED")
defer mainclient.Close()
for {
if AppIsClosing {
log.Print("closing mainclient")
break
}
time.Sleep(1 * time.Second)
}
//
}
''''

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

Device info

Fyne version

v2.3.0

Go compiler version

go1.20 linux/amd64

Operating system

Linux

Operating system version

Ubuntu 18.04.6 LTS (Bionic Beaver)

Additional Information

Go module info

cli_version="(devel)"
go_mod="true"
go_path="false"
imported="true"
path="***********"
version="v2.3.0"

Go version info

version="go1.20 linux/amd64"

Go environment info

CGO_ENABLED="1"
GO111MODULE=""
GOARCH="amd64"
GOOS="linux"

OS info

architecture="x86_64"
home_url="https://www.ubuntu.com/"
kernel="Linux 5.4.0-137-generic #154~18.04.1-Ubuntu SMP Tue Jan 10 16:58:20 UTC 2023"
name="Ubuntu"
version="18.04.6 LTS (Bionic Beaver)"

@Bluebugs
Copy link
Contributor

I am not certain we support --tags=yourtag as the form of parameters. Did you try -tags yourtag. Also what version of fyne-cross do you use?

@vboehr
Copy link
Author

vboehr commented Jul 24, 2023

I did:
./fc version
and got:
fyne-cross version (devel)

@vboehr
Copy link
Author

vboehr commented Jul 24, 2023

Also I tried :
sudo ./fc windows -arch=* -app-id globaldcegateway.app.testapp -icon ./Icon.png -tags disable_libutp

But the app still does not work

@vboehr
Copy link
Author

vboehr commented Jul 24, 2023

fyne-win
I apologize it is in French. It basically says that libwinpthread-1.dll is missing

@Bluebugs
Copy link
Contributor

I guess we should apologize for being French :-) More seriously, the devel version returned indicate you did build maybe not from the master branch. Would you mind pulling the latest version of fyne-cross and checking if the error is still there?

@vboehr
Copy link
Author

vboehr commented Jul 27, 2023

I built a new fyne-cross as follows:
git clone https://github.com/fyne-io/fyne-cross/
go build .

after that I did:
sudo ./fc windows -arch=* -app-id fynetorrentapp.app.testapp -icon ./Icon.png -tags disable_libutp

and got:
[i] Target: windows/amd64
[i] Cleaning target directories...
[✓] "dist" dir cleaned: /app/fyne-cross/dist/windows-amd64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/windows-amd64
[✓] "bin" dir cleaned: /app/fyne-cross/bin/windows-amd64
[i] Checking for go.mod: /home/gutenberg/Documents/fynetorrentapp/go.mod
[✓] go.mod found
[i] Packaging app...
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.

error building application: exit status 1
[✗] could not package the Fyne app: exit status 1

@EmmettKim93
Copy link

This issue is related to: fyne-io/fyne#3795

@junmaqiang
Copy link

me tooo , I have this problen

@junmaqiang
Copy link

junmaqiang commented Oct 14, 2023

截屏2023-10-14 23 46 32

look this ENV FYNE_VERSION=v2.3.5

but I use Fyne v2.4.0 and golang v1.21.3

@junmaqiang
Copy link

junmaqiang commented Oct 14, 2023

截屏2023-10-14 23 52 45

Image is too big

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants