acton
acton copied to clipboard
Place unix env var related things in `env.envvars`
actor _EnvEnvvars():
action def get(name: str) -> ?str:
"""Get the value of an environment variable"""
res = getb(name.encode())
if res is not None:
return res.decode()
return None
action def getb(name: bytes) -> ?bytes:
"""Get the value of an environment variable"""
NotImplemented
action def set(n: str, v: str) -> None:
"""Set the value of an environment variable"""
setb(n.encode(), v.encode())
action def setb(n: bytes, v: bytes) -> None:
"""Set the value of an environment variable"""
NotImplemented
action def unset(n: str) -> None:
"""Unset an environment variable"""
unsetb(n.encode())
action def unsetb(n: bytes) -> None:
"""Unset an environment variable"""
NotImplemented
I attempted this and realized that we currently don't run the Env init function - it is entirely constructed from C code, so adding that part
actor Env(...):
stdio = _EnvStdio()
becomes a real headache.. we really want to be able to run this based on the generated code for the Env initialization. I created #2368 for this
I think we need #2368 for this and since we haven't even designed how #2368 will work, that might take some time. Until further, deferring this till next year.