douzheren3349 2018-08-16 16:28
浏览 141
已采纳

使用golang dep从同一个github源获得不同的软件包版本

I'm attempting to convert a project from govendor to dep. However, I'm finding one limitation in dep to make this impossible. In govendor, in the vendor.json file, I can have different packages from the same source have different revision hashes. Like this, for example:

{
    "checksumSHA1": "iYT7abLMy0Vfyy8nwoDZYirLrI4=",
    "path": "github.com/docker/docker/api/types",
    "revision": "deed26f7f0f9a9d279b8ac99389f204d9063d1a4",
    "revisionTime": "2018-03-29T10:06:29Z"
},
{
    "checksumSHA1": "jVJDbe0IcyjoKc2xbohwzQr+FF0=",
    "path": "github.com/docker/docker/api/types/blkiodev",
    "revision": "88c0317e23449d6ff730a1073f240586cbdfd4ba",
    "revisionTime": "2017-08-23T07:13:08Z"
},

However, when I solve this with dep init, the final .lock file seems to have picked the latest version:

[[projects]]
digest = "1:3101683c3a63814ac8fe12a61fa01b728340f647c484d71573a31f041a68e7bc"
name = "github.com/docker/docker"
packages = [
    "api/types",
    "api/types/blkiodev",
]
pruneopts = "UT"
revision = "deed26f7f0f9a9d279b8ac99389f204d9063d1a4"

Unfortunately, having every package under github.com/docker/docker at the same revision doesn't work for us at all. Trying to make them all one revision brings up an entire cascade of revision changes to other transitive packages that we simply cannot tolerate at this time. (This example is pruned down, we have a lot of packages under github.com/docker/docker, and those packages are pidgeon-holed into three or four different versions).

So the question is, can dep handle having packages from the same "name" with different revisions? If so, are we stuck forever with govendor? That would make me personally unhappy because govendor is... uh... challenging... (it's probably how we got into this bad place)

Thanks in advance for all the help!

  • 写回答

1条回答 默认 最新

  • douniwan_0025 2018-08-16 18:17
    关注

    So the question is, can dep handle having packages from the same "name" with different revisions?

    No.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口