在本地文件系统上使用带注册表的Bzlmod吗?

huangapple go评论91阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年8月10日 23:06:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76877026.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定