lf icon indicating copy to clipboard operation
lf copied to clipboard

Add vendor folder

Open ephemer4l opened this issue 3 years ago • 0 comments

Why add this?

Go modules bring the guarantee that you will be able to build your packages deterministically by locking down the dependencies into a go.sum. That being said, the promise to deterministically build your project only stands if your dependencies are still accessible in the future. You don't know if this is going to be the case.

Vendoring on the other hand, with or without Go modules, brings stronger guarantees as it enables to commit the dependencies next to the code. Thus even if the remote repository is no longer accessible (deleted, renamed, etc), you will still be able to build your project.

Another alternative is to use Go modules along with a proxy. You can find more information in the official documentation. You can also look at some OSS implementations like gomods/athens or goproxy/goproxy. If you don't feel like setting up and maintaining your own proxy, some commercial offers are available on the market.

So should you go mod vendor each time you commit? Well it's ultimately up to you dependending on the kind of guarantees you want. But yes leveraging a proxy or vendoring your dependencies help getting closer to reproducable builds. source: https://stackoverflow.com/questions/61547433/what-are-the-benefits-of-having-a-vendor-folder

And the obvious con is that it's quite large in size. This will also greatly help make the Gentoo GURU package have more credibility.

ephemer4l avatar Aug 29 '22 17:08 ephemer4l