Skip to content

Commit 180e344

Browse files
committed
Release 0.1.15
1 parent fe32739 commit 180e344

6 files changed

+33
-29
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased]
77

8+
## [v0.1.15] - 2019-09-04
9+
810
- Images are now hosted at https://hub.docker.com/r/rustembedded/cross.
911
- Bump OpenSSL version to 1.0.2p.
1012
- Bump musl version to 1.1.20.
@@ -207,7 +209,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
207209

208210
- Initial release. Supports 12 targets.
209211

210-
[Unreleased]: https://github.com/rust-embedded/cross/compare/v0.1.14...HEAD
212+
[Unreleased]: https://github.com/rust-embedded/cross/compare/v0.1.15...HEAD
213+
[v0.1.15]: https://github.com/rust-embedded/cross/compare/v0.1.14...v0.1.15
211214
[v0.1.14]: https://github.com/rust-embedded/cross/compare/v0.1.13...v0.1.14
212215
[v0.1.13]: https://github.com/rust-embedded/cross/compare/v0.1.12...v0.1.13
213216
[v0.1.12]: https://github.com/rust-embedded/cross/compare/v0.1.11...v0.1.12

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords = ["cross", "compilation", "testing", "tool"]
77
license = "MIT OR Apache-2.0"
88
name = "cross"
99
repository = "https://github.com/rust-embedded/cross"
10-
version = "0.1.15-dev"
10+
version = "0.1.15"
1111

1212
[dependencies]
1313
atty = "0.2"

README.md

