Skip to content

Commit d67287a

Browse files
committed
Change the strategy of checking for num-bigint or rug backend in ci
Signed-off-by: maurges <[email protected]>
1 parent da18052 commit d67287a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/rust.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,19 @@ jobs:
114114
# We can't set --all-features as that will set backend-num-bigint which overrides rug, so we list all features except that
115115
features=std,hd-wallet,serde,state-machine,all-curves,hd-slip10,hd-stark,spof,insecure-assume-preimage-known,__internal_doctest,backend-rug
116116
117-
# Check that num-bigint was not present as a dependency of fast-paillier
118-
found=$(cargo tree --no-default-features --features $features --no-dedupe |
119-
# In the output of cargo tree, find lines between fast-paillier,
120-
# which with this indentation means it was a top-level dependency,
121-
# until another top-level dependency, and in those lines grep for
122-
# num-bigint
123-
awk '/^├── fast-paillier/{p=1;next} /^[└├]/{p=0} p' | grep num-bigint -q || echo NOTFOUND)
124-
if [ NOTFOUND != "$found" ]; then
117+
# Check that num-bigint was not present as a dependency of fast-paillier, but rug was
118+
found_rug=$(cargo tree --edges=features --no-default-features --features $features --no-dedupe --invert fast-paillier |
119+
grep backend-rug -q || echo NOTFOUND)
120+
found_nbi=$(cargo tree --edges=features --no-default-features --features $features --no-dedupe --invert fast-paillier |
121+
grep backend-num-bigint -q || echo NOTFOUND)
122+
if [ NOTFOUND != "$found_nbi" ]; then
125123
echo "found num-bigint in dependencies of fast-paillier when the num-bigint backend should not be selected!"
126124
exit 1
127125
fi
126+
if [ NOTFOUND == "$found_rug" ]; then
127+
echo "rug not found in dependencies of fast-paillier; this means that our detection script broke"
128+
exit 1
129+
fi
128130
129131
cargo test --release --no-default-features --features $features
130132

0 commit comments

Comments
 (0)