From 5dfb810427684fcfb0d30fdbf2c933194892af1d Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Thu, 17 Nov 2016 09:49:34 -0800 Subject: [PATCH] [infra] setting current directory to src checkout (#87) --- docs/new_target.md | 12 ++++++------ infra/base-images/base-libfuzzer/compile | 4 +++- infra/helper.py | 9 ++++++--- infra/templates.py | 5 ++--- targets/c-ares/Dockerfile | 1 + targets/c-ares/build.sh | 4 +--- targets/curl/Dockerfile | 1 + targets/curl/build.sh | 1 - targets/expat/Dockerfile | 1 + targets/expat/build.sh | 1 - targets/file/Dockerfile | 1 + targets/file/build.sh | 2 -- targets/freetype2/Dockerfile | 1 + targets/freetype2/build.sh | 1 - targets/harfbuzz/Dockerfile | 1 + targets/harfbuzz/build.sh | 2 -- targets/json/Dockerfile | 1 + targets/json/build.sh | 4 +--- targets/lcms/Dockerfile | 1 + targets/lcms/build.sh | 2 -- targets/libarchive/Dockerfile | 1 + targets/libarchive/build.sh | 2 -- targets/libass/build.sh | 4 +--- targets/libchewing/Dockerfile | 1 + targets/libchewing/build.sh | 2 -- targets/libjpeg-turbo/Dockerfile | 1 + targets/libjpeg-turbo/build.sh | 2 -- targets/libpng/Dockerfile | 1 + targets/libpng/build.sh | 4 +--- targets/libtsm/Dockerfile | 1 + targets/libtsm/build.sh | 2 -- targets/libxml2/Dockerfile | 1 + targets/libxml2/build.sh | 3 +-- targets/nss/Dockerfile | 1 + targets/nss/build.sh | 1 - targets/openssl/Dockerfile | 1 + targets/openssl/build.sh | 2 -- targets/ots/Dockerfile | 1 + targets/ots/build.sh | 2 -- targets/re2/Dockerfile | 3 ++- targets/re2/build.sh | 2 -- targets/sqlite3/Dockerfile | 3 ++- targets/sqlite3/build.sh | 2 -- targets/woff2/Dockerfile | 1 + targets/woff2/build.sh | 2 -- targets/zlib/Dockerfile | 3 ++- targets/zlib/build.sh | 2 -- 47 files changed, 46 insertions(+), 60 deletions(-) diff --git a/docs/new_target.md b/docs/new_target.md index e9c17575c..8ae8cda16 100644 --- a/docs/new_target.md +++ b/docs/new_target.md @@ -40,11 +40,12 @@ Create a fuzzer and add it to the *target_name/* directory as well. This is the Docker image definition that build.sh will be executed in. It is very simple for most libraries: ```docker -FROM ossfuzz/base-libfuzzer # base image with clang toolchain -MAINTAINER YOUR_EMAIL # each file should have a maintainer -RUN apt-get install -y ... # install required packages to build a project -RUN git checkout # checkout all sources needed to build your target -COPY build.sh fuzzer.cc /src/ # install build script and other source files. +FROM ossfuzz/base-libfuzzer # base image with clang toolchain +MAINTAINER YOUR_EMAIL # each file should have a maintainer +RUN apt-get install -y ... # install required packages to build a project +RUN git checkout # checkout all sources needed to build your target +WORKDIR # current directory for build script +COPY build.sh fuzzer.cc /src/ # install build script and other source files. ``` Expat example: [expat/Dockerfile](../targets/expat/Dockerfile) @@ -95,7 +96,6 @@ For expat, this looks like: ```bash #!/bin/bash -eu -cd /src/expat/expat ./buildconf.sh # configure scripts usually use correct environment variables. ./configure diff --git a/infra/base-images/base-libfuzzer/compile b/infra/base-images/base-libfuzzer/compile index 256a409a5..e617de9eb 100755 --- a/infra/base-images/base-libfuzzer/compile +++ b/infra/base-images/base-libfuzzer/compile @@ -17,6 +17,8 @@ echo "---------------------------------------------------------------" +pushd . + echo -n "Compiling libFuzzer into /usr/lib/libfuzzer.a ..." mkdir -p /work/libfuzzer cd /work/libfuzzer @@ -35,5 +37,5 @@ echo "FUZZER_LDFLAGS=$FUZZER_LDFLAGS" echo "---------------------------------------------------------------" -cd /src +popd >/dev/null 2>&1 bash -x /src/build.sh diff --git a/infra/helper.py b/infra/helper.py index 5c8d41300..9122d5170 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -262,15 +262,18 @@ def generate(generate_args): print('Writing new files to', dir) + template_args = { + 'target_name' : args.target_name + } with open(os.path.join(dir, 'Jenkinsfile'), 'w') as f: - f.write(templates.JENKINS_TEMPLATE) + f.write(templates.JENKINS_TEMPLATE % template_args) with open(os.path.join(dir, 'Dockerfile'), 'w') as f: - f.write(templates.DOCKER_TEMPLATE) + f.write(templates.DOCKER_TEMPLATE % template_args) build_sh_path = os.path.join(dir, 'build.sh') with open(build_sh_path, 'w') as f: - f.write(templates.BUILD_TEMPLATE % args.target_name) + f.write(templates.BUILD_TEMPLATE % template_args) targets_readme_path = os.path.join('targets', 'README.md') update_targets_readme(targets_readme_path, args.target_name, dir) diff --git a/infra/templates.py b/infra/templates.py index 5dc2f37de..313cb7575 100755 --- a/infra/templates.py +++ b/infra/templates.py @@ -59,7 +59,8 @@ DOCKER_TEMPLATE = """\ FROM ossfuzz/base-libfuzzer MAINTAINER your@email.com RUN apt-get install -y make autoconf automake libtool -RUN git clone # or use other version control +RUN git clone %(target_name)s # or use other version control +WORKDIR %(target_name)s COPY build.sh /src/ """ @@ -81,8 +82,6 @@ BUILD_TEMPLATE = """\ # ################################################################################ -cd /src/%s - # build the target. # e.g. # diff --git a/targets/c-ares/Dockerfile b/targets/c-ares/Dockerfile index c9feb9a9c..2233cd54a 100644 --- a/targets/c-ares/Dockerfile +++ b/targets/c-ares/Dockerfile @@ -18,4 +18,5 @@ FROM ossfuzz/base-libfuzzer MAINTAINER mmoroz@chromium.org RUN apt-get install -y make autoconf automake libtool RUN git clone https://github.com/c-ares/c-ares.git +WORKDIR c-ares COPY build.sh *_fuzzer.cc /src/ diff --git a/targets/c-ares/build.sh b/targets/c-ares/build.sh index 89e7b7e7d..badfb327e 100755 --- a/targets/c-ares/build.sh +++ b/targets/c-ares/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/c-ares - export LDFLAGS="$FUZZER_LDFLAGS" # Build the target. @@ -29,4 +27,4 @@ make CFLAGS= -j$(nproc) all $CXX $CXXFLAGS -std=c++11 -I. \ /src/c_ares_ares_create_query_fuzzer.cc \ -o /out/c_ares_ares_create_query_fuzzer \ - -lfuzzer /src/c-ares/.libs//libcares.a $FUZZER_LDFLAGS + -lfuzzer /src/c-ares/.libs/libcares.a $FUZZER_LDFLAGS diff --git a/targets/curl/Dockerfile b/targets/curl/Dockerfile index af4276e80..751db93cb 100644 --- a/targets/curl/Dockerfile +++ b/targets/curl/Dockerfile @@ -19,5 +19,6 @@ MAINTAINER dvyukov@google.com RUN apt-get install -y make autoconf automake libtool libssl-dev zlib1g-dev RUN git clone https://github.com/curl/curl.git +WORKDIR curl COPY build.sh curl_fuzzer.cc *.options *.dict /src/ diff --git a/targets/curl/build.sh b/targets/curl/build.sh index eb524f63a..e7032f816 100755 --- a/targets/curl/build.sh +++ b/targets/curl/build.sh @@ -15,7 +15,6 @@ # ################################################################################ -cd /src/curl ./buildconf ./configure --disable-shared --enable-debug --enable-maintainer-mode --disable-symbol-hiding --disable-threaded-resolver --enable-ipv6 --with-random=/dev/null make -j$(nproc) diff --git a/targets/expat/Dockerfile b/targets/expat/Dockerfile index 63c88698c..207d1ecb0 100644 --- a/targets/expat/Dockerfile +++ b/targets/expat/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER mike.aizatsky@gmail.com RUN apt-get install -y make autoconf automake libtool docbook2x RUN git clone git://git.code.sf.net/p/expat/code_git expat +WORKDIR expat/expat COPY build.sh parse_fuzzer.* xml.dict /src/ diff --git a/targets/expat/build.sh b/targets/expat/build.sh index f5f4313d3..03ec8fa3a 100755 --- a/targets/expat/build.sh +++ b/targets/expat/build.sh @@ -14,7 +14,6 @@ # limitations under the License. # ################################################################################ -cd /src/expat/expat ./buildconf.sh ./configure diff --git a/targets/file/Dockerfile b/targets/file/Dockerfile index 1b6d1c06c..eb8674708 100644 --- a/targets/file/Dockerfile +++ b/targets/file/Dockerfile @@ -18,4 +18,5 @@ FROM ossfuzz/base-libfuzzer MAINTAINER mike.aizatsky@gmail.com RUN apt-get install -y make autoconf automake libtool shtool RUN git clone https://github.com/file/file.git +WORKDIR file COPY build.sh magic_fuzzer.cc /src/ diff --git a/targets/file/build.sh b/targets/file/build.sh index a040af93a..742aaa055 100755 --- a/targets/file/build.sh +++ b/targets/file/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/file - autoreconf -i ./configure --enable-static make V=1 all diff --git a/targets/freetype2/Dockerfile b/targets/freetype2/Dockerfile index 8e9e2ec2e..6b3c978fe 100644 --- a/targets/freetype2/Dockerfile +++ b/targets/freetype2/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER mike.aizatsky@gmail.com RUN apt-get install -y make autoconf libtool libarchive-dev RUN git clone git://git.sv.nongnu.org/freetype/freetype2.git +WORKDIR freetype2 COPY build.sh /src/ diff --git a/targets/freetype2/build.sh b/targets/freetype2/build.sh index 352e1ea17..f32ae08f9 100755 --- a/targets/freetype2/build.sh +++ b/targets/freetype2/build.sh @@ -15,7 +15,6 @@ # limitations under the License. # ################################################################################ -cd /src/freetype2/ ./autogen.sh ./configure diff --git a/targets/harfbuzz/Dockerfile b/targets/harfbuzz/Dockerfile index 5392a96ff..cbb5f2a80 100644 --- a/targets/harfbuzz/Dockerfile +++ b/targets/harfbuzz/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER mmoroz@chromium.org RUN apt-get install -y make autoconf automake libtool ragel pkg-config RUN git clone https://anongit.freedesktop.org/git/harfbuzz.git +WORKDIR harfbuzz COPY build.sh harfbuzz_fuzzer.cc /src/ diff --git a/targets/harfbuzz/build.sh b/targets/harfbuzz/build.sh index 2c8d39a77..471c88f21 100755 --- a/targets/harfbuzz/build.sh +++ b/targets/harfbuzz/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/harfbuzz - # Build the library. ./autogen.sh export LDFLAGS=$FUZZER_LDFLAGS diff --git a/targets/json/Dockerfile b/targets/json/Dockerfile index 81a90ce35..d6fae5aee 100644 --- a/targets/json/Dockerfile +++ b/targets/json/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER vitalybuka@gmail.com RUN apt-get install -y binutils gcc RUN git clone https://github.com/nlohmann/json.git +WORKDIR /src/json/ COPY build.sh parse_fuzzer.* /src/ diff --git a/targets/json/build.sh b/targets/json/build.sh index 94eb3abbe..917b6def7 100755 --- a/targets/json/build.sh +++ b/targets/json/build.sh @@ -15,9 +15,7 @@ # ################################################################################ -cd /src/json - -$CXX $CXXFLAGS -std=c++11 -I/src/json/src/ \ +$CXX $CXXFLAGS -std=c++11 -Isrc/ \ /src/parse_fuzzer.cc -o /out/parse_fuzzer \ -lfuzzer $FUZZER_LDFLAGS diff --git a/targets/lcms/Dockerfile b/targets/lcms/Dockerfile index bbd673b56..51508f8b3 100644 --- a/targets/lcms/Dockerfile +++ b/targets/lcms/Dockerfile @@ -18,4 +18,5 @@ FROM ossfuzz/base-libfuzzer MAINTAINER kcwu@google.com RUN apt-get install -y make autoconf automake libtool RUN git clone https://github.com/mm2/Little-CMS.git lcms +WORKDIR lcms COPY build.sh cmsIT8_load_fuzzer.* cms_transform_fuzzer.* icc.dict /src/ diff --git a/targets/lcms/build.sh b/targets/lcms/build.sh index 3f49b9efe..9512da07c 100755 --- a/targets/lcms/build.sh +++ b/targets/lcms/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/lcms - # build the target. ./configure make -j$(nproc) all diff --git a/targets/libarchive/Dockerfile b/targets/libarchive/Dockerfile index e758c1ab9..8c0e399ad 100644 --- a/targets/libarchive/Dockerfile +++ b/targets/libarchive/Dockerfile @@ -23,4 +23,5 @@ RUN apt-get install -y make autoconf automake libtool pkg-config \ libbz2-dev liblzo2-dev liblzma-dev liblz4-dev libz-dev \ libxml2-dev libssl-dev RUN git clone https://github.com/libarchive/libarchive.git +WORKDIR libarchive COPY build.sh libarchive_fuzzer.cc /src/ diff --git a/targets/libarchive/build.sh b/targets/libarchive/build.sh index 21a34b158..3ad63acc5 100755 --- a/targets/libarchive/build.sh +++ b/targets/libarchive/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/libarchive - # build the target. ./build/autogen.sh ./configure diff --git a/targets/libass/build.sh b/targets/libass/build.sh index 51a2e1c25..317542fde 100755 --- a/targets/libass/build.sh +++ b/targets/libass/build.sh @@ -15,9 +15,7 @@ # ################################################################################ -cd /src - -cd fribidi +cd /src/fribidi ./bootstrap ./configure --enable-static=yes --enable-shared=no --with-pic=yes # Don't run "make": it's broken. Run "make install". diff --git a/targets/libchewing/Dockerfile b/targets/libchewing/Dockerfile index b3625028c..7eb56733b 100644 --- a/targets/libchewing/Dockerfile +++ b/targets/libchewing/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER kcwu@csie.org RUN apt-get install -y make autoconf automake libtool texinfo RUN git clone https://github.com/chewing/libchewing.git +WORKDIR libchewing COPY build.sh chewing_fuzzer_common.[ch] chewing_*_fuzzer.c /src/ diff --git a/targets/libchewing/build.sh b/targets/libchewing/build.sh index 8dea7e51d..b37265792 100755 --- a/targets/libchewing/build.sh +++ b/targets/libchewing/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/libchewing - # build the library. ./autogen.sh ./configure --disable-shared --enable-static --without-sqlite3 diff --git a/targets/libjpeg-turbo/Dockerfile b/targets/libjpeg-turbo/Dockerfile index d9890ee9a..e688381a4 100644 --- a/targets/libjpeg-turbo/Dockerfile +++ b/targets/libjpeg-turbo/Dockerfile @@ -24,4 +24,5 @@ RUN curl -o afl-testcases/afl_testcases.tgz http://lcamtuf.coredump.cx/afl/demo/ RUN cd afl-testcases/ && tar -xf afl_testcases.tgz RUN zip libjpeg_turbo_fuzzer_seed_corpus.zip afl-testcases/jpeg/full/images/* +WORKDIR libjpeg-turbo COPY build.sh libjpeg_turbo_fuzzer.cc /src/ diff --git a/targets/libjpeg-turbo/build.sh b/targets/libjpeg-turbo/build.sh index 0f645e452..6be596d72 100755 --- a/targets/libjpeg-turbo/build.sh +++ b/targets/libjpeg-turbo/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/libjpeg-turbo - autoreconf -fiv ./configure make "-j$(nproc)" diff --git a/targets/libpng/Dockerfile b/targets/libpng/Dockerfile index 2122ba988..181c2d45a 100644 --- a/targets/libpng/Dockerfile +++ b/targets/libpng/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER mmoroz@chromium.org RUN apt-get install -y make autoconf automake libtool zlib1g-dev RUN git clone git://git.code.sf.net/p/libpng/code libpng +WORKDIR libpng COPY build.sh libpng_read_fuzzer.* png.dict /src/ diff --git a/targets/libpng/build.sh b/targets/libpng/build.sh index 40c377919..dac897dbf 100755 --- a/targets/libpng/build.sh +++ b/targets/libpng/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/libpng - # Disable logging via library build configuration control. cat scripts/pnglibconf.dfa | sed -e "s/option STDIO/option STDIO disabled/" \ > scripts/pnglibconf.dfa.temp @@ -32,4 +30,4 @@ $CXX $CXXFLAGS -std=c++11 -I. -lz \ /src/libpng_read_fuzzer.cc -o /out/libpng_read_fuzzer \ -lfuzzer .libs/libpng16.a $FUZZER_LDFLAGS -cp /src/*.dict /src/*.options /out/ \ No newline at end of file +cp /src/*.dict /src/*.options /out/ diff --git a/targets/libtsm/Dockerfile b/targets/libtsm/Dockerfile index ce7aa4f66..01233a3de 100644 --- a/targets/libtsm/Dockerfile +++ b/targets/libtsm/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER kcwu@csie.org RUN apt-get install -y make autoconf automake libtool pkg-config RUN git clone git://people.freedesktop.org/~dvdhrm/libtsm +WORKDIR libtsm COPY build.sh libtsm_fuzzer.c /src/ diff --git a/targets/libtsm/build.sh b/targets/libtsm/build.sh index dd5ba143c..e4e7f69ea 100755 --- a/targets/libtsm/build.sh +++ b/targets/libtsm/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/libtsm - # build the library. ./autogen.sh make -j$(nproc) clean all diff --git a/targets/libxml2/Dockerfile b/targets/libxml2/Dockerfile index 9bf723181..570a12805 100644 --- a/targets/libxml2/Dockerfile +++ b/targets/libxml2/Dockerfile @@ -19,6 +19,7 @@ MAINTAINER ochang@chromium.org RUN apt-get install -y make autoconf automake libtool pkg-config RUN git clone git://git.gnome.org/libxml2 +WORKDIR libxml2 COPY build.sh /src/ COPY libxml2_xml_read_memory_fuzzer.* \ diff --git a/targets/libxml2/build.sh b/targets/libxml2/build.sh index 588460b36..934fe2464 100755 --- a/targets/libxml2/build.sh +++ b/targets/libxml2/build.sh @@ -15,7 +15,6 @@ # limitations under the License. # ################################################################################ -cd /src/libxml2 ./autogen.sh ./configure @@ -27,4 +26,4 @@ for fuzzer in libxml2_xml_read_memory_fuzzer libxml2_xml_regexp_compile_fuzzer; -lfuzzer .libs/libxml2.a $FUZZER_LDFLAGS done -cp /src/*.dict /src/*.options /out/ \ No newline at end of file +cp /src/*.dict /src/*.options /out/ diff --git a/targets/nss/Dockerfile b/targets/nss/Dockerfile index 4b5ff0c15..4a65c841c 100644 --- a/targets/nss/Dockerfile +++ b/targets/nss/Dockerfile @@ -22,4 +22,5 @@ RUN hg clone https://hg.mozilla.org/projects/nspr nspr RUN hg clone https://hg.mozilla.org/projects/nss nss RUN git clone https://github.com/mozilla/nss-fuzzing-corpus.git nss-corpus +WORKDIR nss COPY build.sh fuzzers/* /src/ diff --git a/targets/nss/build.sh b/targets/nss/build.sh index 1032f514b..6dad07296 100755 --- a/targets/nss/build.sh +++ b/targets/nss/build.sh @@ -16,7 +16,6 @@ ################################################################################ # Build the library. -cd /src/nss make CCC="$CXX" XCFLAGS="$CXXFLAGS" SANITIZER_CFLAGS="$CXXFLAGS" \ BUILD_OPT=1 USE_64=1 NSS_DISABLE_GTESTS=1 ZDEFS_FLAG= \ nss_clean_all nss_build_all diff --git a/targets/openssl/Dockerfile b/targets/openssl/Dockerfile index 53a8134ff..3e6fe1ddb 100644 --- a/targets/openssl/Dockerfile +++ b/targets/openssl/Dockerfile @@ -18,4 +18,5 @@ FROM ossfuzz/base-libfuzzer MAINTAINER kurt@roeckx.be RUN apt-get install -y make RUN git clone https://github.com/openssl/openssl.git +WORKDIR openssl COPY build.sh /src/ diff --git a/targets/openssl/build.sh b/targets/openssl/build.sh index 54124fbbd..3ae39a140 100755 --- a/targets/openssl/build.sh +++ b/targets/openssl/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/openssl - ./config enable-fuzz-libfuzzer -DPEDANTIC no-shared --with-fuzzer-lib=/usr/lib/libfuzzer $CFLAGS make -j$(nproc) EX_LIBS="-ldl $FUZZER_LDFLAGS" diff --git a/targets/ots/Dockerfile b/targets/ots/Dockerfile index c12720f36..3686735f2 100644 --- a/targets/ots/Dockerfile +++ b/targets/ots/Dockerfile @@ -18,5 +18,6 @@ FROM ossfuzz/base-libfuzzer MAINTAINER mmoroz@chromium.org RUN apt-get install -y make autoconf automake libtool pkg-config zlib1g-dev RUN git clone https://github.com/khaledhosny/ots.git +WORKDIR /src/ots COPY build.sh ots_fuzzer.* /src/ COPY seed_corpus /src/seed_corpus diff --git a/targets/ots/build.sh b/targets/ots/build.sh index 4a09456eb..849f1f342 100755 --- a/targets/ots/build.sh +++ b/targets/ots/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/ots - # Build the target. ./autogen.sh ./configure diff --git a/targets/re2/Dockerfile b/targets/re2/Dockerfile index 5c3cd1241..882985550 100644 --- a/targets/re2/Dockerfile +++ b/targets/re2/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER wrengr@chromium.org RUN apt-get install -y make autoconf automake libtool RUN git clone https://code.googlesource.com/re2 -COPY build.sh re2_fuzzer.* /src/ \ No newline at end of file +WORKDIR re2 +COPY build.sh re2_fuzzer.* /src/ diff --git a/targets/re2/build.sh b/targets/re2/build.sh index 3d42a1581..4a45874f6 100755 --- a/targets/re2/build.sh +++ b/targets/re2/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/re2 - # First, build the re2 library. # N.B., we don't follow the standard incantation for building re2 # (i.e., `make && make test && make install && make testinstall`), diff --git a/targets/sqlite3/Dockerfile b/targets/sqlite3/Dockerfile index 29d2d19fa..3711d91c6 100644 --- a/targets/sqlite3/Dockerfile +++ b/targets/sqlite3/Dockerfile @@ -27,4 +27,5 @@ RUN mkdir /src/sqlite3 && \ RUN find /src/sqlite3 -name "*.test" | xargs zip /src/ossfuzz_seed_corpus.zip -COPY build.sh *.dict *.options /src/ \ No newline at end of file +WORKDIR sqlite3 +COPY build.sh *.dict *.options /src/ diff --git a/targets/sqlite3/build.sh b/targets/sqlite3/build.sh index 86da43872..3eb237707 100755 --- a/targets/sqlite3/build.sh +++ b/targets/sqlite3/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/sqlite3 - mkdir bld cd bld diff --git a/targets/woff2/Dockerfile b/targets/woff2/Dockerfile index 00f7e755e..6a0907d46 100644 --- a/targets/woff2/Dockerfile +++ b/targets/woff2/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER mmoroz@chromium.org RUN apt-get install -y make autoconf automake libtool RUN git clone --recursive https://github.com/google/woff2 +WORKDIR woff2 COPY build.sh convert_woff2ttf_fuzzer.* /src/ diff --git a/targets/woff2/build.sh b/targets/woff2/build.sh index 80f01d3dd..88aae6cd4 100755 --- a/targets/woff2/build.sh +++ b/targets/woff2/build.sh @@ -15,8 +15,6 @@ # ################################################################################ -cd /src/woff2 - # Build the library. Actually there is no 'library' target, so we use .o files. # '-no-canonical-prefixes' flag makes clang crazy. Need to avoid it. cat brotli/shared.mk | sed -e "s/-no-canonical-prefixes//" \ diff --git a/targets/zlib/Dockerfile b/targets/zlib/Dockerfile index c6196f463..0462525a2 100644 --- a/targets/zlib/Dockerfile +++ b/targets/zlib/Dockerfile @@ -19,4 +19,5 @@ MAINTAINER inferno@chromium.org RUN apt-get install -y make autoconf automake libtool RUN git clone https://github.com/madler/zlib.git -COPY build.sh zlib_uncompress_fuzzer.cc /src/ \ No newline at end of file +WORKDIR zlib +COPY build.sh zlib_uncompress_fuzzer.cc /src/ diff --git a/targets/zlib/build.sh b/targets/zlib/build.sh index 051cf375c..4be2b44f4 100755 --- a/targets/zlib/build.sh +++ b/targets/zlib/build.sh @@ -1,7 +1,5 @@ #!/bin/bash -eu -cd /src/zlib - ./configure make -j$(nproc) clean all