go-qml / qml

QML support for the Go language
Other
1.96k stars 187 forks source link

Can't install with Go version 1.4 #134

Open pebbe opened 9 years ago

pebbe commented 9 years ago

Can't install with Go version 1.4:

gopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo: tref.c
gopkg.in/qml.v1/bridge.go:16:2: C source files not allowed when not using cgo: cdata.c
gopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo: tref.c
gopkg.in/qml.v1/bridge.go:16:2: C source files not allowed when not using cgo: cdata.c
cookieo9 commented 9 years ago

Two things:

  1. You are using two different versions of go-qml (v0 and v1).
  2. You are probably using an old version of go-qml.

For the first, you need to fix the import statements in your code. For the second you need to call go get again.

The easy way to do both:

  1. Delete $GOPATH/src/gopkg.in/qml.v0 and $GOPATH/src/gopkg.in/qml.v1
  2. go get -v gopkg.in/qml.v1
  3. When you compile your code, you'll get errors from all the files importing v0 since only v1 was installed.

On Thu, Dec 11, 2014 at 3:53 AM, Peter Kleiweg notifications@github.com wrote:

Can't install with Go version 1.4:

gopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo: tref.cgopkg.in/qml.v1/bridge.go:16:2: C source files not allowed when not using cgo: cdata.cgopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo: tref.cgopkg.in/qml.v1/bridge.go:16:2: C source files not allowed when not using cgo: cdata.c

— Reply to this email directly or view it on GitHub https://github.com/go-qml/qml/issues/134.

geraldstanje commented 9 years ago

clear your gopath?

pebbe commented 9 years ago

@cookieo9 Updating for v1 works, but not for v0.

For v1: what happened to gopkg.in/qml.v1/work-in-progress/gl?

(peter) ~/go/src go get gopkg.in/qml.v0
gopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo: tref.c
(peter) ~/go/src go get -v gopkg.in/qml.v0/gl
(peter) ~/go/src go get -v gopkg.in/qml.v1
(peter) ~/go/src go get -v gopkg.in/qml.v1/work-in-progress/gl
Fetching https://gopkg.in/qml.v1/work-in-progress/gl?go-get=1
Parsing meta tags from https://gopkg.in/qml.v1/work-in-progress/gl?go-get=1 (status code 200)
get "gopkg.in/qml.v1/work-in-progress/gl": found meta tag main.metaImport{Prefix:"gopkg.in/qml.v1", VCS:"git", RepoRoot:"https://gopkg.in/qml.v1"} at https://gopkg.in/qml.v1/work-in-progress/gl?go-get=1
get "gopkg.in/qml.v1/work-in-progress/gl": verifying non-authoritative meta tag
Fetching https://gopkg.in/qml.v1?go-get=1
Parsing meta tags from https://gopkg.in/qml.v1?go-get=1 (status code 200)
gopkg.in/qml.v1 (download)
package gopkg.in/qml.v1/work-in-progress/gl
        imports gopkg.in/qml.v1/work-in-progress/gl
        imports gopkg.in/qml.v1/work-in-progress/gl: cannot find package "gopkg.in/qml.v1/work-in-progress/gl" in any of:
        /my/opt/go/src/gopkg.in/qml.v1/work-in-progress/gl (from $GOROOT)
        /home/peter/go/src/gopkg.in/qml.v1/work-in-progress/gl (from $GOPATH)
cookieo9 commented 9 years ago

v0 is deprecated, don't use it.

cookieo9 commented 9 years ago

It likely will not be updated to (for example) work with newer versions of Go.

Also it's less portable.

pebbe commented 9 years ago

I have old software that depends on v0.

cookieo9 commented 9 years ago

Don't use go 1.4, or update your code to use v1.

In general v0 versions are not meant for public consumption. As you noticed, the API changed in v0 for how to get access to gl. Even if v0 is updated to work with go 1.4, some parts of the API may have changed from when you used it.

BTW: The go compatibilty promise (go updates don't break your code) only applies to Go code (which uses the stdlib) not CGO.

cookieo9 commented 9 years ago

It's unfortunate if your old code is broken, but it was coded against an unstable API (http://gopkg.in#VersionZero).

It should be possible to patch the change to v1 back into v0 to fix the errors, but you will have to do it yourself, as any changes made to the official v0 will still be using a different API then the version of v0 used by your code.

cookieo9 commented 9 years ago

The commit which fixed v1 was b94596a6ddac9305f52c756f78cab8cb28de29af