spawn-wrap icon indicating copy to clipboard operation
spawn-wrap copied to clipboard

Support running with unwritable homedir

Open Krinkle opened this issue 6 years ago • 2 comments

This follows-up from https://github.com/tapjs/spawn-wrap/issues/3 and https://github.com/tapjs/spawn-wrap/issues/49.

The CI environment I use for some projects runs builds in a Docker container as nobody and its default of HOME=/nonexistent. Due to this, projects using spawn-wrap (such as istanbuljs/nyc for code coverage), fail to operate in CI as it tries to unconditionally make a (temporary) directory in HOME.

Downstream:

  • https://github.com/istanbuljs/nyc/issues/951
  • https://phabricator.wikimedia.org/T212602#4847719

Would you be open toward a patch that considers XDG_CACHE_HOME before falling back to HOME?

This way, we wouldn't have to maintain an hardcoded exception in our CI environment (or in package.json#scripts.test) that sets SPAWN_WRAP_SHIM_ROOT. I imagine this would be beneficial to other users as well.

Thanks.

Krinkle avatar Jan 02 '19 01:01 Krinkle

An alternative would be to use /tmp. spawn-wrap doesn't really have to use the home directory, any directory with write access should work. XDG_CACHE_HOME is also a fitting location to use.

demurgos avatar May 07 '19 15:05 demurgos

@demurgos This library originally used /tmp, but this was changed due to #3.

It needs both write access and allow executable files.

Krinkle avatar May 07 '19 15:05 Krinkle