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

x/vgo: windows: cannot determine module path due to \r\n #23952

Closed
tobiaskohlbau opened this issue Feb 20, 2018 · 4 comments

Comments

@tobiaskohlbau
Copy link

commented Feb 20, 2018

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

go version go1.10 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\tobias\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\tobia\go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\tobias\AppData\Local\Temp\go-build013816286=/tmp/go-build -gno-record-gcc-switches

What did you do?

I've run vgo as suggested within the vgo-tour. It does not work as windows uses \r\n as file endings. I've located the cause which is a missing \r? within a regular expression here. I did a quick test of adding the missing peace to local copy. After adding \r? it just works fine.
If non empty module file exists vgo works as intended.

What did you expect to see?

vgo: resolving import "rsc.io/quote"
vgo: finding rsc.io/quote (latest)
vgo: adding rsc.io/quote v1.5.2

What did you see instead?

vgo: cannot determine module path for legacy source directory C:\Users\tobias\hello (outside GOROOT, no import comments)

@gopherbot gopherbot added this to the Unreleased milestone Feb 20, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2018

I'm so sorry about this. Will fix.

@rsc rsc changed the title x/vgo: windows: cannot determine module path x/vgo: windows: cannot determine module path due to \r\n Feb 20, 2018

@rsc rsc modified the milestones: Unreleased, vgo Feb 20, 2018

@jasontconnell

This comment has been minimized.

Copy link

commented Feb 22, 2018

I got around it in the meantime by modifying the vgo src directly

golang.org\x\vgo\vendor\cmd\go\internal\vgo\init.go line 297

@hypwxm

This comment has been minimized.

Copy link

commented Feb 24, 2018

in my mac, the same happend. if there is not main package, it is ok.

@rsc rsc added the NeedsFix label Apr 2, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Apr 18, 2018

Change https://golang.org/cl/107662 mentions this issue: cmd/go/internal/vgo: accept \r\n line ending after import comment

@golang golang locked and limited conversation to collaborators Apr 25, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.