Skip to content

Commit a77ee05

Browse files
committed
fixup
1 parent 21c5b37 commit a77ee05

File tree

5 files changed

+75
-82
lines changed

5 files changed

+75
-82
lines changed

azure-pipelines.yml

Lines changed: 14 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ jobs:
77
vmImage: ubuntu-16.04
88
steps:
99
- template: ci/azure-install-rust.yml
10-
- bash: rustup target add $TARGET
11-
displayName: "add cross target"
12-
- bash: cargo generate-lockfile
13-
displayName: "generate lockfile libc"
14-
- bash: cargo generate-lockfile --manifest-path libc-test/Cargo.toml
15-
displayName: "generate lockfile libc-test"
16-
- script: sh ./ci/run-docker.sh $TARGET
17-
displayName: "run tests"
10+
- bash: |
11+
rustup target add $TARGET
12+
cargo generate-lockfile
13+
cargo generate-lockfile --manifest-path libc-test/Cargo.toml
14+
sh ./ci/run-docker.sh $TARGET
1815
strategy:
1916
matrix:
2017
aarch64-unknown-linux-android:
@@ -75,76 +72,46 @@ jobs:
7572
vmImage: macos-10.14
7673
steps:
7774
- template: ci/azure-install-rust.yml
78-
- bash: rustup target add $TARGET
79-
displayName: "add cross target"
80-
- bash: cargo generate-lockfile
81-
displayName: "generate lockfile libc"
82-
- bash: cargo generate-lockfile --manifest-path libc-test/Cargo.toml
83-
displayName: "generate lockgile libc-test"
84-
- script: sh ./ci/run.sh $TARGET
85-
displayName: "run tests"
75+
- bash: |
76+
rustup target add $TARGET
77+
cargo generate-lockfile
78+
cargo generate-lockfile --manifest-path libc-test/Cargo.toml
79+
sh ./ci/run.sh $TARGET
8680
strategy:
8781
matrix:
8882
i686-apple-darwin:
8983
TARGET: i686-apple-darwin
9084
x86_64-apple-darwin:
9185
TARGET: x86_64-apple-darwin
9286

93-
- job: Documentation
87+
- job: Style & Documentation
9488
pool:
9589
vmImage: ubuntu-16.04
9690
steps:
9791
- template: ci/azure-install-rust.yml
98-
- script: rustup component add rust-src
99-
displayName: "add rust-src component"
100-
- script: cargo install xargo
101-
displayName: "add xargo"
92+
- script: sh ci/style.sh
10293
- script: sh ci/dox.sh
10394

104-
- job: Style
105-
pool:
106-
vmImage: ubuntu-16.04
107-
steps:
108-
- template: ci/azure-install-rust.yml
109-
- bash: rustup target add x86_64-unknown-linux-gnu
110-
displayName: "add cross target"
111-
- script: rustc ci/style.rs && ./style src
112-
- script: |
113-
if rustup component add rustfmt-preview ; then
114-
cargo fmt --all -- --check
115-
fi
116-
11795
- job: SemverLinux
11896
continueOnError: true
11997
pool:
12098
vmImage: ubuntu-16.04
12199
steps:
122100
- template: ci/azure-install-rust.yml
123-
- bash: rustup target add x86_64-unknown-linux-gnu
124-
displayName: "add cross target"
125-
- bash: cargo +nightly install semverver
126-
displayName: "add rust-semverver"
127-
- script: sh ci/semver.sh
128-
displayName: "run semver test"
101+
- script: sh ci/semver.sh linux
129102

130103
- job: SemverOSX
131104
continueOnError: true
132105
pool:
133106
vmImage: macos-10.14
134107
steps:
135108
- template: ci/azure-install-rust.yml
136-
- bash: cargo +nightly install semverver
137-
displayName: "add rust-semverver"
138-
- script: sh ci/semver.sh
139-
displayName: "run semver test"
109+
- script: sh ci/semver.sh osx
140110

