Repository navigation
Description
Vendor command fetches all external repositories into a folder specified by the flag --vendor_dir.
For the initial vendoring or updating existing vendor repositories the new command is:
bazel vendor --vendor_dir={vendordir}
With this all dependencies will be fetched to the specified directory. Also a target/s can be passed to limit the dependencies or --repo={repo_name} can be used to vendor a specific repo
The {vendordir} parameter can be either a full path or just a folder name, then the vendored repositories will be located under {workspace}/{vendordir}.
To perform a build using the vendored repositories, the same flag & value should be used:
bazel build {target} --vendor_dir={vendordir}
In this scenario, the vendor directory will be prioritized for repository retrieval. If the repository is not found or is outdated, the standard process will be followed, which involves checking cached repositories and fetching if not found.
Build & vendored repo is out-of-date/ not found:
- If fetch is enabled, the repo will be fetched and used with a warning that a re-vendor is needed to update it under the vendor directory
- If fetch is disabled, the vendored repo will be used as it is with a warning that it is out-of-date, or fail if it is not found
VENDOR.bazel file
A Starlark config file to allow controlling the vendored repos via:
- ignore('repo_name','repo_name', ....) function
Bazel will never vendor the repo or consider the vendor directory while building in vendor mode. - pin('repo_name','repo_name', ....) function
Bazel will pin the contents of this repo, will not update it while vendoring, and will always use it as is when building in vendor mode
In progress:
- Documentation
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
26 remaining items
peakschris commentedon May 8, 2024
@Wyverald I'm seeing issues with vendoring rules_helm (using release-7.2.0 latest). This module contains a symlink to a sub-repo, and the vendored symlink still points into the user cache, whilst I'd expect it to be rewritten to symlink into the vendor dir. Is this a known issue or should I open a new issue?
https://gitlab.industrysoftware.automation.siemens.com/devx/vendor/rules_helm/-/blame/main/helm/repositories.bzl#L130
Wyverald commentedon May 15, 2024
@peakschris thanks for testing it out! Please file new issues for the symlink thing -- we're aware of it, but it's still nice to keep track of it explicitly.
EDIT:
It should be. If it's missing, it's definitely something we should address at some point, so please feel free to file an issue
VENDOR.bazel file (related #19563)
Vendor mode: move the external repo instead of copying
VENDOR.bazel file (related bazelbuild#19563)
Vendor mode: move the external repo instead of copying
Fix vendoring immediatelly after a normal repo fetch
Fix vendoring immediatelly after a normal repo fetch
[7.3.0] Fix vendoring immediatelly after a normal repo fetch (#22979)
meteorcloudy commentedon Aug 13, 2024
Vendor mode is shipped with https://github.com/bazelbuild/bazel/releases/tag/7.3.0