Skip to content

Commit 324db07

Browse files
authored
Fix CI (#1558)
* endif * just fix every profile * WHY YOU DONT JUST USE THE SAME NAME FOR DIR * fix * Some fuzzer want release * WHY I ALWAYS FORGET COMMA * NO MORE SPACE * rename * stb doesn't like debug build * just use release * another just use release
1 parent 74435e1 commit 324db07

File tree

36 files changed

+203
-161
lines changed

36 files changed

+203
-161
lines changed

.github/workflows/build_and_test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,22 @@ jobs:
196196
- name: Remove Dotnet (macOS)
197197
if: runner.os == 'macOS'
198198
run: rm -rf /usr/local/bin/dotnet
199-
- name: Remove Dotnet & Haskell (Linux)
199+
- name: Free Disk Space (Ubuntu)
200200
if: runner.os == 'Linux'
201-
run: rm -rf /usr/share/dotnet && rm -rf /opt/ghc
201+
uses: jlumbroso/free-disk-space@main
202+
with:
203+
# this might remove tools that are actually needed,
204+
# if set to "true" but frees about 6 GB
205+
tool-cache: false
206+
207+
# all of these default to true, but feel free to set to
208+
# "false" if necessary for your workflow
209+
android: true
210+
dotnet: true
211+
haskell: true
212+
large-packages: true
213+
docker-images: true
214+
swap-storage: true
202215
- name: Add nightly rustfmt and clippy
203216
run: rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade
204217
- name: Add no_std toolchain

fuzzers/baby_fuzzer_swap_differential/Makefile.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
FUZZER_NAME='fuzzer_sd'
44
PROJECT_DIR = { script = ["pwd"] }
55
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
6-
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
7-
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc'
8-
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME}'
6+
PROFILE = { value = "release" }
7+
PROFILE_DIR = {value = "release" }
8+
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc'
9+
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}'
910

1011
# Compilers
1112
[tasks.cc]
1213
command = "cargo"
13-
args = ["build" , "--${PROFILE}", "--bin", "libafl_cc"]
14+
args = ["build" , "--profile", "${PROFILE}", "--bin", "libafl_cc"]
1415

1516
# Harness
1617
[tasks.fuzzer]
1718
command = "cargo"
18-
args = ["build" , "--${PROFILE}", "--bin", "${FUZZER_NAME}"]
19+
args = ["build" , "--profile", "${PROFILE}", "--bin", "${FUZZER_NAME}"]
1920
dependencies = [ "cc" ]
2021

2122
# Run the fuzzer
2223
[tasks.run]
23-
command = "${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME}"
24+
command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}"
2425
dependencies = [ "fuzzer" ]
2526

