Skip to content

Commit

Permalink
Merge #748
Browse files Browse the repository at this point in the history
748: Allow variable definitions in env.pasthrough. r=otavio a=Alexhuszagh

Allow the following syntax:

```toml
[build.env]
passthrough = ["VAR=VALUE"]
```

Closes #743.

Co-authored-by: Alex Huszagh <ahuszagh@gmail.com>
  • Loading branch information
bors[bot] and Alexhuszagh authored Jun 3, 2022
2 parents 87a322e + 0d73a98 commit 9a23e02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- #748 - allow definitions in the environment variable passthrough
- #741 - added `armv7-unknown-linux-gnueabi` and `armv7-unknown-linux-musleabi` targets.
- #377 - update WINE versions to 7.0.
- #734 - patch `arm-unknown-linux-gnueabihf` to build for ARMv6, and add architecture for crosstool-ng-based images.
Expand Down
7 changes: 4 additions & 3 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ pub fn run(
let mut docker = docker_command("run")?;

let validate_env_var = |var: &str| -> Result<()> {
if var.contains('=') {
bail!("environment variable names must not contain the '=' character");
}
let var = match var.split_once('=') {
Some((key, _)) => key,
_ => var,
};

if var == "CROSS_RUNNER" {
bail!("CROSS_RUNNER environment variable name is reserved and cannot be pass through");
Expand Down

0 comments on commit 9a23e02

Please sign in to comment.