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

cmd/go: go.mod sometimes gets corrupted on Plan 9 #39238

Closed
fhs opened this issue May 24, 2020 · 2 comments
Closed

cmd/go: go.mod sometimes gets corrupted on Plan 9 #39238

fhs opened this issue May 24, 2020 · 2 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9
Milestone

Comments

@fhs
Copy link
Contributor

fhs commented May 24, 2020

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

$ go version
go version devel +master Sun May 24 16:29:28 EDT 2020 plan9/amd64

Does this issue reproduce with the latest release?

Probably. Originally discovered on go1.14.2.

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

go env Output
$ go env
GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/usr/fhs/lib/cache/go-build'
GOENV='/usr/fhs/lib/go/env'
GOEXE=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='plan9'
GOINSECURE=''
GOMODCACHE='/home/fhs/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='plan9'
GOPATH='/home/fhs/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/big/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLDIR='/home/big/go/pkg/tool/plan9_amd64'
GCCGO='gccgo'
AR='ar'
CC='6c'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build496408275=/tmp/go-build -gno-record-gcc-switches'
GOROOT/bin/go version: go version devel +master Sun May 24 16:29:28 EDT 2020 plan9/amd64
GOROOT/bin/go tool compile -V: compile version devel +master Sun May 24 16:29:28 EDT 2020

What did you do?

Below are the steps to reproduce on Plan 9. I was not able to reproduce on linux.

cpu% cat main.go
package main

import "rsc.io/quote"

func main() {
	println(quote.Hello())
}
cpu% cat qr.go
package main

import "rsc.io/qr"

var _ = qr.Code{}
cpu% go mod init example.com/hello
go: creating new go.mod: module example.com/hello
cpu% go build
go: finding module for package rsc.io/quote
go: finding module for package rsc.io/qr
go: found rsc.io/qr in rsc.io/qr v0.2.0
go: found rsc.io/quote in rsc.io/quote v1.5.2
cpu% cat go.mod
module example.com/hello

go 1.15

require (
	rsc.io/qr v0.2.0
	rsc.io/quote v1.5.2
)
cpu% rm qr.go # remove rsc.io/qr dependency
cpu% go build
cpu% go mod tidy
cpu% cat go.mod
module example.com/hello

go 1.15

require rsc.io/quote v1.5.2
// indirect
	rsc.io/quote v1.5.2
)
cpu% go build
go: errors parsing go.mod:
/mnt/term/tmp/hello/go.mod:7:2: unknown directive: rsc.io/quote
/mnt/term/tmp/hello/go.mod:8: unknown directive: )

What did you expect to see?

Expected go.mod file after removing rsc.io/qr dependency:

go 1.15

require rsc.io/quote v1.5.2

What did you see instead?

Corrupted go.mod file.

@gopherbot add labels OS-Plan9, GoCommand, modules, NeedsInvestigation

@gopherbot gopherbot added GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9 labels May 24, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone May 25, 2020
@ianlancetaylor
Copy link
Contributor

CC @bcmills @jayconrod

@fhs
Copy link
Contributor Author

fhs commented May 25, 2020

It seems drawterm's /mnt/term doesn't support file truncation (as in os.Truncate) for some reason. I wasn't able to reproduce the issue with ramfs.

This is likely not a cmd/go issue. Sorry about the noise.

@fhs fhs closed this as completed May 25, 2020
jxy pushed a commit to Plan9-Archive/drawterm-metal-cocoa that referenced this issue Sep 9, 2020
@golang golang locked and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9
Projects
None yet
Development

No branches or pull requests

3 participants