alvaroloes / enumer

A Go tool to auto generate methods for your enums
Other
478 stars 111 forks source link

invalid cross-device link #46

Closed robinknaapen closed 5 years ago

robinknaapen commented 5 years ago

When using enumer in a CI environment I encounter this issue.

enumer: moving tempfile to output file: rename /tmp/SomeType_enumer_457916248 sometype_enumer.go: invalid cross-device link

Due to how the container is sandboxed, this is not possible in my case.

In my opinion this should be a setting?

glowa001 commented 5 years ago

I have the same problem

robinknaapen commented 5 years ago

A workaround is to set $TMPDIR to some accessible location eg: export TMPDIR=$HOME/tmp

alvaroloes commented 5 years ago

🤔 This must be caused but the latest version which first creates the generated file to a temp file and the moves it.

Thanks for the workaround Robin

osctobe commented 5 years ago

This is caused by 2615c451cef481904bad24495084d0bfeeb5a3d1. It should generate the file as "output name" + random suffix (ideally using mkstemp() to avoid races, or at least put the temporary file in output dir).

robinknaapen commented 5 years ago

https://github.com/wercker/mhook/issues/12#issuecomment-490482426