Skip to content

os.Environ() returns live environment rather than copy #2646

@dkegel-fastly

Description

@dkegel-fastly

Tinygo's os tests include TestClearenv from upstream, but it fails frequently because it assumes os.Environ() returns a copy of the environment.
This is the case upstream, but in tinygo, it returns pointers to the live environment. Thus in tinygo, os.Environ() can go invalid the moment any environment variable is deleted.

We should probably disable TestClearenv until that's fixed, otherwise TestClearenv will continue to fail, causing spurious failures on unrelated changes in CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions