Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix env #683

Merged
merged 4 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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