2627
# Test
@@ -32,7 +33,7 @@ windows_alias = "unsupported"
3233
[tasks.test_unix]
3334
script_runner = "@shell"
3435
script='''
35-
timeout 10s ${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME} >fuzz_stdout.log || true
36+
timeout 10s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} >fuzz_stdout.log || true
3637
if [ -z "$(grep "objectives: 1" fuzz_stdout.log)" ]; then
3738
echo "Fuzzer does not generate any testcases or any crashes"
3839
exit 1

fuzzers/baby_no_std/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
FUZZER_NAME="fuzzer"
33
PROJECT_DIR = { script = ["pwd"] }
44
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
5+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
56

67
[tasks.unsupported]
78
script_runner="@shell"
@@ -12,7 +13,7 @@ echo "Cargo-make not integrated yet on this"
1213
# Fuzzer
1314
[tasks.build]
1415
command = "cargo"
15-
args = ["build", "--${PROFILE}", "-Zbuild-std=core,alloc", "--target", "x86_64-unknown-linux-gnu"]
16+
args = ["build", "--profile", "${PROFILE}", "-Zbuild-std=core,alloc", "--target", "x86_64-unknown-linux-gnu"]
1617

1718
# Test
1819
[tasks.test]
@@ -27,7 +28,7 @@ cargo run -Zbuild-std=core,alloc --target x86_64-unknown-linux-gnu || true
2728
dependencies = ["build"]
2829

2930
[tasks.build_aarch]
30-
script = "cargo +nightly build -Zbuild-std=core,alloc --target aarch64-unknown-none -v --${PROFILE}"
31+
script = "cargo +nightly build -Zbuild-std=core,alloc --target aarch64-unknown-none -v --profile ${PROFILE}"
3132

3233
# Clean
3334
[tasks.clean]

fuzzers/forkserver_libafl_cc/Makefile.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
FUZZER_NAME='fuzzer_libafl_cc'
44
CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
55
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6-
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc'
7-
LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx'
8-
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME}'
6+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
7+
LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc'
8+
LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx'
9+
FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}'
910
PROJECT_DIR = { script = ["pwd"] }
1011

1112
[tasks.unsupported]
@@ -22,7 +23,7 @@ windows_alias = "unsupported"
2223

2324
[tasks.cxx_unix]
2425
command = "cargo"
25-
args = ["build" , "--${PROFILE}"]
26+
args = ["build" , "--profile","${PROFILE}"]
2627

2728
[tasks.cc]
2829
linux_alias = "cc_unix"
@@ -31,7 +32,7 @@ windows_alias = "unsupported"
3132

3233
[tasks.cc_unix]
3334
command = "cargo"
34-
args = ["build" , "--${PROFILE}"]
35+
args = ["build" , "--profile", "${PROFILE}"]
3536

3637
[tasks.crash_cxx]
3738
linux_alias = "crash_cxx_unix"
@@ -40,7 +41,7 @@ windows_alias = "unsupported"
4041

4142
[tasks.crash_cxx_unix]
4243
command = "cargo"
43-
args = ["build" , "--${PROFILE}", "--features=crash"]
44+
args = ["build" , "--profile", "${PROFILE}", "--features=crash"]
4445

4546
[tasks.crash_cc]
4647
linux_alias = "crash_cc_unix"
@@ -49,7 +50,7 @@ windows_alias = "unsupported"
4950

5051
[tasks.crash_cc_unix]
5152
command = "cargo"
52-
args = ["build" , "--${PROFILE}", "--features=crash"]
53+
args = ["build" , "--profile", "${PROFILE}", "--features=crash"]
5354

5455
# Harness
5556
[tasks.fuzzer]
@@ -58,7 +59,7 @@ mac_alias = "fuzzer_unix"
5859
windows_alias = "unsupported"
5960

6061
[tasks.fuzzer_unix]
61-
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
62+
command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc"
6263
args = ["${PROJECT_DIR}/src/program.c", "-o", "${FUZZER_NAME}", "-lm"]
6364
dependencies = [ "cxx", "cc" ]
6465

@@ -69,7 +70,7 @@ mac_alias = "fuzzer_crash_unix"
6970
windows_alias = "unsupported"
7071

7172
[tasks.fuzzer_crash_unix]
72-
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
73+
command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc"
7374
args = ["${PROJECT_DIR}/src/program.c", "-o", "${FUZZER_NAME}_crash", "-lm"]
7475
dependencies = [ "crash_cxx", "crash_cc" ]
7576

@@ -82,7 +83,7 @@ windows_alias = "unsupported"
8283
[tasks.run_unix]
8384
script_runner = "@shell"
8485
script='''
85-
taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000
86+
taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000
8687
'''
8788
dependencies = [ "fuzzer" ]
8889

@@ -96,7 +97,7 @@ windows_alias = "unsupported"
9697
[tasks.crash_unix]
9798
script_runner = "@shell"
9899
script='''
99-
taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME}_crash ./corpus/ -t 1000
100+
taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME}_crash ./corpus/ -t 1000
100101
'''
101102
dependencies = [ "fuzzer_crash" ]
102103

fuzzers/frida_executable_libpng/Makefile.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[env]
33
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
5+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
56

67
[tasks.unsupported]
78
script_runner="@shell"
@@ -61,7 +62,7 @@ windows_alias = "unsupported"
6162
[tasks.fuzzer_unix]
6263
script_runner="@shell"
6364
script='''
64-
cargo build --${PROFILE}
65+
cargo build --profile ${PROFILE}
6566
'''
6667

6768
# Run the fuzzer
@@ -73,7 +74,7 @@ windows_alias = "unsupported"
7374
[tasks.run_unix]
7475
script_runner = "@shell"
7576
script='''
76-
LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness
77+
LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE_DIR}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness
7778
'''
7879
dependencies = [ "fuzzer", "harness" ]
7980

@@ -87,7 +88,7 @@ windows_alias = "unsupported"
8788
script_runner = "@shell"
8889
script='''
8990
rm -rf libafl_unix_shmem_server || true
90-
LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness > fuzz_stdout.log &
91+
LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE_DIR}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness > fuzz_stdout.log &
9192
sleep 10s && pkill libpng-harness
9293
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
9394
echo "Fuzzer does not generate any testcases or any crashes"

