Skip to content

Commit bd1df30

Browse files
committed
Sort fuzz files when finding
Currently we don't sort the output of fuzz file names when finding them, this can lead to different output from `generate-files.sh` on different machines. Set the locale first because it effects sort order then sort the output of `find`.
1 parent 73d81e5 commit bd1df30

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

.github/workflows/cron-daily-fuzz.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
# We only get 20 jobs at a time, we probably don't want to go
1919
# over that limit with fuzzing because of the hour run time.
2020
fuzz_target: [
21-
roundtrip_semantic,
21+
compile_descriptor,
2222
parse_descriptor,
2323
parse_descriptor_secret,
24+
roundtrip_concrete,
25+
roundtrip_descriptor,
2426
roundtrip_miniscript_script,
2527
roundtrip_miniscript_str,
26-
roundtrip_descriptor,
27-
roundtrip_concrete,
28-
compile_descriptor,
28+
roundtrip_semantic,
2929
]
3030
steps:
3131
- name: Install test dependencies

fuzz/Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ miniscript = { path = "..", features = [ "compiler" ] }
1616
regex = "1.0"
1717

1818
[[bin]]
19-
name = "roundtrip_semantic"
20-
path = "fuzz_targets/roundtrip_semantic.rs"
19+
name = "compile_descriptor"
20+
path = "fuzz_targets/compile_descriptor.rs"
2121

2222
[[bin]]
2323
name = "parse_descriptor"
@@ -28,21 +28,21 @@ name = "parse_descriptor_secret"
2828
path = "fuzz_targets/parse_descriptor_secret.rs"
2929

3030
[[bin]]
31-
name = "roundtrip_miniscript_script"
32-
path = "fuzz_targets/roundtrip_miniscript_script.rs"
33-
34-
[[bin]]
35-
name = "roundtrip_miniscript_str"
36-
path = "fuzz_targets/roundtrip_miniscript_str.rs"
31+
name = "roundtrip_concrete"
32+
path = "fuzz_targets/roundtrip_concrete.rs"
3733

3834
[[bin]]
3935
name = "roundtrip_descriptor"
4036
path = "fuzz_targets/roundtrip_descriptor.rs"
4137

4238
[[bin]]
43-
name = "roundtrip_concrete"
44-
path = "fuzz_targets/roundtrip_concrete.rs"
39+
name = "roundtrip_miniscript_script"
40+
path = "fuzz_targets/roundtrip_miniscript_script.rs"
4541

4642
[[bin]]
47-
name = "compile_descriptor"
48-
path = "fuzz_targets/compile_descriptor.rs"
43+
name = "roundtrip_miniscript_str"
44+
path = "fuzz_targets/roundtrip_miniscript_str.rs"
45+
46+
[[bin]]
47+
name = "roundtrip_semantic"
48+
path = "fuzz_targets/roundtrip_semantic.rs"

fuzz/fuzz-util.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
REPO_DIR=$(git rev-parse --show-toplevel)
44

5+
# Sort order is effected by locale. See `man sort`.
6+
# > Set LC_ALL=C to get the traditional sort order that uses native byte values.
7+
export LC_ALL=C
8+
59
listTargetFiles() {
610
pushd "$REPO_DIR/fuzz" > /dev/null || exit 1
7-
find fuzz_targets/ -type f -name "*.rs"
11+
find fuzz_targets/ -type f -name "*.rs" | sort
812
popd > /dev/null || exit 1
913
}
1014

0 commit comments

Comments
 (0)