英文:
Use Bzlmod with registry on local file system?
问题
可以使用位于本地文件系统上的 Bazel 注册表与 bzlmod 吗,例如:
bazel build --enable_bzlmod --registry="file://Users/me/bazel-central-registry" -- //...
我从 https://github.com/bazelbuild/bazel-central-registry 下载了一个存档,并在我的文件系统上提取了它。当我运行上述命令,指向提取的存档所在的位置时,我得到以下错误信息:
> Error computing the main repository mapping: Error accessing registry file://Users/me/bazel-central-registry: Users
英文:
Is it possible to use a Bazel registry with bzlmod that lives on the local filesytem, e.g.:
bazel build --enable_bzlmod --registry="file://Users/me/bazel-central-registry" -- //...
I downloaded an archive of https://github.com/bazelbuild/bazel-central-registry and extracted it on my filesystem. When I run the above command pointing at the location where the extracted archive resides I get:
> Error computing the main repository mapping: Error accessing registry file://Users/me/bazel-central-registry: Users
答案1
得分: 2
使用三个斜杠,即:
bazel build --enable_bzlmod --registry="file:///Users/me/bazel-central-registry" -- //...
或者,如果你想将注册表存储在你的存储库中,你可以使用 `--registry="file://%workspace%/registry`,以便使用存储在名为 registry 的目录中的注册表,该目录位于你的工作区的根目录。
英文:
Use three slashes i.e.
bazel build --enable_bzlmod --registry="file:///Users/me/bazel-central-registry" -- //...
Alternatively if you want to have the registry stored within your repository you can use --registry="file://%workspace%/registry
in order to use a registry stored in a directory called registry at the root of your workspace.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论