-
Notifications
You must be signed in to change notification settings - Fork 1k
Non-deterministic cache location #1066
Comments
yep, having the cache location tied to a single GOPATH is less than ideal, largely for this reason. we selected i'm tentatively OK with adding an environment variable that can be used to override the default behavior. |
Can we change the cache's default location to a more typical location like |
yes, yes it will 😄 |
@sudo-suhas still interested in working on this? |
Yes @sdboyer, I am interested in working on this, Could you give me a couple of pointers for where I would need to do the changes? |
@sudo-suhas the path that's ultimately used is set centrally here. however, it's not allowed to read directly from the env at that point - external state like that should be injected at the time the i don't think there should be much more involved than work around those two points, though. |
@sdboyer Need a little help with writing the tests.
Also, what would be the right place to document this? |
i don't think we need to worry about this - it's really not in the scope of that package's responsibility to make sure that it's written to the correct place on disk. that's gps' job, and that's where the test belong for it. it's probably sufficient here to just have an integration test that makes sure the env var is being respected. that'll mean compiling and invoking a subprocess in the test - you could probably borrow from the testing harness for that, though i doubt you can use the testing harness directly for the check you need to do. |
Turns out I cannot add the test in Regarding the integration test, I did the following:
This ends up pulling something into the cache directory. What it be enough to check that the folder |
could we move more itemized discussion to a PR? |
What version of Go (
go version
) anddep
(git describe --tags
) are you using?What
dep
command did you run?What did you expect to see?
I like to differentiate the Go tools I use with Go like
gometalinter
and install them to a separate location than%gopath%
. I did the same withdep
(installed toE:\Installs\go-tools
). I was expecting that the cache would be stored in this Go workspace(E:\Installs\go-tools\pkg\dep
).What did you see instead?
The cache was generated in
%gopath%/pkg/dep
and not relative to the actual installation path ofdep
. While this is by no means a serious issue, this can negatively affect performance for anybody who uses multiple go workspaces. I think it will be better to have a cache location which is independent of the%gopath%
. I apologise if this is a known limitation or if it has been reported already.The text was updated successfully, but these errors were encountered: