-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring: Introduce vendoring library #223
Comments
I am not sure we need #198 to be blocking this issue. Most of the mentioned vendor tools can figure out a list of dependencies from the source files. The challenge might be to sync dependencies versions... From my experience:
|
There is one more that might be an official one https://github.com/golang/dep |
I think this is the first option we should consider. |
I'm going to do a second try on it. Here are the challenges we have with
|
@divan regarding the second point, it's actually useful to do it this way as we don't need to change all |
@divan @adambabik I'll take this one over. Chances are, by the time I'll finish it, 1.7.3 would be rebased. |
I wonder if we should actually start working on this issue before go-ethereum decides to adopt What problem do we want to address with We need to figure out a way to sync our and go-ethereum dependencies wherever we decide to upgrade go-ethereum. Does When I experimented with |
Sticking to |
If I don't have a strong opinion regarding the tool, however, I hope
|
I agree that |
I think it depends if |
I did a short research of I will try to do a short investigation of It also turns out that we have quite a few dependencies in our tree that are either never used or duplicates with different versions. Hence, I am convinced that we need a dependency manager. |
@mandrigin make sure you've seen this (closed) PR: #369 We agreed on using Also (I don't remember where discussion is, but it's somewhere here in issues on GH), part of the problem is that for existing dependencies we currently use there is no .git folder and exact version information. So it should be either upgraded to latest (and verified that it's ok), or guessed the current versions and specified manually in Gopkg.toml. |
@mandrigin if BTW, there is an update on @mandrigin First, I would try to research migration from Also, I think we can wait until pruning in |
@adambabik yeah, the workaround I mentioned is as follows. govendor sync # downloads go-ethereum and it's vendor.json
pushd vendor/github.com/ethereum/go-ethereum
govendor sync # downloads the deps of go-ethereum
popd That relies on a fact, that go supports nested vendor folders and chooses the longest path.
(from Go Vendor Experiment) I'll not spend more time on |
Ok, I manage to make it build and the tests to pass using dep and an external fork of Unfortunately, our current After that, I can prepare dependencies for 1.7.3 in the @divan what is the best place to document the process of adding a new version? Converting dependencies format would be one of the steps there. |
I would suggesting adding a "vendor check" to CI. The vendor check would run The failure message from that check can provide the documentation about how to update dependencies, or link to relevant docs (if it's more involved than https://github.com/golang/dep#adding-a-dependency or https://github.com/golang/dep#changing-dependencies, but it ideally shouldn't be). |
That makes sense if we will continue to keep |
noticed this on a backlink from the dep repo - hi! just a quick note:
yes, definitely important to do. you could base it off of what we do in dep itself: https://github.com/golang/dep/blob/master/hack/validate-vendor.bash note that, as outlined here, there'll be a first-class |
@sdboyer thanks a lot, this script seems very interesting indeed! @adambabik @divan I think we can skip CI checks and |
@sdboyer btw, a side question. If I want to change an commit for a dependency (for triaging bugs), is it enough to just change |
We need to skip it because
I guess you should never change |
@adambabik I tried putting specific The preferred way of pinning dependencies is a lock file as I understand(1). This file is preserved until Also, this question was more out of curiosity, I'm relying on auto-conversion to generate the toml/lock pair. |
in general, directly editing but yes, in a pinch, you can directly update the next release of dep - i'm trying for this week - comes with a big docs drop.
yes, strongly preferred. revisions in your |
Problem
Currently our vendor folder is filled with a lot of uncontrolled dependencies and:
However, it's not as straightforward as we have our own changes to some libraries under the
vendor
folder, for example, forgo-ethereum
. The solution here is to forkgo-ethereum
and support our version separately fromstatus-go
.Implementation
We decided to use dep as a dependency management tool.
The recommended way is to first specify dependencies in our fork of
go-ethereum
and then using our fork as a dependency instatus-go
. Dependencies between these two projects will be properly split and easier to manage.Acceptance Criteria
dep
is the only tool to manage dependencies in bothstatus-go
and ourgo-ethereum
fork,dep ensure
the project compiles properly and passes all tests,dep status
returns no issues.Notes
Note that we already have https://github.com/status-im/go-ethereum library forked and you'll need to find out the difference between it and that under
vendor/ethereum/go-ethereum
.The first implementation was done #369. Read a discussion there before implementing.
dep prune
will remove some files which are necessary to buildgo-ethereum
andstatus-go
, thus it should not be used. The cost will be additional ~1M LOC which is not a big deal as it's a one-time operation.The text was updated successfully, but these errors were encountered: