Code Monkey home page Code Monkey logo

Comments (14)

Jacalz avatar Jacalz commented on August 24, 2024 1

"go get is no longer supported outside of a module in the legacy GOPATH mode (that is, with GO111MODULE=off). Other build commands, such as go build and go test, will continue to work indefinitely for legacy GOPATH programs. " from https://tip.golang.org/doc/go1.22. I think we need to patch cmd/fyne for the v2.4.5 release (and backport to the tools repo).

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024 1

@Jacalz are we saying that the Fyne command line tool is essentially ignoring what is configured for GO111MODULE and setting it to off regardless? That would certainly make sense and explain why I couldn't understand what was going on.

Yes and no. It is forcing it to off because it made sense earlier versions when go get would add the packages to your go.mod file if you installed a package from within a Go module folder. Go versions have since removed the support for installing binaries using go get for that reason. The fix is to update

cmd := execabs.Command("go", "get", "-u", "-d", pkg)
cmd.Env = append(os.Environ(), "GO111MODULE=off") // cache the downloaded code
to remove the environment variable and use go install with @latest at the end :)

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024 1

There is a genuine bug here. Lack of support for Go 1.22 to be specific. Let's get a fix into the next bug fix release :)

from fyne.

andydotxyz avatar andydotxyz commented on August 24, 2024

Hmm, this is weird.
Do you get the same if you try "go install" instead of "fyne get"?

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024

I think Go 1.22 is unsupported by fyne get. Didn't they remove the support for GO111MODULE=off?

from fyne.

Guddler avatar Guddler commented on August 24, 2024

Thanks for the reply. I get this:

go install github.com/fyne-io/fyne/cmd/fyne_settings@latest
go: github.com/fyne-io/fyne/cmd/fyne_settings@latest (in github.com/fyne-io/[email protected]):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

At this point I'm questioning if my Go install is still sane. I would clear it out and start fresh but I have to be careful as I have a small proxy application to support in production. I'm basically trying to review UI frameworks and find one for some simple desktop tools.

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024

You are missing a v2 in the import path: Try go install github.com/fyne-io/fyne/v2/cmd/fyne_settings@latest :)

from fyne.

Guddler avatar Guddler commented on August 24, 2024
go install github.com/fyne-io/fyne/v2/cmd/fyne_settings@latest
go: downloading github.com/fyne-io/fyne/v2 v2.4.4
go: github.com/fyne-io/fyne/v2/cmd/fyne_settings@latest: version constraints conflict:
        github.com/fyne-io/fyne/[email protected]: parsing go.mod:
        module declares its path as: fyne.io/fyne/v2
                but was required as: github.com/fyne-io/fyne/v2

That does feel like an improvement.

@Jacalz are we saying that the Fyne command line tool is essentially ignoring what is configured for GO111MODULE and setting it to off regardless? That would certainly make sense and explain why I couldn't understand what was going on.

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024

Sorry. My fault for giving you the wrong path. Try go install fyne.io/fyne/v2/cmd/fyne_settings@latest instead. You should never try to import using github.com for our project. It is the wrong import path.

from fyne.

Guddler avatar Guddler commented on August 24, 2024

@Jacalz Thank you - that works. I did try changing the URL but still had github in there.

To be clear, for my current purposes, I don't NEED this and am now fine to progress with evaluation. But if there is an actual issue here then please leave it open. Otherwise, I'm happy to close since using go install get's me past the hurdle I was having.

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024

You are more than welcome to reach out if you find more problems or just need help. The Gophers slack at #fyne is where we usually hang out.

from fyne.

Guddler avatar Guddler commented on August 24, 2024

Thank you!

from fyne.

andydotxyz avatar andydotxyz commented on August 24, 2024

@Jacalz are we saying that the Fyne command line tool is essentially ignoring what is configured for GO111MODULE and setting it to off regardless? That would certainly make sense and explain why I couldn't understand what was going on.

Yes and no. It is forcing it to off because it made sense earlier versions when go get would add the packages to your go.mod file if you installed a package from within a Go module folder. Go versions have since removed the support for installing binaries using go get for that reason. The fix is to update

cmd := execabs.Command("go", "get", "-u", "-d", pkg)
cmd.Env = append(os.Environ(), "GO111MODULE=off") // cache the downloaded code

to remove the environment variable and use go install with @latest at the end :)

The summary is great, but the conclusion over simplifies.
So as a note to anyone who comes in to solve this - the "go get with modules off" is required because it's side-effect is downloading the source code to a known location so we can then package it. If we just delegate to "go install" it won't build and install the graphical version.
So it may be that "git clone" plus "go mod tidy" may be the replacement for "go get" in this case...

from fyne.

Jacalz avatar Jacalz commented on August 24, 2024

Right. Good point. That is indeed problematic.

from fyne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.