-
Notifications
You must be signed in to change notification settings - Fork 22
Fix clean up of downloaded modules when using go.mod #50
Fix clean up of downloaded modules when using go.mod #50
Conversation
Interestingly, based on the coverage report it appears that 1.12 left the module cache directories writable as it appears the onerror never triggers for that version. Any suggestions on what to do here? |
probably what I suggested here: #49 (comment) |
@asottile I updated the code to use that mechanism, the problem is that for golang 1.12 it appears the I'm not sure how I can get 100% coverage here with the run against golang 1.12 and golang 1.13 having coverage assessed separately |
oh sorry it wasn't clear:
|
@asottile ah, you meant bump to 1.14 and 1.15 |
@asottile should https://github.com/asottile/setuptools-golang/blob/master/setuptools_golang.py#L191 be bumped as well to default to a tested version? and if so to 1.15.1 or 1.14.8? |
yeah I usually bump all 3 at the same time (do you want to separate that patch out to a separate PR?) |
sure, I'll put one up in a while, might be tomorrow though |
sounds good -- no problem! thanks for working on this :) |
@asottile meant to ask, do you prefer the PR to have a clean history e.g. rebase onto latest, or squash on merge? Just that this has obviously picked up a few additional merges. |
rebase would be nice if you're willing |
16f7c4c
to
a8c7e50
Compare
Projects that use go.mod will result in the build downloading the modules to an temporary path. Golang introduced read only directories to protect the generated module cache from accidental writes, resulting in failures to build when exiting the temporary directory context. Adapt the solution from pre-commit to make the directory and file writable on removal and include a rudimentary test that exercises download via a simple example module hosted by the golang org in github. Fixes asottile-archive#49
a8c7e50
to
0a61e39
Compare
Done, corrected the function description on rmtree to indicate it's no longer limited to Windows only and instead required due to newer versions of golang making module caches read-only. |
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.
thanks again! I've uploaded 2.2.0 with this and the other changes \o/ |
Projects that use go.mod will result in the build downloading the
modules to an temporary path. Golang introduced read only directories to
protect the generated module cache from accidental writes, resulting in
failures to build when exiting the temporary directory context.
Adapt the solution from pre-commit to make the directory and file
writable on removal and include a rudimentary test that exercises
download via a simple example module hosted by the golang org in github.
Fixes #49