revel/examples

Can't compile booking

Closed this issue · 3 comments

Hey guys,
Long time no talk to.
Impressed with how far the project has come over the last year, and thought I would try it out again.

Had a couple of easy, minor issues with dependencies, but was able to resolve them.

Now I'm having an issue with the booking app not compiling.

Here's my stack trace:

ERROR 2015/10/23 03:48:10 build.go:101: # github.com/revel/modules/jobs/app/jobs
../src/github.com/revel/modules/jobs/app/jobs/job.go:4: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/modules/static/app/controllers
../src/github.com/revel/modules/static/app/controllers/static.go:4: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/samples/booking/app
../src/github.com/revel/samples/booking/app/init.go:3: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/modules/db/app
../src/github.com/revel/modules/db/app/db.go:14: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/samples/booking/app/models
../src/github.com/revel/samples/booking/app/models/booking.go:5: import /home/m/go_path/pkg/linux_amd64/github.com/go-gorp/gorp.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]
# github.com/revel/samples/booking/app/routes
../src/github.com/revel/samples/booking/app/routes/routes.go:4: import /home/m/go_path/pkg/linux_amd64/github.com/revel/revel.a: object is [linux amd64 go1.2.1 X:none] expected [linux amd64 go1.5 X:none]

What am I doing wrong?

Thanks.

Okay,
So got through the first part of it. There is a file ending in .a that hard wires revel and a couple of the dependencies into go 1.2x. When I update it to 1.5, I start getting reflection errors.

Here's my new trace.

