alire
alire copied to clipboard
Running `alr` in folder owner by other user raises ALIRE.CHECKED_ERROR
If I change the current working directory to for example /
and then try to run any alr
command, I get:
stderr: Cannot create temporary file
raised ALIRE.CHECKED_ERROR : alire-stored-error:1
Thanks, there are two separate problems here:
- [ ] Just
alr
shouldn't fail anywhere. - [ ] Temporaries require write access to the current folder, but the error should be nicer.
Is this because of the GNAT-TEMP-000xxx.TMP files? (that seems to show up with strace)
It seems Alire.OS_Lib.Subprocess
calls Create_Temp_Output_File
.
An alternative is to replace this call with your own implementation to create a temp file. For Linux 3.17 with glibc 2.27, it could use memfd_create(2) (file lives in RAM), otherwise it could create a temp file in /tmp with mkstemp(3).
Yep, we are using the GNAT temp file API. The in-memory alternative looks nice, but we would need something portable.