141111
- job: Shellcheck
142112
pool:
143113
vmImage: ubuntu-16.04
144114
steps:
145-
- script: shellcheck --version
146-
# FIXME: https://github.com/koalaman/shellcheck/issues/1591
147-
- script: shellcheck -e SC2103 ci/*.sh
148115

149116
- job: BuildChannelsLinux
150117
pool:
@@ -200,30 +167,3 @@ jobs:
200167
TOOLCHAIN: 1.30.0
201168
variables:
202169
OS: osx
203-
204-
- job: NintendoSwitch
205-
pool:
206-
vmImage: ubuntu-16.04
207-
steps:
208-
- template: ci/azure-install-rust.yml
209-
- bash: rustup target add x86_64-unknown-linux-gnu
210-
displayName: "add cross target"
211-
- bash: rustup component add rust-src
212-
displayName: Add rust-src component
213-
- bash: cargo install cargo-xbuild
214-
displayName: Install cargo-xbuild
215-
- bash: |
216-
set -ex
217-
mkdir -p target
218-
(
219-
cd target
220-
wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb
221-
sudo dpkg -i devkitpro-pacman.deb
222-
sudo dkp-pacman -Sy
223-
sudo dkp-pacman -Syu
224-
sudo dkp-pacman -S -v --noconfirm switch-dev devkitA64
225-
)
226-
cp ci/switch.json switch.json
227-
PATH="$PATH:/opt/devkitpro/devkitA64/bin"
228-
PATH="$PATH:/opt/devkitpro/tools/bin"
229-
cargo xbuild --target switch.json

ci/build.sh

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ RUST=${TOOLCHAIN}
1212

1313
echo "Testing Rust ${RUST} on ${OS}"
1414

15+
if [ "${TOOLCHAIN}" = "nightly" ] ; then
16+
cargo +nightly install cargo-xbuild -Z install-upgrade
17+
fi
18+
1519
test_target() {
16-
CARGO="${1}"
20+
BUILD_CMD="${1}"
1721
TARGET="${2}"
1822
NO_STD="${3}"
1923

@@ -48,21 +52,21 @@ test_target() {
4852
fi
4953

5054
# Test that libc builds without any default features (no libstd)
51-
"$CARGO" "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}"
55+
cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --no-default-features --target "${TARGET}"
5256

5357
# Test that libc builds with default features (e.g. libstd)
5458
# if the target supports libstd
5559
if [ "$NO_STD" != "1" ]; then
56-
"$CARGO" "+${RUST}" build -vv $opt --target "${TARGET}"
60+
cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --target "${TARGET}"
5761
fi
5862

5963
# Test that libc builds with the `extra_traits` feature
60-
"$CARGO" "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}" \
64+
cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --no-default-features --target "${TARGET}" \
6165
--features extra_traits
6266

6367
# Also test that it builds with `extra_traits` and default features:
6468
if [ "$NO_STD" != "1" ]; then
65-
"$CARGO" "+${RUST}" build -vv $opt --target "${TARGET}" \
69+
cargo "+${RUST}" "${BUILD_CMD}" -vv $opt --target "${TARGET}" \
6670
--features extra_traits
6771
fi
6872
}
@@ -169,7 +173,7 @@ case "${OS}" in
169173
esac
170174

171175
for TARGET in $TARGETS; do
172-
test_target cargo "$TARGET"
176+
test_target build "$TARGET"
173177
done
174178

175179
# FIXME: https://github.com/rust-lang/rust/issues/58564
@@ -218,6 +222,23 @@ x86_64-unknown-openbsd \
218222

219223
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then
220224
for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do
221-
test_target xargo "$TARGET" 1
225+
test_target xbuild "$TARGET" 1
222226
done
227+
228+
# Nintendo switch
229+
cargo clean
230+
mkdir -p target
231+
(
232+
cd target
233+
wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb
234+
sudo dpkg -i devkitpro-pacman.deb
235+
sudo dkp-pacman -Sy
236+
sudo dkp-pacman -Syu
237+
sudo dkp-pacman -S -v --noconfirm switch-dev devkitA64
238+
)
239+
cp ci/switch.json switch.json
240+
PATH="$PATH:/opt/devkitpro/devkitA64/bin"
241+
PATH="$PATH:/opt/devkitpro/tools/bin"
242+
cargo xbuild --target switch.json
223243
fi
244+

ci/dox.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ PLATFORM_SUPPORT=platform-support.md
1313
rm -rf $TARGET_DOC_DIR
1414
mkdir -p $TARGET_DOC_DIR
1515

16+
if ! rustc --version | grep -E "nightly" ; then
17+
echo "Building the documentation requires a nightly Rust toolchain"
18+
exit 1
19+
fi
20+
21+
rustup component add rust-src
22+
cargo +nightly install xargo -Z install-upgrade
23+
1624
# List all targets that do currently build successfully:
1725
# shellcheck disable=SC1003
1826
grep '[\d|\w|-]* \\' ci/build.sh > targets

ci/semver.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44

55
set -ex
66

7-
OS=${TRAVIS_OS_NAME}
7+
OS=${1}
88

99
echo "Testing Semver on ${OS}"
1010

11+
if ! rustc --version | grep -E "nightly" ; then
12+
echo "Building the documentation requires a nightly Rust toolchain"
13+
exit 1
14+
fi
15+
16+
cargo +nightly install semverver -Z install-upgrade
17+
1118
TARGETS=
1219
case "${OS}" in
1320
*linux*)

ci/style.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env sh
2+
3+
set -ex
4+
5+
rustc ci/style.rs && ./style src
6+
7+
if rustup component add rustfmt-preview ; then
8+
cargo fmt --all -- --check
9+
fi
10+
11+
if shellcheck --version ; then
12+
shellcheck -e SC2103 ci/*.sh
13+
else
14+
echo "shellcheck not found"
15+
exit 1
16+
fi
17+

0 commit comments

Comments
 (0)