{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/10197","labels_url":"https://api.github.com/repos/golang/go/issues/10197/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/10197/comments","events_url":"https://api.github.com/repos/golang/go/issues/10197/events","html_url":"https://github.com/golang/go/issues/10197","id":63006517,"number":10197,"title":"cmd/go: fails when generated import path for local package contains space character","user":{"login":"dr2chase","id":1928999,"avatar_url":"https://avatars.githubusercontent.com/u/1928999?v=3","gravatar_id":"","url":"https://api.github.com/users/dr2chase","html_url":"https://github.com/dr2chase","followers_url":"https://api.github.com/users/dr2chase/followers","following_url":"https://api.github.com/users/dr2chase/following{/other_user}","gists_url":"https://api.github.com/users/dr2chase/gists{/gist_id}","starred_url":"https://api.github.com/users/dr2chase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dr2chase/subscriptions","organizations_url":"https://api.github.com/users/dr2chase/orgs","repos_url":"https://api.github.com/users/dr2chase/repos","events_url":"https://api.github.com/users/dr2chase/events{/privacy}","received_events_url":"https://api.github.com/users/dr2chase/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestones/Unplanned","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":966,"closed_issues":59,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2015-07-14T03:25:52Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":3,"created_at":"2015-03-19T14:41:59Z","updated_at":"2015-07-14T03:25:52Z","closed_at":null,"body":"Go version:\r\n\r\n    go version devel +6ffed30 Wed Mar 18 15:14:37 2015 +0000 darwin/amd64\r\n\r\nI did:\r\n\r\n    cd ~/\"Google Drive\"\r\n    git clone https://go.googlesource.com/go\r\n    cd go/src\r\n    ./all.bash\r\n\r\nI expected to see a successful build and test.\r\n\r\nInstead I saw:\r\n\r\n    ...\r\n    ##### ../test\r\n    # go run run.go -- fixedbugs/bug248.go\r\n    exit status 1\r\n    bug2.go:8: import path contains space character: \"/Users/drchase/Google Drive/work/go/test/fixedbugs/bug248.dir/bug0\"\r\n    bug2.go:9: import path contains space character: \"/Users/drchase/Google Drive/work/go/test/fixedbugs/bug248.dir/bug1\"\r\n\r\nand a similar failure with bug369.go .\r\nMy workaround is to rename \"Google Drive\" to \"GoogleDrive\" (and correct external references to the original name).\r\n\r\nSmall reproducer (can copy and paste into shell):\r\n\r\n    cd;  mkdir -p tmp ; cd tmp ; mkdir \"t m p\" ; cd \"t m p\"\r\n\r\n    cat > main.go <<EOF\r\n    package main\r\n    import (\r\n      p0 \"./x\"\r\n      \"fmt\"\r\n     )\r\n    func main() {\r\n      fmt.Println(p0.Id(\"Hello, playground\"))\r\n    }\r\n    EOF\r\n    \r\n    mkdir x\r\n    cat > x/bug0.go <<EOF\r\n    package x\r\n    func Id (s string) string {\r\n      return s\r\n    }\r\n    EOF\r\n\r\n    go tool 6g main.go\r\n    # end of copy and paste\r\n\r\nThis produces the error:\r\n\r\n    main.go:3: import path contains space character: \"/Users/drchase/tmp/t m p/x\"\r\n    main.go:7: undefined: p0 in p0.Id\r\n\r\nOrdinary compilation works fine:\r\n\r\n    $ go run main.go\r\n    Hello, playground\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/121123048","html_url":"https://github.com/golang/go/issues/10197#issuecomment-121123048","issue_url":"https://api.github.com/repos/golang/go/issues/10197","id":121123048,"user":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T03:25:52Z","updated_at":"2015-07-14T03:25:52Z","body":"The bug only affects people or programs that:\n\n  1. invoke the compiler directly\n  2. do so in directories containing spaces\n  3. have local imports (import \"./foo\") in their programs\n  4. do not specify a -D flag to set the local import prefix\n\nThat's a lot of conditions. It's true that fixedbugs/bug248.go\nruns into this, as does fixedbugs/bug369.go, but probably\nthe fix should be to correct those tests, not to make larger\nchanges.\n\nNote that the go command does work fine, because it\narranges to use a sanitized version of the local directory\nin the path to the compiled artifacts, and it instructs the\ncompiler to use that sanitized version with -D.\n\nWe should still fix the tests, but this is not blocking\nany release."}}