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

'vg ensure' fails when project directory and home directory are located on different devices #44

Open
amarthadan opened this issue Apr 11, 2018 · 3 comments

Comments

@amarthadan
Copy link

Command vg ensure run within the project directory and activated workspace returns:

(project) [user@machine project][✔]$ vg ensure
Running "dep ensure"
Error: Couldn't move the vendor directory to the active workspace: rename vendor /home/user/.virtualgo/project/src: invalid cross-device link
Usage:
  vg ensure [-- [arguments to dep ensure]] [flags]

Flags:
  -h, --help   help for ensure

Couldn't move the vendor directory to the active workspace: rename vendor /home/uservirtualgo/project/src: invalid cross-device link

This is caused by the fact that my home directory is located on one device (/dev/sdb3) and my project directory on another (/dev/sda1). Call to os.Rename (https://github.com/GetStream/vg/blob/master/cmd/ensure.go#L143) will return a LinkError.

@JelteF
Copy link
Contributor

JelteF commented Apr 11, 2018

Hmm, it should probably fallback to copying and removing in that case. As a workaround for now you can use the current vg master. Then you can set the VIRTUALGO_ROOT variable to something on the same device as your project. That should make it work.

@lpbearden
Copy link

I'm a bit confused by this workaround. When would you set the VIRTUALGO_ROOT? I'm trying to get this working with a home directory in the Windows filesystem and the project directory on WSL.

@JelteF
Copy link
Contributor

JelteF commented Jan 25, 2019

The problem is that vg runs the go version of mv $yourgoproject/vendor $VIRTUALGO_ROOT/$VIRTUALGO/src. But mv fails when the source and target are not on the same filesystem. So to workaround make sure that your project and $VIRTUALGO_ROOT are on the same filesystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants