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

go 1.13.1 local import under windows is broken #34643

Closed
fantomgs opened this issue Oct 1, 2019 · 4 comments
Closed

go 1.13.1 local import under windows is broken #34643

fantomgs opened this issue Oct 1, 2019 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@fantomgs
Copy link

fantomgs commented Oct 1, 2019

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

$ go version
go1.13.1 windows/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\xxx\AppData\Local\go-build
set GOENV=C:\Users\xxx\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Projects
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=c:\temp\go-build495912386=/tmp/go-build -gno-record-gcc-switches

What did you do?

Just used local import in my project main file like:
import "./my_local_package"
"my_local_package" imports another non-local package

What did you expect to see?

Expect succefull build

What did you see instead?

unexpected directory layout:
        import path: _/C_/Projects/src/checkerr/my_local_package
        root: C:\Project\src
        dir: C:\Project\src\checkerr\my_local_package
        expand root: C:\Project\src
        expand dir: C:\Project\src\checkerr\my_local_package
        separator: \

I made some research. I'm sure it happens here:
https://github.com/golang/go/blob/release-branch.go1.13/src/cmd/go/internal/load/pkg.go#L879

Because function build.IsLocalImport checks psedo-import path

"_/C_/Projects/src/checkerr/my_local_package"
generated by dirToImportPath instead of
"./my_local_package"

@agnivade
Copy link
Contributor

agnivade commented Oct 2, 2019

I think you'll have to use replace directives to achieve this. I'll defer to some more knowledgeable folks @bcmills @jayconrod @thepudds.

@bcmills
Copy link
Contributor

bcmills commented Oct 2, 2019

What was the exact command you invoked to build the program?

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 2, 2019
@bcmills
Copy link
Contributor

bcmills commented Oct 2, 2019

Did the same command work with Go 1.12.10?

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Nov 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants