Comments (6)
Good question! By putting them in required
of Gopkg.toml
you are already pinning them in Gopkg.lock
. The version is only updated if you run vg ensure -update
or vg ensure -update github.com/user/repo-with-executable
. If you want to exclude some specific (major) versions you can use a [constraint]
block in your Gopkg.toml
, in the same way as regular dependencies with dep
.
I'll keep this open to remember to add something about it to the README for this (probably a link to dep
docs).
from vg.
@JelteF Thanks for the response 👍 However, I don't think this [constraint]
strategy will work in the long run because according to dep
README, dep prune is going to be absorbed into dep ensure.
So unless you import it, all constraint package will be pruned, am I right? so there should be a way for me to do this in vg I feel
from vg.
I'm asking @sdboyer about this on slack to confirm, but I'm quite sure everything that is in the required
list won't be pruned. Because that's the way you can insert packages in the dependency graph that are not actually imported (as far as I know).
from vg.
I got a response in the #vendor slack channel:
I just tried it myself to see how dep prune behaves with required executable. So, I created a new project and added
github.com/golang/dep/cmd/dep
package inrequired
. And then I ran ensure. The whole dep repo was downloaded to vendor/. Then I ran prune, and it cleaned all the packages that are not required bygithub.com/goland/dep/cmd/dep
package. And then I tried building dep from what was left in vendor, and it worked.
Also, when the require is added to the lock file, dep adds a list of all the packages the required package uses. And this list of project packages is used by prune to create a list of packages to keep.
So, if you add the proper package name of the executable, it's safe.
Also, you're right about usingconstraint
to set version of a required package.
So it will keep working fine even with prune
. As long as you put the actual full path to the executable package, so github.com/golang/dep/cmd/dep
instead of github.com/golang/dep
. Luckily, you already should do that, because otherwise vg
doesn't know which package to install.
from vg.
confirming what was verified experimentally - required
are equivalent to an import from a pruning perspective. wouldn't be much point in them otherwise ☺
from vg.
Thanks @JelteF @sdboyer It's clear to me now 👍
from vg.
Related Issues (20)
- dep init does not work HOT 3
- "vg ensure -- -update" does not play well with persisted local packages HOT 6
- go list incorrect HOT 1
- Override virtualgoroot (~/.virtualgo)? HOT 1
- Is it possible to auto deactivate when `cd` out of the directory? HOT 3
- vg setup improments HOT 2
- With --full-isolation, package fails to import its own internal packages HOT 4
- Ctrl+C during vg ensure keeps dep running in the background HOT 1
- Publish binary executable of vg? HOT 2
- Add vg to homebrew HOT 1
- Relative paths passed to localInstall work unexpectedly HOT 2
- Breaks when initial GOPATH is empty HOT 2
- vg environment name does not display in the zsh HOT 3
- Document environment variables and last-ensure file
- go-plus plugin cannot find virtualgo installed packages HOT 2
- Changing workspace breaks fish shell HOT 1
- 'vg ensure' fails when project directory and home directory are located on different devices HOT 3
- vg auto-activate works incorrectly
- Installation error - /root/go/src/github.com/spf13/cobra/bash_completions.go:566:28: undefined: io.StringWriter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vg.