-
Notifications
You must be signed in to change notification settings - Fork 1k
Absorb prune into ensure #944
Comments
Can we keep LICENSE and COPYING files with a |
@VojtechVitek 💯 yes, will update OP, i think it'd be needlessly creating pain not to do that |
I assume you meant I already did 1, 2 & 3, I can send a PR (it can even be merged before 4 is completed since it doesn't impact behavior). I'm still working on 4 though. |
@sdboyer Just to check, after reading the comments in #903 I decided to update the signature of func (sm SourceManager) WriteDepTree(basedir string, l Lock, options PruneOptions) error I've moved the current implementation to |
derp, yes. updated OP. once, long ago, it was called
🎉 🎉 🎊 🎊 killin it! |
@karrick there's definitely a lot of overlap...or at least, adjacency...eventually between pruning and verification, but if the prune tree is the one we discussed in #121 (i haven't looked yet), then i think that's a separate kind of pruning from what's going on here. now, it's possible that we might be able to join these together. however, my current plan (as noted in the OP) is that if you do the kind of pruning this issue is focused on, then you don't get |
I'd like a flag to turn off pruning, for situations where speed is essential such as CI. |
@docmerlin if you care about speed:
|
i don't think pruning, at least once absorbed into ensure, is ever likely to contribute much to slowdowns. i'd need to see evidence to the contrary before i could consider adding another flag. |
Yeah, pruning will likely be even faster, since we can avoid all the extra I/O operations. Let's not add any more flags. This should be the default behavior imho. |
for now, at least, we generally have to write out the full tree, then prune items out, so we can't realize this gain right now. but you're certainly right that we have the headroom to be able to explore avoiding writing files that will be pruned in the first place. |
Can we please also have some more fine grained options for when needed. For example when using a dependency such as https://github.com/capnproto/go-capnproto2, I would like to still vendor the https://github.com/capnproto/go-capnproto2/tree/master/capnpc-go directory (and all its content) and the https://github.com/capnproto/go-capnproto2/blob/master/std/go.capnp file. This is useful as those files are still dependencies for our builds, even though they are not used go packages in our project or go-files. In such cases it could be great if we could add some exception filters or w/e on a per dependency basis. Perhaps this scenarios is rare. But without such a possibility I would be resorted to use some shell script on top of |
question about pruning / might be related, is there similar configuration as the govendor ignore build tag flag? use case is to ignore all |
I'm not too certain what we're trying to solve with It seems like there's risk in pruning files that need to be around for a project dependency to build. |
my initial take was more along these lines, but many folks consider this a hard requirement for using dep, as they want to keep the size of their
ah, that's a separate thing. pruning is strictly about removing excess files from
it's possible that we could add some more rules, but we need to be careful about this. we're going to have [[projects]]
branch = "master"
name = "github.com/foo/bar"
packages = ["."]
revision = "cd8b52f8269e01eb486dfeef29f8fe4d5b397e0b"
tree-digest = "0ba2aa4b3860c5fcc1219b31afaf30c1fcf3b97cbb0a5116b498cafedbb06a1b" that'll be a hash digest of the contents of the original, unpruned tree. awesome if you're not pruning, but useless if you are - the digests won't match. we need another hash of the tree AFTER pruning for it to be useful: tree-digest = "0ba2aa4b3860c5fcc1219b31afaf30c1fcf3b97cbb0a5116b498cafedbb06a1b"
pruned-digest = "1ed417a0bec57ffe988fae1cba8f3d49934fb873394d61844e0b3c96d69573fe" if we're going to do that, though, then we need new ways of answering the question of "are imports/ the main reason i proposed pruning be controlled via a set of boolean flags is because it would make a comprehensible way of capturing what the applied pruning options are. say [tree-digests]
V = "0ba2aa4b3860c5fcc1219b31afaf30c1fcf3b97cbb0a5116b498cafedbb06a1b"
VUTN = "1ed417a0bec57ffe988fae1cba8f3d49934fb873394d61844e0b3c96d69573fe" note that i'm not saying this will be the final form - maybe we use full words, maybe we express as the integer value of the bitfield; maybe we only include the explicit pruned value, rather than always having just the if we provide anything other than boolean controls here, then we'd likely have to just hash the prune options. i think that would probably work, but it'd be a hash key pointing to a hash value - utterly useless for understanding what's going on. we can certainly think about adding more boolean options - for example, we could divide "non-go" files into strictly now, maybe those wouldn't cover your |
@GlenDC It's worth it to reaffirm that pruning (beyond removing nested vendor dirs) is opt-in and not forced. So in the worst case scenario, you can just keep all options off and now files will be deleted. I was thinking of adding an exception list to prune options, but that would complicate vendor verification in addition to the points @sdboyer mentioned. |
What's the status of this? It looks like some relevant PRs have been merged, but I can't tell whether this is nearing completion or not. Does it seem close? :) |
they've both been merged into a temporary release branch to coordinate change sets prior to release. we're now blocking on getting the release ready, which is mostly a docs thing - #1499. we don't want to put all this pruning stuff in until just before release, as it will make tip workflows uncomfortably at odds with existing releases.
gonna be moving to a regular release schedule after this one, to hopefully make these lagging releases less of a problem.
…On January 9, 2018 11:29:29 AM PST, Jeff Grafton ***@***.***> wrote:
Any update? Both #1226 and #1219 have merged.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#944 (comment)
|
and we are finally, FINALLY ready. |
It's merged in, closing this. Release coming presently... |
/cc @fejta |
The 'prune' command has been absorbed into 'ensure', see golang/dep#944. Also it received some makeover, allowing tests to be pruned. 'dep ensure' now got rid of a bunch of files for us.
'prune' is now part of 'ensure' and configured on per-project-level in Gopkg.toml. See golang/dep#944.
dep prune
currently exists as a separate command. This is not optimal; we want to incorporate its behavior intodep ensure
directly, obviating the need to run the extra command.Projects relying on pruning will necessarily have to give up on (fast)
vendor/
verification - #121, as that verification will need to rely on a hash of each dependency project's entire tree, prior to pruning. That's just going to be a cost of doing business.This will involve a few things:
type PruneOptions uint8
) in gps representing the orthogonal, combinable pruning modes:i. Remove
*_test.go
filesii. Remove non-go files (except LICENSE, COPYING)
iii. Remove unused packages
iv. Remove nested
vendor
dirs (note that gps needs to have this as a flag, but dep unconditionally sets it - we do not give the user the option to NOT strip vendor directories)Gopkg.toml
that allows the user to specify each of these separately. I'm imagining something like this:gps.WriteDepTree()
to take a struct with aPruneOptions
bitfield. (Keep an eye on [WIP] Parallelised gps.WriteDepTree #903, this overlaps with that)cmd/dep/prune.go
, moving it over into unexported functions in gps thatgps.WriteDepTree()
calls into itself to perform the pruning.#120 is absurdly long and less relevant now, so I'm going to close it in favor of this.
The text was updated successfully, but these errors were encountered: