GetStream / vg

Virtualgo: Easy and powerful workspace based development for go
MIT License
1.32k stars 45 forks source link

"vg ensure -- -update" does not play well with persisted local packages #15

Closed 0xfe closed 7 years ago

0xfe commented 7 years ago

Below github.com/qubit-sh/go-crypto is a persisted package (symlinked from /Users/mmuthanna/.virtualgo/qubit/src/github.com/qubit-sh/go-crypto.)

$ vg ensure -- -v -update
Running "dep ensure -v -update"
Root project is "github.com/qubit-sh/xpoller"
 1 transitively valid internal packages
 2 external packages imported from 2 projects
(0)   ✓ select (root)
(1)     ? attempt github.com/qubit-sh/go-crypto with 1 pkgs; 1 versions to try
(1)         try github.com/qubit-sh/go-crypto@master

<SNIP>

Uninstalling "github.com/qubit-sh/go-crypto" from workspace
  Removing sources at "/Users/mmuthanna/.virtualgo/qubit/src/github.com/qubit-sh/go-crypto"
Error: Couldn't move the vendor directory to the active workspace: rename vendor /Users/mmuthanna/.virtualgo/qubit/src: no such file or directory
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 /Users/mmuthanna/.virtualgo/qubit/src: no such file or directory

The workaround is to call vg ensure immediately after to relink the persistent package.

JelteF commented 7 years ago

Looking at the output it seems related to #13. It seems like for some reason the vendor directory is not created after dep ensure -v -update (maybe caused by an error in the snipped part). This should probably be checked by vg, before unlinking and a better error message should be suplied. However, I cannot reproduce this issue myself. Could you supply some steps to reproduce?

Furthermore, on Monday I will probably be releasing an update to vg with some big changes and improvements to local install. Keep in mind that the default for import mode for new workspaces will be global fallback again, because that causes the least issues. You can try it out by checking out the bindfs branch, maybe it contains a fix to your issue by accident. If you do try it out, be sure to install bindfs for the best experience. And you should probably read the import mode section in the readme: https://github.com/GetStream/vg/tree/bindfs#workspace-import-modes

0xfe commented 7 years ago

Thanks for digging in. There were no errors in the snipped part, however I'm not sure what happened because when I just ran it again, it worked!

Good to hear about improvements to local install -- it's the most important part of my workflow :-)

Looking at the new doc (from the bindfs branch), must I now always add the --full-isolation flag during vg activate? Does it not remember the setting during vg init?

JelteF commented 7 years ago

Weird that it doesn't happen again. However, one of my colleagues reported a similar random issue a couple of days ago. I just released a new bug release version with a better error message when vendor cannot be found after dep ensure. Hopefully that allows for better investigation if the issue comes up again.

Furthermore, thanks for the feedback on the updated doc. No need to specify the --full-isolation flag for every vg activate, because it does indeed remember it. However it's a per workspace setting so each time you do vg init for a new project you have to specify it. In a future release there might be a global vg config file where this can be set. I will try to make this clearer before releasing the changes. Also, I'll write a summary of the changes for existing users with links to updated sections of the README.

JelteF commented 7 years ago

Reverted the commit build was failing

JelteF commented 7 years ago

I fixed the commit with better output and released it yesterday. I also just released the changes from the bindfs branch : https://github.com/GetStream/vg/releases/tag/v0.7.0

I'll be closing this until it happens again and more info or steps to reproduce it are available.

0xfe commented 7 years ago

Thank you!