https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

11/05/2021, 7:49 PM
Is it possible to use $HOME or ~ in extra_env_vars?
h

hundreds-father-404

11/05/2021, 7:50 PM
Do you mean combine
$HOME
with another env var to create a value, like this?
Copy code
FOO="${HOME}/bar"
l

loud-laptop-17949

11/05/2021, 8:13 PM
yes
i can't seem to find this documented
h

hundreds-father-404

11/05/2021, 8:17 PM
I do not think that's possibly currently, unfortunately. But you can propagate
HOME
, so I wonder if you can construct
FOO
in your Python code itself e.g. by changing
os.environ
?
l

loud-laptop-17949

11/05/2021, 8:18 PM
yeah I definitely could, just trying to see if I can get pants build working without changing much of our apps
👍 1
actually, this may be irrelevant because with pants we probably won't be able to read files from outside the pants build root, right?
h

hundreds-father-404

11/05/2021, 8:24 PM
If you're using an absolute path, you technically can still open it. It is discouraged because it hurts reproducibility / Works On My Machine errors, will break if you ever use Remote Execution, and is not safe with caching if the file were to ever change. But, it is allowed Mind sharing what the use case is?
l

loud-laptop-17949

11/05/2021, 8:43 PM
we use it for some encryption keys to access secrets
we are trying to get rid of this system, but have to partially live with it for now
7 Views