cmd.go is referencing to undefined identifier 'log.Context' , main.go is referencing to undefined identifier 'vmextension.FindSeqNumConfig'

Open
#7 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
build-system

Research direction

Start with Makefile and reproduce the reported make command using the stated Go/gollvm environment. Then inspect the undefined references in main/cmds.go and main/main.go, separating those errors from the gccgo linker warning and llvm-goc crash. Done means the project builds successfully with the affected toolchain, or the supported toolchain requirements are documented.

Written by the indexing model from the issue text.

Description

Hi.
I can't build your project.

I have

$ go version
go version go1.15.2 gollvm LLVM 12.0.0git linux/amd64

and

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oceanfish81/.cache/go-build"
GOENV="/home/oceanfish81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfish81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfish81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/oceanfish81/gollvm_dist"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/oceanfish81/gollvm_dist/tools"
GCCGO="/home/oceanfish81/gollvm_dist/bin/llvm-goc"
AR="ar"
CC="/usr/bin/clang"
CXX="/usr/bin/clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build329472087=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

So here is what I got:

$ make
rm -rf "bin" "bundle"
if [ -z "$GOPATH" ]; then
echo "GOPATH is not set";
exit 1;
fi
GOOS=linux GOARCH=amd64 govvv build -v
-ldflags "-X main.Version=grep -E -m 1 -o '<Version>(.*)</Version>' misc/manifest.xml | awk -F">" '{print $2}' | awk -F"<" '{print $1}'"
-o bin/run-command-extension ./main
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
github.com/Azure/azure-docker-extension/pkg/vmextension/status
github.com/Azure/run-command-extension-linux/pkg/seqnum
_/home/oceanfish81/go_projects/run-command-extension-linux/main

_/home/oceanfish81/go_projects/run-command-extension-linux/main

main/cmds.go:24:24: error: reference to undefined identifier 'log.Context'
main/cmds.go:25:24: error: reference to undefined identifier 'log.Context'
main/cmds.go:57:16: error: reference to undefined identifier 'log.Context'
main/cmds.go:62:19: error: reference to undefined identifier 'log.Context'
main/cmds.go:82:39: error: reference to undefined identifier 'log.Context'
main/cmds.go:96:37: error: reference to undefined identifier 'vmextension.FindSeqNumStatus'
main/cmds.go:114:21: error: reference to undefined identifier 'log.Context'
main/cmds.go:127:21: error: reference to undefined identifier 'log.Context'
main/cmds.go:146:18: error: reference to undefined identifier 'log.Context'
main/cmds.go:210:25: error: reference to undefined identifier 'log.Context'
main/files.go:21:33: error: reference to undefined identifier 'log.Context'
main/handlersettings.go:93:36: error: reference to undefined identifier 'log.Context'
main/main.go:33:13: error: reference to undefined identifier 'log.NewContext'
main/main.go:46:29: error: reference to undefined identifier 'vmextension.FindSeqNumConfig'
main/status.go:15:24: error: reference to undefined identifier 'log.Context'
llvm-goc: /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/go/types.cc:2794: void Ptrmask::set_from(Gogo , Type , int64_t, int64_t): assertion '(offset % ptrsize) == 0' failed.
#0 0x0000000000d765f3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0xd765f3)
#1 0x0000000000d7468c llvm::sys::RunSignalHandlers() (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0xd7468c)
#2 0x0000000000d76a85 SignalHandler(int) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0xd76a85)
#3 0x00007fe9384263c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00007fe937fc318b raise /build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007fe937fa2859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
#6 0x000000000051b662 (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x51b662)
#7 0x00000000004f0d9e Ptrmask::set_from(Gogo
, Type
, long, long) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f0d9e)
#8 0x00000000004f0f42 Ptrmask::set_from(Gogo*, Type*, long, long) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f0f42)
#9 0x00000000004f1091 Ptrmask::set_from(Gogo*, Type*, long, long) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f1091)
#10 0x00000000004f0f42 Ptrmask::set_from(Gogo*, Type*, long, long) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f0f42)
#11 0x00000000004f05b4 Type::gc_ptrmask_var(Gogo*, long, long) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f05b4)
#12 0x00000000004f0399 Type::make_gc_symbol_var(Gogo*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f0399)
#13 0x00000000004f003a Type::gc_symbol_pointer(Gogo*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4f003a)
#14 0x0000000000578046 Struct_construction_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x578046)
#15 0x0000000000578046 Struct_construction_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x578046)
#16 0x00000000004e9179 Type::make_type_descriptor_var(Gogo*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4e9179)
#17 0x00000000004e8d36 Type::type_descriptor_pointer(Gogo*, Location) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4e8d36)
#18 0x0000000000578046 Struct_construction_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x578046)
#19 0x00000000004e9179 Type::make_type_descriptor_var(Gogo*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4e9179)
#20 0x00000000004e8d36 Type::type_descriptor_pointer(Gogo*, Location) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x4e8d36)
#21 0x00000000005556f3 Type_conversion_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x5556f3)
#22 0x000000000056fa3f Call_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x56fa3f)
#23 0x000000000057ad97 Map_construction_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x57ad97)
#24 0x00000000005556f3 Type_conversion_expression::do_get_backend(Translate_context*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x5556f3)
#25 0x0000000000485643 Variable::get_init_block(Gogo*, Named_object*, Bvariable*) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x485643)
#26 0x000000000048256f Gogo::write_globals() (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x48256f)
#27 0x000000000046e9fe gollvm::driver::CompileGoImpl::invokeFrontEnd() (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x46e9fe)
#28 0x000000000047118b gollvm::driver::CompileGo::performAction(gollvm::driver::Compilation&, gollvm::driver::Action const&, llvm::SmallVector<gollvm::driver::Artifact*, 3u> const&, gollvm::driver::Artifact const&) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x47118b)
#29 0x0000000000467b12 gollvm::driver::Driver::processAction(gollvm::driver::Action*, gollvm::driver::Compilation&, bool) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x467b12)
#30 0x0000000000467c22 gollvm::driver::Driver::processActions(gollvm::driver::Compilation&) (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x467c22)
#31 0x0000000000460f07 main (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x460f07)
#32 0x00007fe937fa40b3 __libc_start_main /build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#33 0x000000000045fb2e start (/home/oceanfish81/gollvm_dist/bin/llvm-goc+0x45fb2e)
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/oceanfish81/gollvm_dist/bin/llvm-goc -c -O2 -g -m64 -fdebug-prefix-map=/tmp/go-build474795801=/tmp/go-build -gno-record-gcc-switches -fgo-relative-import-path=
/home/oceanfish81/go_projects/run-command-extension-linux/main -o $WORK/b001/go.o -I $WORK/b001/importcfgroot main/cmds.go main/exec.go main/files.go main/handlersettings.go main/logtail.go main/main.go main/schema.go main/status.go main/telemetry.go main/version.go
go tool: exit status 2
make: *** [Makefile:15: binary] Error 1

I am using gollvm - you can obtain my "release" build from here .

CC @thanm @cherrymui @ianlancetaylor
CC @devigned @arschles @asw101
CC @ahmetb @boumenot @koralski

Dominant language
Go
Stars
4
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/run-command-extension-linux

All issues in Azure/run-command-extension-linux

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.