From 716f1298b7616f22eb94c50a911a72012fbc93a7 Mon Sep 17 00:00:00 2001 From: Andreas Hartmann Date: Tue, 6 Feb 2024 21:28:55 +0100 Subject: [PATCH] WIP: README: Update an example and apply some of the review suggestions. --- README.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 379f49d36..b97eeb978 100644 --- a/README.md +++ b/README.md @@ -95,14 +95,20 @@ format for configuration and the possible configuration values are documented #### Option 1: Configuring `cross` directly in your `Cargo.toml` You can directly set [configuration values][config_file] in your `Cargo.toml` -file, under the `[package.metadata.cross]` table, i.e. key prefix. An example +file, under the `[workspace.metadata.cross]` table, i.e. key prefix. An example config snippet would look like this: ```toml,cargo -[package.metadata.cross.target.aarch64-unknown-linux-gnu] -xargo = false -image = "test-image" -runner = "custom-runner" +[workspace.metadata.cross.target.aarch64-unknown-linux-gnu] +# Install libssl-dev:arm64, see +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH", + "apt-get update && apt-get --assume-yes install libssl-dev:$CROSS_DEB_ARCH" +] +[workspace.metadata.cross.target.armv7-unknown-linux-gnueabi] +image = "my/image:latest" +[workspace.metadata.cross.build] +env.volumes = ["A_DIRECTORY=/path/to/volume"] ``` #### Option 2: Configuring `cross` via a `Cross.toml` file @@ -268,17 +274,17 @@ terminate. [4] libc = newlib -[5] Must change `image = - "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos"` in `Cross.toml` - for `[target.x86_64-unknown-linux-gnu]` to use the CentOS7-compatible - target. +[5] Must change + `image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main-centos"` in + `Cross.toml` for `[target.x86_64-unknown-linux-gnu]` to use the + CentOS7-compatible target. [6] libc = emscripten and GCC = clang -[7] Must change `image = - "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos"` in `Cross.toml` - for `[target.aarch64-unknown-linux-gnu]` to use the CentOS7-compatible - target. +[7] Must change + `image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main-centos"` in + `Cross.toml` for `[target.aarch64-unknown-linux-gnu]` to use the + CentOS7-compatible target.