-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid shelling *nix commands #2706
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ Q1 = $(V:1=) | |
Q = $(Q1:0=@) | ||
ECHO1 = $(V:1=@ :) | ||
ECHO = $(ECHO1:0=@ echo) | ||
FUZZ_OUTPUT_DIR = $(shell pwd)/fuzz/output | ||
FUZZ_OUTPUT_DIR = $(CURDIR)/fuzz/output | ||
|
||
SOEXT := $(shell ruby -e 'puts RbConfig::CONFIG["SOEXT"]') | ||
|
||
|
@@ -15,8 +15,8 @@ CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion | |
CC := cc | ||
WASI_SDK_PATH := /opt/wasi-sdk | ||
|
||
HEADERS := $(shell find include -name '*.h') | ||
SOURCES := $(shell find src -name '*.c') | ||
HEADERS := $(wildcard include/*.h include/*/*.h include/*/*/*.h') | ||
SOURCES := $(wildcard src/*.c src/*/*.c) | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I’m fine with abandoning this change if it’s not worth to not shell-out. For reference, |
||
SHARED_OBJECTS := $(subst src/,build/shared/,$(SOURCES:.c=.o)) | ||
STATIC_OBJECTS := $(subst src/,build/static/,$(SOURCES:.c=.o)) | ||
|
||
|
@@ -66,7 +66,7 @@ build/fuzz.heisenbug.%: $(SOURCES) fuzz/%.c fuzz/heisenbug.c | |
|
||
fuzz-debug: | ||
$(ECHO) "entering debug shell" | ||
$(Q) docker run -it --rm -e HISTFILE=/prism/fuzz/output/.bash_history -v $(shell pwd):/prism -v $(FUZZ_OUTPUT_DIR):/fuzz_output prism/fuzz | ||
$(Q) docker run -it --rm -e HISTFILE=/prism/fuzz/output/.bash_history -v $(CURDIR):/prism -v $(FUZZ_OUTPUT_DIR):/fuzz_output prism/fuzz | ||
|
||
fuzz-docker-build: fuzz/docker/Dockerfile | ||
$(ECHO) "building docker image" | ||
|
@@ -76,10 +76,10 @@ fuzz-run-%: FORCE fuzz-docker-build | |
$(ECHO) "generating templates" | ||
$(Q) bundle exec rake templates | ||
$(ECHO) "running $* fuzzer" | ||
$(Q) docker run --rm -v $(shell pwd):/prism prism/fuzz /bin/bash -c "FUZZ_FLAGS=\"$(FUZZ_FLAGS)\" make build/fuzz.$*" | ||
$(Q) docker run --rm -v $(CURDIR):/prism prism/fuzz /bin/bash -c "FUZZ_FLAGS=\"$(FUZZ_FLAGS)\" make build/fuzz.$*" | ||
$(ECHO) "starting AFL++ run" | ||
$(Q) mkdir -p $(FUZZ_OUTPUT_DIR)/$* | ||
$(Q) docker run -it --rm -v $(shell pwd):/prism -v $(FUZZ_OUTPUT_DIR):/fuzz_output prism/fuzz /bin/bash -c "./fuzz/$*.sh /fuzz_output/$*" | ||
$(Q) docker run -it --rm -v $(CURDIR):/prism -v $(FUZZ_OUTPUT_DIR):/fuzz_output prism/fuzz /bin/bash -c "./fuzz/$*.sh /fuzz_output/$*" | ||
FORCE: | ||
|
||
fuzz-clean: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CURDIR
is technically different fromshell pwd
in that the latter isn’t stuck constant if theMakefile
somehowcd
s halfway in the script.That said, do we really want the build to base on the working directory rather than fixed at the repo root?