root@WarrenSandbox:/home/m/go_path/bin# ./revel build github.com/revel/samples/booking $GOPATH/bin/booking
~
~ revel! http://revel.github.io
~
INFO  2015/10/23 04:06:42 revel.go:329: Loaded module static
INFO  2015/10/23 04:06:42 revel.go:329: Loaded module jobs
INFO  2015/10/23 04:06:42 revel.go:206: Initialized Revel v0.12.0 (2015-03-25) for >= go1.3
INFO  2015/10/23 04:06:42 build.go:172: Cleaning dir tmp
INFO  2015/10/23 04:06:42 build.go:172: Cleaning dir routes
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: database/sql
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: fmt
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: strings
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: fmt
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: fmt
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: regexp
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: time
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: fmt
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: regexp
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: os
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: strings
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: syscall
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: strings
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: strings
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: time
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: fmt
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: reflect
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: runtime/debug
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: sync
TRACE 2015/10/23 04:06:42 reflect.go:299: Could not find import: sync/atomic
INFO  2015/10/23 04:06:42 build.go:172: Cleaning dir tmp
INFO  2015/10/23 04:06:42 build.go:172: Cleaning dir routes
TRACE 2015/10/23 04:06:42 build.go:94: Exec: [/usr/local/go/bin/go build -ldflags -X github.com/revel/samples/booking/app.APP_VERSION "" -tags gorp -o /home/m/go_path/bin/revel.d/github.com/revel/samples/booking/booking github.com/revel/samples/booking/app/tmp]
ERROR 2015/10/23 04:07:23 build.go:101: # github.com/revel/modules/jobs/app/jobs
../src/github.com/revel/modules/jobs/app/jobs/job.go:6: inconsistent definition for type reflect.Type during import
    interface { Align() int; AssignableTo(reflect.Type) bool; Bits() int; ChanDir() reflect.ChanDir; ConvertibleTo(reflect.Type) bool; Elem() reflect.Type; Field(int) reflect.StructField; FieldAlign() int; FieldByIndex([]int) reflect.StructField; FieldByName(string) (reflect.StructField, bool); FieldByNameFunc(func(string) bool) (reflect.StructField, bool); Implements(reflect.Type) bool; In(int) reflect.Type; IsVariadic() bool; Key() reflect.Type; Kind() reflect.Kind; Len() int; Method(int) reflect.Method; MethodByName(string) (reflect.Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(int) reflect.Type; PkgPath() string; Size() uintptr; String() string; reflect.common() *reflect.rtype; reflect.uncommon() *reflect.uncommonType } (in "github.com/revel/revel")
    interface { Align() int; AssignableTo(reflect.Type) bool; Bits() int; ChanDir() reflect.ChanDir; Comparable() bool; ConvertibleTo(reflect.Type) bool; Elem() reflect.Type; Field(int) reflect.StructField; FieldAlign() int; FieldByIndex([]int) reflect.StructField; FieldByName(string) (reflect.StructField, bool); FieldByNameFunc(func(string) bool) (reflect.StructField, bool); Implements(reflect.Type) bool; In(int) reflect.Type; IsVariadic() bool; Key() reflect.Type; Kind() reflect.Kind; Len() int; Method(int) reflect.Method; MethodByName(string) (reflect.Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(int) reflect.Type; PkgPath() string; Size() uintptr; String() string; reflect.common() *reflect.rtype; reflect.uncommon() *reflect.uncommonType } (in "reflect")
../src/github.com/revel/modules/jobs/app/jobs/job.go:6: inconsistent definition for type reflect.rtype during import
    struct { size uintptr; hash uint32; _ uint8; align uint8; fieldAlign uint8; kind uint8; alg *uintptr; gc unsafe.Pointer; string *string; *reflect.uncommonType; ptrToThis *reflect.rtype } (in "github.com/revel/revel")
    struct { size uintptr; ptrdata uintptr; hash uint32; _ uint8; align uint8; fieldAlign uint8; kind uint8; alg *reflect.typeAlg; gcdata *byte; string *string; *reflect.uncommonType; ptrToThis *reflect.rtype; zero unsafe.Pointer } (in "reflect")
../src/github.com/revel/modules/jobs/app/jobs/job.go:6: inconsistent definition for type reflect.Value during import
    struct { typ *reflect.rtype; val unsafe.Pointer; reflect.flag } (in "github.com/revel/revel")
    struct { typ *reflect.rtype; ptr unsafe.Pointer; reflect.flag } (in "reflect")
../src/github.com/revel/modules/jobs/app/jobs/job.go:6: method redeclared: reflect.Value.reflect.assignTo
    method(reflect.Value) func(string, *reflect.rtype, *interface {}) reflect.Value
    method(reflect.Value) func(string, *reflect.rtype, unsafe.Pointer) reflect.Value
../src/github.com/revel/modules/jobs/app/jobs/job.go:7: inconsistent definition for type time.Time during import
    struct { sec int64; nsec uintptr; loc *time.Location } (in "github.com/revel/revel")
    struct { sec int64; nsec int32; loc *time.Location } (in "runtime/debug")
../src/github.com/revel/modules/jobs/app/jobs/jobrunner.go:17: inconsistent definition for type time.Time during import
    struct { sec int64; nsec uintptr; loc *time.Location } (in "github.com/revel/revel")
    struct { sec int64; nsec int32; loc *time.Location } (in "time")
# github.com/revel/modules/static/app/controllers
../src/github.com/revel/modules/static/app/controllers/static.go:5: inconsistent definition for type time.Time during import
    struct { sec int64; nsec uintptr; loc *time.Location } (in "github.com/revel/revel")
    struct { sec int64; nsec int32; loc *time.Location } (in "os")
../src/github.com/revel/modules/static/app/controllers/static.go:6: inconsistent definition for type time.Time during import
    struct { sec int64; nsec uintptr; loc *time.Location } (in "github.com/revel/revel")
    struct { sec int64; nsec int32; loc *time.Location } (in "path/filepath")
# github.com/revel/revel/testing
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type time.Time during import
    struct { sec int64; nsec int32; loc *time.Location } (in "io/ioutil")
    struct { sec int64; nsec uintptr; loc *time.Location } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type url.URL during import
    struct { Scheme string; Opaque string; User *url.Userinfo; Host string; Path string; RawPath string; RawQuery string; Fragment string } (in "net/http")
    struct { Scheme string; Opaque string; User *url.Userinfo; Host string; Path string; RawQuery string; Fragment string } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: method redeclared: big.nat.big.scan
    method(big.nat) func(io.ByteScanner, int, bool) (big.nat, int, int, error)
    method(big.nat) func(io.RuneScanner, int) (big.nat, int, error)
../src/github.com/revel/revel/testing/testsuite.go:19: method redeclared: big.Int.big.scan
    method(*big.Int) func(io.ByteScanner, int) (*big.Int, int, error)
    method(*big.Int) func(io.RuneScanner, int) (*big.Int, int, error)
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type pkix.Name during import
    struct { Country []string; Organization []string; OrganizationalUnit []string; Locality []string; Province []string; StreetAddress []string; PostalCode []string; SerialNumber string; CommonName string; Names []pkix.AttributeTypeAndValue; ExtraNames []pkix.AttributeTypeAndValue } (in "net/http")
    struct { Country []string; Organization []string; OrganizationalUnit []string; Locality []string; Province []string; StreetAddress []string; PostalCode []string; SerialNumber string; CommonName string; Names []pkix.AttributeTypeAndValue } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type pkix.TBSCertificateList during import
    struct { Raw asn1.RawContent; Version int "asn1:\"optional,default:1\""; Signature pkix.AlgorithmIdentifier; Issuer pkix.RDNSequence; ThisUpdate time.Time; NextUpdate time.Time "asn1:\"optional\""; RevokedCertificates []pkix.RevokedCertificate "asn1:\"optional\""; Extensions []pkix.Extension "asn1:\"tag:0,optional,explicit\"" } (in "net/http")
    struct { Raw asn1.RawContent; Version int "asn1:\"optional,default:2\""; Signature pkix.AlgorithmIdentifier; Issuer pkix.RDNSequence; ThisUpdate time.Time; NextUpdate time.Time; RevokedCertificates []pkix.RevokedCertificate "asn1:\"optional\""; Extensions []pkix.Extension "asn1:\"tag:0,optional,explicit\"" } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type x509.Certificate during import
    struct { Raw []byte; RawTBSCertificate []byte; RawSubjectPublicKeyInfo []byte; RawSubject []byte; RawIssuer []byte; Signature []byte; SignatureAlgorithm x509.SignatureAlgorithm; PublicKeyAlgorithm x509.PublicKeyAlgorithm; PublicKey interface {}; Version int; SerialNumber *big.Int; Issuer pkix.Name; Subject pkix.Name; NotBefore time.Time; NotAfter time.Time; KeyUsage x509.KeyUsage; Extensions []pkix.Extension; ExtraExtensions []pkix.Extension; UnhandledCriticalExtensions []asn1.ObjectIdentifier; ExtKeyUsage []x509.ExtKeyUsage; UnknownExtKeyUsage []asn1.ObjectIdentifier; BasicConstraintsValid bool; IsCA bool; MaxPathLen int; MaxPathLenZero bool; SubjectKeyId []byte; AuthorityKeyId []byte; OCSPServer []string; IssuingCertificateURL []string; DNSNames []string; EmailAddresses []string; IPAddresses []net.IP; PermittedDNSDomainsCritical bool; PermittedDNSDomains []string; CRLDistributionPoints []string; PolicyIdentifiers []asn1.ObjectIdentifier } (in "net/http")
    struct { Raw []byte; RawTBSCertificate []byte; RawSubjectPublicKeyInfo []byte; RawSubject []byte; RawIssuer []byte; Signature []byte; SignatureAlgorithm x509.SignatureAlgorithm; PublicKeyAlgorithm x509.PublicKeyAlgorithm; PublicKey interface {}; Version int; SerialNumber *big.Int; Issuer pkix.Name; Subject pkix.Name; NotBefore time.Time; NotAfter time.Time; KeyUsage x509.KeyUsage; Extensions []pkix.Extension; ExtraExtensions []pkix.Extension; ExtKeyUsage []x509.ExtKeyUsage; UnknownExtKeyUsage []asn1.ObjectIdentifier; BasicConstraintsValid bool; IsCA bool; MaxPathLen int; SubjectKeyId []byte; AuthorityKeyId []byte; OCSPServer []string; IssuingCertificateURL []string; DNSNames []string; EmailAddresses []string; IPAddresses []net.IP; PermittedDNSDomainsCritical bool; PermittedDNSDomains []string; CRLDistributionPoints []string; PolicyIdentifiers []asn1.ObjectIdentifier } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type tls.ConnectionState during import
    struct { Version uint16; HandshakeComplete bool; DidResume bool; CipherSuite uint16; NegotiatedProtocol string; NegotiatedProtocolIsMutual bool; ServerName string; PeerCertificates []*x509.Certificate; VerifiedChains [][]*x509.Certificate; SignedCertificateTimestamps [][]byte; OCSPResponse []byte; TLSUnique []byte } (in "net/http")
    struct { HandshakeComplete bool; DidResume bool; CipherSuite uint16; NegotiatedProtocol string; NegotiatedProtocolIsMutual bool; ServerName string; PeerCertificates []*x509.Certificate; VerifiedChains [][]*x509.Certificate } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type http.Request during import
    struct { Method string; URL *url.URL; Proto string; ProtoMajor int; ProtoMinor int; Header http.Header; Body io.ReadCloser; ContentLength int64; TransferEncoding []string; Close bool; Host string; Form url.Values; PostForm url.Values; MultipartForm *multipart.Form; Trailer http.Header; RemoteAddr string; RequestURI string; TLS *tls.ConnectionState; Cancel <-chan struct {} } (in "net/http")
    struct { Method string; URL *url.URL; Proto string; ProtoMajor int; ProtoMinor int; Header http.Header; Body io.ReadCloser; ContentLength int64; TransferEncoding []string; Close bool; Host string; Form url.Values; PostForm url.Values; MultipartForm *multipart.Form; Trailer http.Header; RemoteAddr string; RequestURI string; TLS *tls.ConnectionState } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: inconsistent definition for type tls.Certificate during import
    struct { Certificate [][]byte; PrivateKey crypto.PrivateKey; OCSPStaple []byte; SignedCertificateTimestamps [][]byte; Leaf *x509.Certificate } (in "net/http")
    struct { Certificate [][]byte; PrivateKey crypto.PrivateKey; OCSPStaple []byte; Leaf *x509.Certificate } (in "github.com/revel/revel")
../src/github.com/revel/revel/testing/testsuite.go:19: too many errors
# github.com/revel/samples/booking/app/models
../src/github.com/revel/samples/booking/app/models/booking.go:7: method redeclared: syntax.Prog.syntax.skipNop
    method(*syntax.Prog) func(uint32) *syntax.Inst
    method(*syntax.Prog) func(uint32) (*syntax.Inst, uint32)
../src/github.com/revel/samples/booking/app/models/booking.go:7: inconsistent definition for type regexp.machine during import
    struct { re *regexp.Regexp; p *syntax.Prog; q0 regexp.queue; q1 regexp.queue; pool []*regexp.thread; matched bool; matchcap []int; inputBytes regexp.inputBytes; inputString regexp.inputString; inputReader regexp.inputReader } (in "github.com/revel/revel")
    struct { re *regexp.Regexp; p *syntax.Prog; op *regexp.onePassProg; maxBitStateLen int; b *regexp.bitState; q0 regexp.queue; q1 regexp.queue; pool []*regexp.thread; matched bool; matchcap []int; inputBytes regexp.inputBytes; inputString regexp.inputString; inputReader regexp.inputReader } (in "regexp")
../src/github.com/revel/samples/booking/app/models/booking.go:7: inconsistent definition for type regexp.Regexp during import
    struct { expr string; prog *syntax.Prog; prefix string; prefixBytes []byte; prefixComplete bool; prefixRune rune; cond syntax.EmptyOp; numSubexp int; subexpNames []string; longest bool; mu sync.Mutex; machine []*regexp.machine } (in "github.com/revel/revel")
    struct { expr string; prog *syntax.Prog; onepass *regexp.onePassProg; prefix string; prefixBytes []byte; prefixComplete bool; prefixRune rune; prefixEnd uint32; cond syntax.EmptyOp; numSubexp int; subexpNames []string; longest bool; mu sync.Mutex; machine []*regexp.machine } (in "regexp")
../src/github.com/revel/samples/booking/app/models/booking.go:8: inconsistent definition for type time.Time during import
    struct { sec int64; nsec uintptr; loc *time.Location } (in "github.com/go-gorp/gorp")
    struct { sec int64; nsec int32; loc *time.Location } (in "time")

Abort: Failed to build: Go Compilation Error (in ../src/github.com/revel/modules/jobs/app/jobs/job.go:6): inconsistent definition for type reflect.Type during import

Are you able to reproduce this in a fresh Go environment? I love GVM for managing multiple Go installs.

moot