acton icon indicating copy to clipboard operation
acton copied to clipboard

Place unix env var related things in `env.envvars`

Open plajjan opened this issue 6 months ago • 2 comments

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

plajjan avatar Jul 06 '25 04:07 plajjan

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

plajjan avatar Jul 18 '25 11:07 plajjan

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.

plajjan avatar Aug 08 '25 11:08 plajjan