+16-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[![crates.io](https://img.shields.io/crates/v/cross.svg)](https://crates.io/crates/cross)
22
[![crates.io](https://img.shields.io/crates/d/cross.svg)](https://crates.io/crates/cross)
3-
[![Build Status](https://travis-ci.org/rust-embedded/cross.svg?branch=master)](https://travis-ci.org/rust-embedded/cross)
3+
[![Build Status](https://img.shields.io/azure-devops/build/rust-embedded/c0ce10ee-fd41-4551-b3e3-9612e8ab62f3/2/master)](https://dev.azure.com/rust-embedded/cross/_build?definitionId=2)
44
[![Docker Pulls](https://img.shields.io/docker/pulls/rustembedded/cross)](https://hub.docker.com/r/rustembedded/cross)
55

66
# `cross`
77

8-
> "Zero setup" cross compilation and "cross testing" of Rust crates
8+
> Zero setup cross compilation and cross testing of Rust crates
99
1010
This project is developed and maintained by the [Tools team][team].
1111

@@ -19,8 +19,6 @@ This project is developed and maintained by the [Tools team][team].
1919
<em>`cross test`ing a crate for the aarch64-unknown-linux-gnu target</em>
2020
</p>
2121
22-
**Disclaimer**: Only works on a x86_64 Linux host (e.g. Travis CI is supported)
23-
2422
## Features
2523

2624
- `cross` will provide all the ingredients needed for cross compilation without
@@ -29,7 +27,7 @@ This project is developed and maintained by the [Tools team][team].
2927
- `cross` provides an environment, cross toolchain and cross compiled libraries
3028
(e.g. OpenSSL), that produces the most portable binaries.
3129

32-
- "cross testing", `cross` can test crates for architectures other than i686 and
30+
- cross testing, `cross` can test crates for architectures other than i686 and
3331
x86_64.
3432

3533
- The stable, beta and nightly channels are supported.
@@ -38,10 +36,10 @@ This project is developed and maintained by the [Tools team][team].
3836

3937
- [rustup](https://rustup.rs/)
4038

41-
- [Docker](https://www.docker.com/). Note that non-sudo users need to be in the
42-
`docker` group. Read the official [post-installation steps for Linux][post].
39+
- [Docker](https://www.docker.com/). Note that on Linux non-sudo users need to be in the
40+
`docker` group. Read the official [post-installation steps][post].
4341

44-
[post]: https://docs.docker.com/engine/installation/linux/linux-postinstall/
42+
[post]: https://docs.docker.com/install/linux/linux-postinstall/
4543

4644
- A Linux kernel with [binfmt_misc] support is required for cross testing.
4745

@@ -83,7 +81,7 @@ You can place a `Cross.toml` file in the root of your Cargo project to tweak
8381

8482
`cross` provides default Docker images for the targets listed below. However, it
8583
can't cover every single use case out there. For other targets, or when the
86-
default image is not enough, you can use the `target.$TARGET.image` field in
84+
default image is not enough, you can use the `target.{{TARGET}}.image` field in
8785
`Cross.toml` to use custom Docker image for a specific target:
8886

8987
``` toml
@@ -103,12 +101,12 @@ the default one. Normal Docker behavior applies, so:
103101
- If only `tag` is omitted, then Docker will use the `latest` tag.
104102

105103
It's recommended to base your custom image on the default Docker image that
106-
cross uses: `rustembedded/cross:$TARGET-$VERSION` (where `$VERSION` is cross's version).
104+
cross uses: `rustembedded/cross:{{TARGET}}-{{VERSION}}` (where `{{VERSION}}` is cross's version).
107105
This way you won't have to figure out how to install a cross C toolchain in your
108106
custom image. Example below:
109107

110108
``` Dockerfile
111-
FROM rustembedded/cross:aarch64-unknown-linux-gnu-0.1.4
109+
FROM rustembedded/cross:aarch64-unknown-linux-gnu-0.1.15
112110

113111
RUN dpkg --add-architecture arm64 && \
114112
apt-get update && \
@@ -129,7 +127,6 @@ environment.
129127
In the instances that you do want to pass through environment variables, this
130128
can be done via `build.env.passthrough` in your `Cross.toml`:
131129

132-
133130
```toml
134131
[build.env]
135132
passthrough = [
@@ -153,7 +150,7 @@ passthrough = [
153150

154151
By default, `cross` uses `cargo` to build your Cargo project *unless* you are
155152
building for one of the `thumbv*-none-eabi*` targets; in that case, it uses
156-
`xargo`. However, you can use the `build.xargo` or `target.$TARGET.xargo` field
153+
`xargo`. However, you can use the `build.xargo` or `target.{{TARGET}}.xargo` field
157154
in `Cross.toml` to force the use of `xargo`:
158155

159156
``` toml
@@ -175,8 +172,8 @@ that only support `xargo`.
175172

176173
## Supported targets
177174

178-
A target is considered as "supported" if `cross` can cross compile a
179-
"non-trivial" (binary) crate, usually Cargo, for that target.
175+
A target is considered as supported if `cross` can cross compile a
176+
non-trivial (binary) crate, usually Cargo, for that target.
180177

181178
Testing support (`cross test`) is more complicated. It relies on [QEMU]
182179
emulation, so testing may fail due to QEMU bugs rather than bugs in your crate.
@@ -260,7 +257,7 @@ where libc was extracted.
260257
### QEMU_STRACE (v0.1.9+)
261258

262259
You can set the QEMU_STRACE variable when you use `cross run` to get a backtrace
263-
of system calls from "foreign" (non x86_64) binaries.
260+
of system calls from foreign (non x86_64) binaries.
264261

265262
```
266263
$ cargo new --bin hello && cd $_
@@ -276,14 +273,14 @@ $ QEMU_STRACE=1 cross run --target aarch64-unknown-linux-gnu
276273
9 exit_group(0)
277274
```
278275

279-
## Caveats / gotchas
276+
## Caveats
280277

281278
- path dependencies (in Cargo.toml) that point outside the Cargo project won't
282279
work because `cross` use docker containers only mounts the Cargo project so
283280
the container doesn't have access to the rest of the filesystem.
284281

285282
- `cross` will mount the Cargo project as READ ONLY. Thus, if any crate attempts
286-
to modify its "source", the build will fail. Well behaved crates should only
283+
to modify its source, the build will fail. Well behaved crates should only
287284
ever write to `$OUT_DIR` and never modify `$CARGO_MANIFEST_DIR` though.
288285

289286
## License
@@ -292,7 +289,7 @@ Licensed under either of
292289

293290
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
294291
http://www.apache.org/licenses/LICENSE-2.0)
295-
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
292+
- MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
296293

297294
at your option.
298295

build-docker-image.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ cd docker
66

77
run() {
88
local dockerfile="Dockerfile.${1}"
9-
local image="rustembedded/cross:${1}"
9+
local image_name="rustembedded/cross:${1}"
1010

11-
if docker pull "${image}"; then
12-
cache_from_args=(--cache-from "${image}")
11+
if docker pull "${image_name}"; then
12+
cache_from_args=(--cache-from "${image_name}")
1313
fi
1414

15-
docker build ${cache_from_args[@]} --pull -t "${image}" -f "${dockerfile}" .
15+
docker build ${cache_from_args[@]} --pull -t "${image_name}" -f "${dockerfile}" .
16+
17+
version="$(cargo metadata --format-version 1 | jq --raw-output '.packages[] | select(.name == "cross") | .version')"
18+
19+
if ! [[ "${version}" =~ alpha ]] && ! [[ "${version}" =~ dev ]]; then
20+
versioned_image_name="${image_name}-${version}"
21+
docker tag "${image_name}" "${versioned_image_name}"
22+
fi
1623
}
1724

1825
if [ -z "${1}" ]; then

ci/docker_push.sh

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ set -eux
55
image_name="rustembedded/cross:${TARGET}"
66

77
if [[ "${TAG-}" =~ ^v.* ]] && ! [[ "${TAG}" =~ alpha ]] && ! [[ "${TAG}" =~ dev ]]; then
8-
version="${TAG##v}"
9-
versioned_image_name="${image_name}-${version}"
10-
docker tag "${image_name}" "${versioned_image_name}"
118
docker push "${versioned_image_name}"
129
fi
1310

0 commit comments

Comments
 (0)