@@ -14,7 +14,15 @@ if [ -z "$target" ]; then
14
14
target=" $host_target "
15
15
fi
16
16
17
- extra_flags=" "
17
+ # We enumerate features manually.
18
+ extra_flags=" --no-default-features"
19
+
20
+ # Enable arch-specific routines when available.
21
+ extra_flags=" $extra_flags --features arch"
22
+
23
+ # Always enable `unstable-float` since it expands available API but does not
24
+ # change any implementations.
25
+ extra_flags=" $extra_flags --features unstable-float"
18
26
19
27
# We need to specifically skip tests for musl-math-sys on systems that can't
20
28
# build musl since otherwise `--all` will activate it.
@@ -44,11 +52,11 @@ case "$target" in
44
52
# Targets that aren't cross compiled work fine
45
53
# FIXME(ci): we should be able to enable aarch64 Linux here once GHA
46
54
# support rolls out.
47
- x86_64* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision " ;;
48
- i686* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision " ;;
49
- i586* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision --features gmp-mpfr-sys/force-cross" ;;
55
+ x86_64* ) extra_flags=" $extra_flags --features libm-test/build-mpfr " ;;
56
+ i686* ) extra_flags=" $extra_flags --features libm-test/build-mpfr " ;;
57
+ i586* ) extra_flags=" $extra_flags --features libm-test/build-mpfr --features gmp-mpfr-sys/force-cross" ;;
50
58
# Apple aarch64 is native
51
- aarch64* apple* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision " ;;
59
+ aarch64* apple* ) extra_flags=" $extra_flags --features libm-test/build-mpfr " ;;
52
60
esac
53
61
54
62
# FIXME: `STATUS_DLL_NOT_FOUND` testing macros on CI.
@@ -57,14 +65,8 @@ case "$target" in
57
65
* windows-gnu) extra_flags=" $extra_flags --exclude libm-macros" ;;
58
66
esac
59
67
60
- # Make sure we can build with overriding features. We test the indibidual
61
- # features it controls separately.
62
- cargo check --no-default-features
63
- cargo check --features " force-soft-floats"
64
-
65
- # Always enable `unstable-float` since it expands available API but does not
66
- # change any implementations.
67
- extra_flags=" $extra_flags --features unstable-float"
68
+ # Make sure we can build with overriding features.
69
+ cargo check -p libm --no-default-features
68
70
69
71
if [ " ${BUILD_ONLY:- } " = " 1" ]; then
70
72
cmd=" cargo build --target $target --package libm"
80
82
$cmd --features unstable-intrinsics
81
83
$cmd --features unstable-intrinsics --benches
82
84
83
- # Test the same in release mode, which also increases coverage.
85
+ # Test the same in release mode, which also increases coverage. Also ensure
86
+ # the soft float routines are checked.
84
87
$cmd --profile release-checked
88
+ $cmd --profile release-checked --features force-soft-floats
85
89
$cmd --profile release-checked --features unstable-intrinsics
86
90
$cmd --profile release-checked --features unstable-intrinsics --benches
87
91
88
- ENSURE_NO_PANIC=1 cargo build --target " $target " --release
92
+ # Ensure that the routines do not panic.
93
+ ENSURE_NO_PANIC=1 cargo build -p libm --target " $target " --no-default-features --release
89
94
fi
90
95
0 commit comments