Skip to content

Commit

Permalink
Merge #683
Browse files Browse the repository at this point in the history
683: fix env r=reitermarkus a=Emilgardis

Fixes a wrong assumption done in #670 where we went from

```toml
[target.aarch64-unknown-linux-gnu.env]
volumes = [
    "BUILD_DIR",
]
```

to

```toml
[target.aarch64-unknown-linux-gnu]
volumes = [
    "BUILD_DIR",
]
```

this fixes that, and makes sure that all markdown toml fences are checked in CI for correctness.

This pr also "un-opts" what was previously `CrossBuildConfig` to simplify a bit, see #670 (comment)

Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
  • Loading branch information
bors[bot] and Emilgardis authored Apr 7, 2022
2 parents 90bb9f1 + c2563d4 commit 416548a
Show file tree
Hide file tree
Showing 11 changed files with 244 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
args: --locked
args: --locked --all-targets --workspace
timeout-minutes: 5

generate-matrix:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
target
**/target/
**/.idea/
**/.vscode/*.*
**/*.log
/cargo-timing*.html
59 changes: 58 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ atty = "0.2"
color-eyre = "0.6"
eyre = "0.6"
home = "0.5"
lazy_static = "1"
rustc_version = "0.4"
toml = "0.5"
which = { version = "4", default_features = false }
Expand All @@ -33,3 +32,8 @@ dunce = "1"

[profile.release]
lto = true

[dev-dependencies]
regex = "1"
once_cell = "1"
walkdir = "2"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ non-standard targets (i.e. something not reported by rustc/rustup). However,
you can use the `build.xargo` or `target.{{TARGET}}.xargo` field in
`Cross.toml` to force the use of `xargo`:

``` toml
```toml
# all the targets will use `xargo`
[build]
xargo = true
```

Or,

``` toml
```toml
# only this target will use `xargo`
[target.aarch64-unknown-linux-gnu]
xargo = true
Expand Down
12 changes: 10 additions & 2 deletions docs/cross_toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ The `target` key allows you to specify parameters for specific compilation targe

```toml
[target.aarch64-unknown-linux-gnu]
volumes = ["VOL1_ARG", "VOL2_ARG"]
passthrough = ["VAR1", "VAR2"]
xargo = false
image = "test-image"
runner = "custom-runner"
```

# `target.TARGET.env`
The `target` key allows you to specify environment variables that should be used for a specific compilation target.
This is similar to `build.env`, but allows you to be more specific per target.

```toml
[target.x86_64-unknown-linux-gnu.env]
volumes = ["VOL1_ARG", "VOL2_ARG"]
passthrough = ["IMPORTANT_ENV_VARIABLES"]
```
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ mod tests {
use std::matches;

fn toml(content: &str) -> Result<crate::CrossToml> {
Ok(CrossToml::from_str(content).wrap_err("couldn't parse toml")?)
Ok(CrossToml::parse(content).wrap_err("couldn't parse toml")?.0)
}

#[test]
Expand Down
Loading

0 comments on commit 416548a

Please sign in to comment.