{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/11124","labels_url":"https://api.github.com/repos/golang/go/issues/11124/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/11124/comments","events_url":"https://api.github.com/repos/golang/go/issues/11124/events","html_url":"https://github.com/golang/go/issues/11124","id":86540636,"number":11124,"title":"x/mobile/cmd/gomobile - init - Toolexec » Rename fails","user":{"login":"EtienneBruines","id":3962174,"avatar_url":"https://avatars.githubusercontent.com/u/3962174?v=3","gravatar_id":"","url":"https://api.github.com/users/EtienneBruines","html_url":"https://github.com/EtienneBruines","followers_url":"https://api.github.com/users/EtienneBruines/followers","following_url":"https://api.github.com/users/EtienneBruines/following{/other_user}","gists_url":"https://api.github.com/users/EtienneBruines/gists{/gist_id}","starred_url":"https://api.github.com/users/EtienneBruines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EtienneBruines/subscriptions","organizations_url":"https://api.github.com/users/EtienneBruines/orgs","repos_url":"https://api.github.com/users/EtienneBruines/repos","events_url":"https://api.github.com/users/EtienneBruines/events{/privacy}","received_events_url":"https://api.github.com/users/EtienneBruines/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"crawshaw","id":161319,"avatar_url":"https://avatars.githubusercontent.com/u/161319?v=3","gravatar_id":"","url":"https://api.github.com/users/crawshaw","html_url":"https://github.com/crawshaw","followers_url":"https://api.github.com/users/crawshaw/followers","following_url":"https://api.github.com/users/crawshaw/following{/other_user}","gists_url":"https://api.github.com/users/crawshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/crawshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawshaw/subscriptions","organizations_url":"https://api.github.com/users/crawshaw/orgs","repos_url":"https://api.github.com/users/crawshaw/repos","events_url":"https://api.github.com/users/crawshaw/events{/privacy}","received_events_url":"https://api.github.com/users/crawshaw/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-06-09T10:17:04Z","updated_at":"2015-06-29T21:09:39Z","closed_at":null,"body":"I'm issuing the command `gomobile init -v`, and its response ends with:\r\n\r\n```\r\nInstalled Go for android/arm in /home/etiennebruines/workspaces/go/pkg/gomobile/work-542832590/go\r\nInstalled commands in /home/etiennebruines/workspaces/go/pkg/gomobile/work-542832590/go/bin\r\nbuilding gomobile toolexec\r\ngomobile: rename /home/etiennebruines/workspaces/go-all/pkg/gomobile/work-542832590/go/pkg/android_arm /tmp/gomobile-764944597/android_arm: invalid cross-device link\r\n```\r\n\r\nIt's not weird for a `rename` command to fail with that error. Usually this means that the `src` and `dst` are not on the same file system (see [Stackoverflow](http://stackoverflow.com/a/24210631/3243814)). But for those that have a lot of file systems (one for root, one for `/home`, `/tmp` as tmpfs, ...), this shouldn't prevent it from initializing. \r\n\r\nI think the gomobile-tool should fallback to \"copy to dst and delete src\". I have not found a workaround just yet. \r\n\r\nThe alternative would be to actually document this limitation and refer to the use of the `TMPDIR` environment variable (as some distributions might use `TEMP`, `TMP` or `TEMPDIR` ([Wikipedia](https://en.wikipedia.org/wiki/TMPDIR))) - but this only holds as long as we're using the [move](https://github.com/golang/mobile/blob/master/cmd/gomobile/init.go#L309-L328) function to copy to `/tmp`. \r\n\r\nFalling back to (potentially existing) tools such as `mv` may work on quite a lot of systems -- potentially not all, but probably all systems that are actually using the gomobile tool. "},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/116847125","html_url":"https://github.com/golang/go/issues/11124#issuecomment-116847125","issue_url":"https://api.github.com/repos/golang/go/issues/11124","id":116847125,"user":{"login":"hyangah","id":4999471,"avatar_url":"https://avatars.githubusercontent.com/u/4999471?v=3","gravatar_id":"","url":"https://api.github.com/users/hyangah","html_url":"https://github.com/hyangah","followers_url":"https://api.github.com/users/hyangah/followers","following_url":"https://api.github.com/users/hyangah/following{/other_user}","gists_url":"https://api.github.com/users/hyangah/gists{/gist_id}","starred_url":"https://api.github.com/users/hyangah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyangah/subscriptions","organizations_url":"https://api.github.com/users/hyangah/orgs","repos_url":"https://api.github.com/users/hyangah/repos","events_url":"https://api.github.com/users/hyangah/events{/privacy}","received_events_url":"https://api.github.com/users/hyangah/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T21:09:39Z","updated_at":"2015-06-29T21:09:39Z","body":"fyi. crawshaw recently moved the use of toolexec and changed the way to initialize tool chains. There are still cases the move function is being used for but in most cases, I think we tried to be careful to put the src and dst under the same file system, but I may be wrong. @EtienneBruines, can you please sync the repo and run gomobile init to check if the problem went away? Many thanks."}}