Skip to content

Root go.mod interferes during build of go-native-1.12.9-r0 #2

@davidknezic

Description

@davidknezic

During the bitbake build the go-native-1.12.9-r0 compile step fails with following error:

Log data follows:
| DEBUG: Executing shell function do_compile
| Building Go cmd/dist using /workdir/sweetbit/yocto/build/tmp/work/x86_64-linux/go-native/1.12.9-r0/go1.4/go.
| Building Go toolchain1 using /workdir/sweetbit/yocto/build/tmp/work/x86_64-linux/go-native/1.12.9-r0/go1.4/go.
| Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
| Building Go toolchain2 using go_bootstrap and Go toolchain1.
| go: golang.org/x/net@v0.0.0-20190628185345-da137c7871d7: unrecognized import path "golang.org/x/net" (https fetch: no http in bootstrap go command)
| go: go.etcd.io/bbolt@v1.3.3: unrecognized import path "go.etcd.io/bbolt" (https fetch: no http in bootstrap go command)
| go: golang.org/x/sys@v0.0.0-20190712062909-fae7ac547cb7: unrecognized import path "golang.org/x/sys" (https fetch: no http in bootstrap go command)
| go: golang.org/x/text@v0.3.2: unrecognized import path "golang.org/x/text" (https fetch: no http in bootstrap go command)
| go: google.golang.org/appengine@v1.4.0: unrecognized import path "google.golang.org/appengine" (https fetch: no http in bootstrap go command)
| go: periph.io/x/periph@v3.4.0+incompatible: unrecognized import path "periph.io/x/periph" (https fetch: no http in bootstrap go command)
| go: google.golang.org/grpc@v1.22.0: unrecognized import path "google.golang.org/grpc" (https fetch: no http in bootstrap go command)
| go: google.golang.org/genproto@v0.0.0-20190716160619-c506a9f90610: unrecognized import path "google.golang.org/genproto" (https fetch: no http in bootstrap go command)
| go: golang.org/x/crypto@v0.0.0-20190701094942-4def268fd1a4: unrecognized import path "golang.org/x/crypto" (https fetch: no http in bootstrap go command)
| go: error loading module requirements
| go tool dist: FAILED: /workdir/sweetbit/yocto/build/tmp/work/x86_64-linux/go-native/1.12.9-r0/go/pkg/tool/linux_amd64/go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 1
| WARNING: exit code 2 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /workdir/sweetbit/yocto/build/tmp/work/x86_64-linux/go-native/1.12.9-r0/temp/log.do_compile.84199)

This happens since the yocto files are part of the sweetd repository, which has a go.mod file in its root that is being pulled during compilation. Possible solutions:

  • Move build directory out of project tree
  • Temporarily move go.mod before and after compilation of go-native
  • Nest sweetd Go project in src
  • Set GO111MODULE=off in go-native build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions