Skip to content

Commit 356fecd

Browse files
authored
Merge branch 'nix-rust:master' into master
2 parents 5b7a353 + 4ab23c3 commit 356fecd

File tree

128 files changed

+8162
-6592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+8162
-6592
lines changed

.cirrus.yml

Lines changed: 1 addition & 290 deletions
Original file line numberDiff line numberDiff line change
@@ -65,306 +65,17 @@ task:
6565
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
6666
before_cache_script: rm -rf $CARGO_HOME/registry/index
6767

68-
# Test macOS aarch64 in a full VM
69-
task:
70-
name: macOS aarch64
71-
env:
72-
TARGET: aarch64-apple-darwin
73-
macos_instance:
74-
image: ghcr.io/cirruslabs/macos-ventura-base:latest
75-
setup_script:
76-
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
77-
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
78-
- . $HOME/.cargo/env
79-
- rustup component add clippy
80-
<< : *TEST
81-
before_cache_script: rm -rf $CARGO_HOME/registry/index
82-
83-
# Use cross for QEMU-based testing
84-
# cross needs to execute Docker, so we must use Cirrus's Docker Builder task.
85-
task:
86-
depends_on:
87-
- FreeBSD 14 amd64 & i686
88-
- Linux x86_64
89-
- macOS aarch64
90-
- Rust Formatter
91-
- OpenBSD x86_64
92-
- Minver
93-
- Rust Stable
94-
env:
95-
RUST_TEST_THREADS: 1 # QEMU works best with 1 thread
96-
HOME: /tmp/home
97-
HOST: x86_64-unknown-linux-gnu
98-
PATH: $HOME/.cargo/bin:$PATH
99-
RUSTFLAGS: --cfg qemu -D warnings
100-
TOOL: cross
101-
matrix:
102-
- name: Linux arm gnueabi
103-
env:
104-
TARGET: arm-unknown-linux-gnueabi
105-
- name: Linux armv7 gnueabihf
106-
env:
107-
TARGET: armv7-unknown-linux-gnueabihf
108-
- name: Linux i686
109-
env:
110-
TARGET: i686-unknown-linux-gnu
111-
- name: Linux i686 musl
112-
env:
113-
TARGET: i686-unknown-linux-musl
114-
- name: Linux MIPS
115-
env:
116-
TARGET: mips-unknown-linux-gnu
117-
- name: Linux MIPS64
118-
env:
119-
TARGET: mips64-unknown-linux-gnuabi64
120-
- name: Linux MIPS64 el
121-
env:
122-
TARGET: mips64el-unknown-linux-gnuabi64
123-
- name: Linux mipsel
124-
env:
125-
TARGET: mipsel-unknown-linux-gnu
126-
- name: Linux powerpc64le
127-
env:
128-
TARGET: powerpc64le-unknown-linux-gnu
129-
compute_engine_instance:
130-
image_project: cirrus-images
131-
image: family/docker-builder
132-
platform: linux
133-
cpu: 1 # Since QEMU will only use 1 thread
134-
memory: 4G
135-
setup_script:
136-
- mkdir /tmp/home
137-
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
138-
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
139-
- . $HOME/.cargo/env
140-
- cargo install cross --version 0.2.5
141-
<< : *TEST
142-
before_cache_script: rm -rf $CARGO_HOME/registry/index
143-
144-
# Tasks for Linux native builds
68+
# Tasks for Linux aarch64 native builds
14569
task:
14670
matrix:
14771
- name: Linux aarch64
14872
arm_container:
14973
image: rust:1.69.0
15074
cpu: 1
151-
depends_on:
152-
- FreeBSD 14 amd64 & i686
153-
- Linux x86_64
154-
- macOS aarch64
155-
- Rust Formatter
156-
- OpenBSD x86_64
157-
- Minver
158-
- Rust Stable
15975
env:
16076
TARGET: aarch64-unknown-linux-gnu
161-
- name: Linux x86_64
162-
container:
163-
image: rust:1.69.0
164-
cpu: 1
165-
env:
166-
TARGET: x86_64-unknown-linux-gnu
167-
- name: Linux x86_64 musl
168-
container:
169-
image: rust:1.69.0
170-
cpu: 1
171-
depends_on:
172-
- FreeBSD 14 amd64 & i686
173-
- Linux x86_64
174-
- macOS aarch64
175-
- Rust Formatter
176-
- OpenBSD x86_64
177-
- Minver
178-
- Rust Stable
179-
env:
180-
TARGET: x86_64-unknown-linux-musl
18177
setup_script:
18278
- rustup target add $TARGET
18379
- rustup component add clippy
18480
<< : *TEST
18581
before_cache_script: rm -rf $CARGO_HOME/registry/index
186-
187-
task:
188-
name: Rust Stable
189-
container:
190-
image: rust:latest
191-
cpu: 1
192-
env:
193-
TARGET: x86_64-unknown-linux-gnu
194-
setup_script:
195-
- rustup component add clippy
196-
<< : *TEST
197-
before_cache_script: rm -rf $CARGO_HOME/registry/index
198-
199-
# Tasks for cross-compiling, but no testing
200-
task:
201-
container:
202-
image: rust:1.69.0
203-
cpu: 1
204-
depends_on:
205-
- FreeBSD 14 amd64 & i686
206-
- Linux x86_64
207-
- macOS aarch64
208-
- Rust Formatter
209-
- OpenBSD x86_64
210-
- Minver
211-
- Rust Stable
212-
env:
213-
BUILD: check
214-
HOST: x86_64-unknown-linux-gnu
215-
matrix:
216-
# Cross claims to support Android, but when it tries to run Nix's tests it
217-
# reports undefined symbol references.
218-
- name: Android aarch64
219-
env:
220-
TARGET: aarch64-linux-android
221-
- name: Android arm
222-
env:
223-
TARGET: arm-linux-androideabi
224-
- name: Android armv7
225-
env:
226-
TARGET: armv7-linux-androideabi
227-
- name: Android i686
228-
env:
229-
TARGET: i686-linux-android
230-
- name: Android x86_64
231-
env:
232-
TARGET: x86_64-linux-android
233-
- name: Linux arm-musleabi
234-
env:
235-
TARGET: arm-unknown-linux-musleabi
236-
- name: Fuchsia x86_64
237-
env:
238-
TARGET: x86_64-unknown-fuchsia
239-
- name: Illumos
240-
env:
241-
TARGET: x86_64-unknown-illumos
242-
# Cross claims to support running tests on iOS, but it actually doesn't.
243-
# https://github.com/rust-embedded/cross/issues/535
244-
- name: iOS aarch64
245-
env:
246-
# cargo hack tries to invoke the iphonesimulator SDK for iOS
247-
NOHACK: 1
248-
TARGET: aarch64-apple-ios
249-
# Cross claims to support Linux powerpc64, but it really doesn't.
250-
# https://github.com/rust-embedded/cross/issues/441
251-
- name: Linux powerpc64
252-
env:
253-
TARGET: powerpc64-unknown-linux-gnu
254-
- name: Linux s390x
255-
env:
256-
TARGET: s390x-unknown-linux-gnu
257-
- name: Linux x32
258-
env:
259-
TARGET: x86_64-unknown-linux-gnux32
260-
- name: NetBSD x86_64
261-
env:
262-
TARGET: x86_64-unknown-netbsd
263-
setup_script:
264-
- rustup target add $TARGET
265-
- rustup component add clippy
266-
<< : *BUILD
267-
before_cache_script: rm -rf $CARGO_HOME/registry/index
268-
269-
task:
270-
container:
271-
# Redox's MSRV policy is unclear. Until they define it, use nightly.
272-
image: rustlang/rust:nightly
273-
cpu: 1
274-
depends_on:
275-
- FreeBSD 14 amd64 & i686
276-
- Linux x86_64
277-
- macOS aarch64
278-
- Rust Formatter
279-
- OpenBSD x86_64
280-
- Minver
281-
- Rust Stable
282-
env:
283-
BUILD: check
284-
name: Redox x86_64
285-
env:
286-
HOST: x86_64-unknown-linux-gnu
287-
TARGET: x86_64-unknown-redox
288-
CLIPPYFLAGS: -D warnings
289-
setup_script:
290-
- rustup target add $TARGET
291-
- rustup component add clippy
292-
<< : *BUILD
293-
before_cache_script: rm -rf $CARGO_HOME/registry/index
294-
295-
## Rust Tier 3 targets can't use Rustup
296-
task:
297-
container:
298-
image: rustlang/rust:nightly
299-
cpu: 1
300-
env:
301-
BUILD: check
302-
HOST: x86_64-unknown-linux-gnu
303-
ZFLAGS: -Zbuild-std
304-
CLIPPYFLAGS: -D warnings
305-
matrix:
306-
- name: DragonFly BSD x86_64
307-
depends_on:
308-
- FreeBSD 14 amd64 & i686
309-
- Linux x86_64
310-
- macOS aarch64
311-
- Rust Formatter
312-
- OpenBSD x86_64
313-
- Minver
314-
- Rust Stable
315-
env:
316-
TARGET: x86_64-unknown-dragonfly
317-
- name: OpenBSD x86_64
318-
env:
319-
TARGET: x86_64-unknown-openbsd
320-
- name: Linux armv7 uclibceabihf
321-
depends_on:
322-
- FreeBSD 14 amd64 & i686
323-
- Linux x86_64
324-
- macOS aarch64
325-
- Rust Formatter
326-
- OpenBSD x86_64
327-
- Minver
328-
- Rust Stable
329-
env:
330-
TARGET: armv7-unknown-linux-uclibceabihf
331-
- name: Haiku x86_64
332-
depends_on:
333-
- FreeBSD 14 amd64 & i686
334-
- Linux x86_64
335-
- macOS aarch64
336-
- Rust Formatter
337-
- OpenBSD x86_64
338-
- Minver
339-
- Rust Stable
340-
env:
341-
TARGET: x86_64-unknown-haiku
342-
setup_script:
343-
- rustup component add rust-src
344-
<< : *BUILD
345-
before_cache_script: rm -rf $CARGO_HOME/registry/index
346-
347-
# Test that we can build with the lowest version of all dependencies.
348-
# "cargo test" doesn't work because some of our dev-dependencies, like
349-
# rand, can't build with their own minimal dependencies.
350-
task:
351-
name: Minver
352-
env:
353-
HOST: x86_64-unknown-linux-gnu
354-
container:
355-
image: rustlang/rust:nightly
356-
cpu: 1
357-
setup_script:
358-
- cargo update -Zminimal-versions
359-
check_script:
360-
- cargo check
361-
before_cache_script: rm -rf $CARGO_HOME/registry/index
362-
363-
# Tasks that checks if the code is formatted right using `cargo fmt` tool
364-
task:
365-
name: Rust Formatter
366-
container:
367-
image: rust:latest
368-
cpu: 1
369-
setup_script: rustup component add rustfmt
370-
test_script: cargo fmt --all -- --check **/*.rs

.github/actions/build/action.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 'Build'
2+
description: 'Build nix'
3+
inputs:
4+
# This is required
5+
TARGET:
6+
required: true
7+
8+
BUILD:
9+
required: false
10+
default: build
11+
12+
CLIPPYFLAGS:
13+
required: false
14+
default: -D warnings -A unknown-lints
15+
16+
RUSTFLAGS:
17+
required: false
18+
default: -D warnings -A unknown-lints
19+
20+
RUSTDOCFLAGS:
21+
required: false
22+
default: -D warnings
23+
24+
TOOL:
25+
description: 'Tool used to involve the BUILD command, can be cargo or cross'
26+
required: false
27+
default: cargo
28+
29+
ZFLAGS:
30+
required: false
31+
default:
32+
33+
NOHACK:
34+
description: "whether to run cargo hack"
35+
required: false
36+
default: false
37+
38+
runs:
39+
using: "composite"
40+
steps:
41+
- name: set up Rust env
42+
shell: bash
43+
run: |
44+
echo "RUSTFLAGS=${{ inputs.RUSTFLAGS }}" >> $GITHUB_ENV
45+
echo "RUSTDOCFLAGS=${{ inputs.RUSTDOCFLAGS }}" >> $GITHUB_ENV
46+
47+
- name: debug info
48+
shell: bash
49+
run: |
50+
${{ inputs.TOOL }} -Vv
51+
rustc -Vv
52+
53+
- name: build
54+
shell: bash
55+
run: ${{ inputs.TOOL }} ${{ inputs.BUILD }} ${{ inputs.ZFLAGS }} --target ${{ inputs.TARGET }} --all-targets --all-features
56+
57+
- name: doc
58+
shell: bash
59+
run: ${{ inputs.TOOL }} doc ${{ inputs.ZFLAGS }} --no-deps --target ${{ inputs.TARGET }} --all-features
60+
61+
- name: clippy
62+
shell: bash
63+
run: ${{ inputs.TOOL}} clippy ${{ inputs.ZFLAGS }} --target ${{ inputs.TARGET }} --all-targets --all-features -- ${{ inputs.CLIPPYFLAGS }}
64+
65+
- name: Set up cargo-hack
66+
if: inputs.NOHACK == 'false'
67+
uses: taiki-e/install-action@cargo-hack
68+
69+
- name: run cargo hack
70+
shell: bash
71+
if: inputs.NOHACK == 'false'
72+
run: ${{ inputs.TOOL }} hack ${{ inputs.ZFLAGS }} check --target ${{ inputs.TARGET }} --each-feature

0 commit comments

Comments
 (0)