fuzzers/frida_gdiplus/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME={ source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_gdiplus", mapping = {"linux" = "frida_gdiplus", "macos" = "frida_gdiplus", "windows" = "frida_gdiplus.exe"} }
55
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
67

78
[tasks.unsupported]
89
script_runner="@shell"
@@ -32,8 +33,8 @@ windows_alias = "fuzzer_windows"
3233
[tasks.fuzzer_windows]
3334
script_runner="@shell"
3435
script='''
35-
cargo build --${PROFILE}
36-
cp ./target/${PROFILE}/${FUZZER_NAME} .
36+
cargo build --profile ${PROFILE}
37+
cp ./target/${PROFILE_DIR}/${FUZZER_NAME} .
3738
'''
3839

3940
# Run the fuzzer

fuzzers/frida_libpng/Makefile.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME={ source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_fuzzer", mapping = {"linux" = "frida_fuzzer", "macos" = "frida_fuzzer", "windows" = "frida_fuzzer.exe"} }
55
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
67

78
[tasks.unsupported]
89
script_runner="@shell"
@@ -68,15 +69,15 @@ windows_alias = "fuzzer_windows"
6869
[tasks.fuzzer_unix]
6970
script_runner="@shell"
7071
script='''
71-
cargo build --${PROFILE}
72-
cp ${CARGO_TARGET_DIR}/${PROFILE}/${FUZZER_NAME} .
72+
cargo build --profile ${PROFILE}
73+
cp ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} .
7374
'''
7475

7576
[tasks.fuzzer_windows]
7677
script_runner="@shell"
7778
script='''
78-
cargo build --${PROFILE}
79-
cp ./target/${PROFILE}/${FUZZER_NAME} .
79+
cargo build --profile ${PROFILE}
80+
cp ./target/${PROFILE_DIR}/${FUZZER_NAME} .
8081
'''
8182

8283
# Run the fuzzer

fuzzers/fuzzbench/Makefile.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PROJECT_DIR = { script = ["pwd"] }
33
CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } }
44
FUZZER_NAME="fuzzer"
55
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
67

78
[tasks.unsupported]
89
script_runner="@shell"
@@ -18,7 +19,7 @@ windows_alias = "unsupported"
1819

1920
[tasks.cxx_unix]
2021
command = "cargo"
21-
args = ["build" , "--${PROFILE}"]
22+
args = ["build", "--profile", "${PROFILE}"]
2223

2324
[tasks.cc]
2425
linux_alias = "cc_unix"
@@ -27,7 +28,7 @@ windows_alias = "unsupported"
2728

2829
[tasks.cc_unix]
2930
command = "cargo"
30-
args = ["build" , "--${PROFILE}"]
31+
args = ["build", "--profile", "${PROFILE}"]
3132

3233
# fuzz.o File
3334
[tasks.fuzz_o]
@@ -36,7 +37,7 @@ mac_alias = "fuzz_o_unix"
3637
windows_alias = "unsupported"
3738

3839
[tasks.fuzz_o_unix]
39-
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cc"
40+
command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc"
4041
args = ["--libafl-no-link", "-O3", "-c", "fuzz.c", "-o", "fuzz.o"]
4142
dependencies = ["cc", "cxx"]
4243

@@ -47,7 +48,7 @@ mac_alias = "fuzzer_unix"
4748
windows_alias = "unsupported"
4849

4950
[tasks.fuzzer_unix]
50-
command = "${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx"
51+
command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx"
5152
args = ["--libafl", "fuzz.o", "-o", "${FUZZER_NAME}", "-lm", "-lz"]
5253
dependencies = ["cc", "cxx", "fuzz_o"]
5354

fuzzers/fuzzbench_fork_qemu/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
FUZZER_NAME='libpng_harness'
44
PROJECT_DIR = { script = ["pwd"] }
55
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
67

78
[tasks.unsupported]
89
script_runner="@shell"
@@ -32,7 +33,7 @@ windows_alias = "unsupported"
3233

3334
[tasks.fuzzer_unix]
3435
command = "cargo"
35-
args = ["build", "--${PROFILE}"]
36+
args = ["build", "--profile", "${PROFILE}"]
3637

3738
# Harness
3839
[tasks.harness]
@@ -66,7 +67,7 @@ windows_alias = "unsupported"
6667

6768
[tasks.run_unix]
6869
command = "cargo"
69-
args = ["run", "--${PROFILE}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
70+
args = ["run", "--profile", "${PROFILE_DIR}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
7071
dependencies = [ "harness", "fuzzer" ]
7172

7273
# Run the fuzzer

fuzzers/fuzzbench_qemu/Makefile.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
FUZZER_NAME='libpng_harness'
44
PROJECT_DIR = { script = ["pwd"] }
55
PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} }
6+
PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }}
67

78
[tasks.unsupported]
89
script_runner="@shell"
@@ -32,7 +33,7 @@ windows_alias = "unsupported"
3233

3334
[tasks.fuzzer_unix]
3435
command = "cargo"
35-
args = ["build", "--${PROFILE}"]
36+
args = ["build", "--profile", "${PROFILE}"]
3637

3738
# Harness
3839
[tasks.harness]
@@ -66,7 +67,7 @@ windows_alias = "unsupported"
6667

6768
[tasks.run_unix]
6869
command = "cargo"
69-
args = ["run", "--${PROFILE}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
70+
args = ["run", "--profile", "${PROFILE}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"]
7071
dependencies = [ "harness", "fuzzer" ]
7172

7273
# Run the fuzzer

0 commit comments

Comments
 (0)