Skip to content

Allow Environment Variable Definitions in env.passthrough. #743

Closed
@Alexhuszagh

Description

@Alexhuszagh

Checklist

Describe your request

Currently when we specify passthrough variables for cross, we cannot define the passthrough variable. docker run supports the --env VAR=VALUE syntax, so this should not require much work to support. In fact, removing the following lines and splitting on = to ensure that the key is not CROSS_RUNNER should fix this.

cross/src/docker.rs

Lines 118 to 124 in 1689de1

if var.contains('=') {
bail!("environment variable names must not contain the '=' character");
}
if var == "CROSS_RUNNER" {
bail!("CROSS_RUNNER environment variable name is reserved and cannot be pass through");
}

Describe why this would be a good inclusion for cross

Makes it a lot easier to use Cross.toml since you will not need wrapper scripts to define the environment variable value, or provide them every time on the command line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions