Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: building a plugin with a non main package produces no error #19023

Closed
vimalk78 opened this issue Feb 10, 2017 · 3 comments
Closed

plugin: building a plugin with a non main package produces no error #19023

vimalk78 opened this issue Feb 10, 2017 · 3 comments
Milestone

Comments

@vimalk78
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.8rc3 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vimal/gowork"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build128255364=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

tried building a plugin with a non main package

package junk

import "C"

func HelperFunc() string {
        return "help"
}

$ go build -buildmode=plugin -o junk.so

What did you expect to see?

error that no main package found

What did you see instead?

it produces a .so file, probably because of the -o flag.
if dont use -o flag, no output is produced.

$ file junk.so
junk.so: current ar archive
$ ls -al junk.so
-rw-r--r-- 1 vimal users 7266 Feb 11 00:43 junk.so


@bradfitz
Copy link
Contributor

/cc @crawshaw

@gopherbot
Copy link

CL https://golang.org/cl/40671 mentions this issue.

@bradfitz bradfitz modified the milestones: Go1.9Maybe, Go1.10 Jun 7, 2017
@crawshaw
Copy link
Member

crawshaw commented Sep 2, 2017

This was fixed in https://golang.org/cl/40691

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants