github.com/golang/dep@v0.5.4/docs/env-vars.md (about) 1 --- 2 id: env-vars 3 title: Environment Variables 4 --- 5 6 dep's behavior can be modified by some environment variables: 7 8 * [`DEPCACHEAGE`](#depcacheage) 9 * [`DEPCACHEDIR`](#depcachedir) 10 * [`DEPPROJECTROOT`](#depprojectroot) 11 * [`DEPNOLOCK`](#depnolock) 12 13 Environment variables are passed through to subcommands, and therefore can be used to affect vcs (e.g. `git`) behavior. 14 15 --- 16 17 ### `DEPCACHEAGE` 18 19 If set to a [duration](https://golang.org/pkg/time/#ParseDuration) (e.g. `24h`), it will enable caching of metadata from source repositories: 20 21 * Lists of published versions 22 * The contents of a project's `Gopkg.toml` file, at a particular version 23 * A project's tree of packages and imports, at a particular version 24 25 A duration must be set to enable caching. (In future versions of dep, it will be on by default). The duration is used as a TTL, but only for mutable information, like version lists. Information associated with an immutable VCS revision (packages and imports; `Gopkg.toml` declarations) is cached indefinitely. 26 27 The cache lives in `$DEPCACHEDIR/bolt-v1.db`, where the version number is an internal number associated with a particular data schema dep uses. 28 29 The file can be removed safely; the database will be automatically rebuilt as needed. 30 31 ### `DEPCACHEDIR` 32 33 Allows the user to specify a custom directory for dep's [local cache](glossary.md#local-cache) of pristine VCS source repositories. Defaults to `$GOPATH/pkg/dep`. 34 35 ### `DEPPROJECTROOT` 36 37 If set, the value of this variable will be treated as the [project root](glossary.md#project-root) of the [current project](glossary.md#current-project), superseding GOPATH-based inference. 38 39 This is primarily useful if you're not using the standard `go` toolchain as a compiler (for example, with Bazel), as there otherwise isn't much use to operating outside of GOPATH. 40 41 ### `DEPNOLOCK` 42 43 By default, dep creates an `sm.lock` file at `$DEPCACHEDIR/sm.lock` in order to prevent multiple dep processes from interacting with the [local cache](glossary.md#local-cache) simultaneously. Setting this variable will bypass that protection; no file will be created. This can be useful on certain filesystems; VirtualBox shares in particular are known to misbehave.