magefile / mage

a Make/rake-like dev tool using Go
https://magefile.org
Apache License 2.0
4.01k stars 250 forks source link

Enhancement: Support invocation from a read-only directory #446

Open charles-dyfis-net opened 1 year ago

charles-dyfis-net commented 1 year ago

Describe the feature At present, mage can only be run from a writable directory. This means a read-only source tree cannot be used to run even mage tasks which do not by nature attempt to create or modify existing files (think test invocations, or upload operations, or so forth).

Falling back to a newly-created location under TMPDIR for the executable being compiled -- or allowing an explicit environment variable to be used to specify the location to use -- would avoid outright failure in these scenarios.

What problem does this feature address? Allows use in environments where read-only trees are preferred for either security (least-privilege: if an operation isn't intended to modify the source it comes from, why let it?) or efficiency (a read-only tree can live in an immutable shared store) reasons.

Additional context N/A