Easy way to read from /tmp?

The CircleCI snap is published and our Docs have instructions to install it. Within 24 hours we hit our first weird issue.

It looks like the user cloned their Git repo to /tmp and tried to use the circleci snap to read a config file from there. We use a binary within Docker for the actual processing. The docker snap can read $HOME but I’m assuming can’t read /tmp which is what’s causing this issue.

Is there any suggested workaround for this aside from telling the user "don’t git clone to /tmp"?

no, this is exactly the workaround … :slight_smile: each snap has its own /tmp, transparently mapped … so you can only see snap owned files when looking at /tmp … but never the hosts /tmp

This user had an interesting note: https://discuss.circleci.com/t/circleci-cli-from-snap-cant-find-config-file/20406/6?u=felicianotech

Basically, even if the file in question is within $HOME, the snap won’t work if the current working directory isn’t within $HOME. Is that expected?

It is unexpected, but I suspect it may have something to do with how circleci is trying to resolve ‘~’ since, unlike an environment variable like $HOME, the application is expected to resolve that itself instead of the shell.