dongxingqiu7943 2017-11-23 14:44
浏览 82
已采纳

dep和bazel Go规则之间是否有联系?

Intro: dep is a tool to manage dependencies of Go projects. bazel is a build tool that produces stable, reproducable builds. There is a bazel rule set for Go projects, including an automatic build-file generator, gazelle, that generates Bazel build files following the conventions that go build would apply, using the dependencies declared in the bazel WORKSPACE.

The WORKSPACE, though, I have to create by hand or by help of a little hackish helper tool, wtool. dep, on the other hand, helps track dependencies, is able to download them into a vendor/ directory and locking specific versions.

To me it appears that the Gopkg.lock file that dep uses to specify versions of dependencies (usually by their VCS commit hash) would be easily translated into a bazel WORKSPACE file. I have successfully done so manually in a company-internal project as well.

Is there an existing link between bazel and its Go rules and dep that I could have used instead of doing this manually?

(Additionally: Is anybody else doing this? Should I be doing this at all?)

  • 写回答

2条回答 默认 最新

  • dqcd84732 2017-11-25 15:47
    关注

    There's no existing tool for this, but it should be pretty straightforward to convert entries in the lock file to WORKSPACE.

    We're thinking of a command to the Gazelle build file generator to help with this (not just for dep, but other tools as well). The main plan is for Gazelle to automatically add repositories that are missing, but that will take more time to implement.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题