Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

FAQ: document the removal of unnecessary packages, currently via dep prune #936

Closed
kevinburke opened this issue Aug 3, 2017 · 5 comments

Comments

@kevinburke
Copy link
Collaborator

kevinburke commented Aug 3, 2017

If I run dep init for this file:

package main

import (
	"crypto/rand"
	"log"

	"golang.org/x/crypto/ed25519"
)

func main() {
	_, _, err := ed25519.GenerateKey(rand.Reader)
	if err != nil {
		log.Fatal(err)
	}
}

The entire golang.org/x/crypto package gets checked into my vendor directory, which is sort of sad because I only need three files (out of 259) in that repo. This means more disk, more bandwidth, longer checkouts, harder to find what you are looking for &c.

It also seems like dep has the ability to determine which packages in a Git repo are actually being used, in the lock file:

[[projects]]
  branch = "master"
  name = "golang.org/x/crypto"
  packages = ["ed25519","ed25519/internal/edwards25519"]
  revision = "358f15eacb587b056fc93273b930314a5cda12fe"

It would be nice if dep only put the packages you needed in vendor or at the very least if there was an FAQ to the effect of "Why is dep checking in the entire Git repo when I only need one package?"

@kevinburke
Copy link
Collaborator Author

(my apologies if this has been previously reported - I scanned the FAQ questions, searched for "vendor git", "vendor git repo" and didn't see anything promising)

@sdboyer
Copy link
Member

sdboyer commented Aug 3, 2017

hi! dep prune will do what you want 😄

at some point - see the bottom of #120 - we intend to pull prune back up into dep ensure. just waitin for someone to find the time to work on it 😇

@sdboyer sdboyer closed this as completed Aug 3, 2017
@sdboyer
Copy link
Member

sdboyer commented Aug 3, 2017

actually, gonna reopen - let's call this one for writing up some basic docs on dep prune, as well as the intent to absorb it back up into ensure.

@sdboyer sdboyer reopened this Aug 3, 2017
@sdboyer sdboyer added the docs label Aug 3, 2017
@sdboyer sdboyer changed the title "dep init" checks out entire Git repo even if only one package is needed FAQ: document the removal of unnecessary packages, currently via dep prune Aug 3, 2017
@carolynvs
Copy link
Collaborator

I think this can be closed in favor of the existing issue for the prune documentation: #875?

@sdboyer
Copy link
Member

sdboyer commented Aug 4, 2017

oh, yes! i missed that. thanks 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants