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: no rebuild with deleted files #6294

Closed
mb0 opened this issue Aug 30, 2013 · 3 comments
Closed

cmd/go: no rebuild with deleted files #6294

mb0 opened this issue Aug 30, 2013 · 3 comments

Comments

@mb0
Copy link

mb0 commented Aug 30, 2013

$ go version
go version devel +f2e954f463e0 Thu Aug 29 10:16:09 2013 +0200 linux/amd64

steps that will reproduce the problem:
1. $ cd $GOPATH/src
   $ unzip path/to/attached/delfile.zip
2. $ go install delfile
   $ ../bin/delfile
   prints "still there"
3. $ rm delfile/deleted.go
   $ go install delfile
   $ ../bin/delfile
   prints "still there"

the expected output of the second go install is:
# delfile
./main.go:4: undefined: deleted

same behavior is observed for non command/main packages.

Attachments:

  1. delfile.zip (598 bytes)
@robpike
Copy link
Contributor

robpike commented Aug 30, 2013

Comment 1:

A fix will require a different architecture for the go command involving file change
notification from the operating system.
See also issue #3832.

Labels changed: added priority-someday, removed priority-triage.

Status changed to Accepted.

@mb0
Copy link
Author

mb0 commented Aug 30, 2013

Comment 2:

a quick check for the files that were used to build the command or package can be
achieved without a notification system. although not a pretty solution:
$ cd /opt/go # your $GOROOT here
$ strings pkg/linux_amd64/fmt.a | grep -e "<.*\.go"
<doc.go
<format.go
<print.go
<scan.go
$ strings bin/gofmt | grep -e "cmd/gofmt/.*\.go"
/opt/go/src/cmd/gofmt/simplify.go
/opt/go/src/cmd/gofmt/rewrite.go
/opt/go/src/cmd/gofmt/gofmt.go
/opt/go/src/cmd/gofmt/doc.go
just a suggestion.

@rsc
Copy link
Contributor

rsc commented Sep 5, 2013

Comment 3:

Status changed to Duplicate.

Merged into issue #3895.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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