-
Notifications
You must be signed in to change notification settings - Fork 385
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
Skip download of "vendor" if not necessary #242
Conversation
46ccd9a
to
7479458
Compare
I believe |
@LK4D4 any idea? |
@runcom I had a quick look at vndr and to get it fixed there, but it turned easier to fix it here (at least for now as quick solution), rm -rf vendor && redownload it for each make test is a bit expensive :( I can move the second patch to a different PR though if you prefer to get an opinion from @LK4D4 first |
7479458
to
e46a123
Compare
second patch moved to: #243 |
Makefile
Outdated
|
||
test: deps | ||
test: deps.timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these rules supposed to work? AFAICS all this does is that it causes the deps.timestamp
rule to trigger, which just touches the timestamp file; under no circumstances that would cause deps
to be re-run AFAICS. Same for the all
dependency.
It does seem that something like the vendor:… vendor.conf; touch vendor
rule would be useful to ensure vndr
is run only when necessary, but it’s not clear to me how all the pieces in this commit are supposed to fit together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I screwed it in an attempt to cleanup the patch. test: deps.timestamp
should look like test: vendor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's going to work; IIRC make won't trigger on directory updates.
If I remember my make right, Also unless I'm missing something, I think there should be a "force a download" target of some sort. It doesn't look like there's something that does that for us here. Maybe the clean target should be adjusted too. |
d84ebda
to
3f80deb
Compare
@erikh a 'make clean && make deps' will do that. Are there cases where we really want a 'force a re-download of everything'? |
@giuseppe if make clean is not updating the timestamp file, won't it silently ignore the vendor download in the current patch form? |
Oh I missed your modification to the clean target; sorry! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better, but still confusing.
- The
deps.timestamp
anddeps
targets apparently have absolutely nothing in common. - Neither of them really handles fetching dependent packages; they handle fetching tools.
- The
vndr
tool is treated differently from the others.
Perhaps this structure would make sense (?)
# Fetch all tools needed for compilation. The timestamp is an internal implementation detail.
tools: tools.timestamp
tools.timestamp:
# (go get …) from deps.timestamp and vndr
# Update dependencies in the vendor subdirectory based on vendor.conf
vendor: tools vendor.conf
@vndr
@touch vendor
# Remove the vndr rule, subsumed by tools{.timestamp}
(+ relevant deps updates)
176e990
to
139a17f
Compare
Add a Makefile rule to regenerate vendor only when vendor.conf changed. Re-download all the dependencies is expensive, so do that only when necessary. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
139a17f
to
a19e3a9
Compare
pushed a new version ⬆️ |
vndr recreates vendor each time and I think it's safer that way and better to fix per repo :) |
That still looks like a big waste, even to fix per repo. Nothing should happen if the available version is the one the user asked for |
|
I added a new patch to replace vndr with trash (discussion here: LK4D4/vndr#27) It makes faster also the case when vendor.conf is changed. |
@LK4D4 I’m sorry; what does that mean / imply for this project, and what does “fix per repo” mean? |
If I understand correctly, this PR even before the move to Is the benefit that after the user edits |
@mtrmac the benefit is that once you edit |
I will admit to several times a month editing a copy of the code in I guess I’d slightly prefer merging the immediate productivity fix of not re-running a vendoring tool (any vendoring tool) on every test run, and splitting the tool change to a separate PR, over blocking the productivity fix on a tool choice discussion… but then, *shrug*, I don’t know much about the available choices, I don’t care all that much, and I would just defer to @runcom on the tool choice anyway… |
b6c6b5c
to
a19e3a9
Compare
No description provided.