Propagate tags when building with fyne cross
vboehr opened this issue · 10 comments
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):
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)"
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?
I did:
./fc version
and got:
fyne-cross version (devel)
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
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?
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
This issue is related to: fyne-io/fyne#3795