[hermes] Merge setup steps to reduce number of layers used (#9632)

This commit is contained in:
0xedward 2023-02-07 18:31:43 -05:00 committed by GitHub
parent 383dc91556
commit 0325500290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 21 deletions

View File

@ -37,18 +37,18 @@ RUN wget https://github.com/unicode-org/icu/archive/refs/tags/cldr/2021-08-25.ta
tar xzvf ./2021-08-25.tar.gz && \
mv ./icu-cldr-2021-08-25/icu4c $SRC/icu
RUN git clone https://github.com/facebook/hermes.git
RUN git clone --depth 1 https://github.com/tc39/test262
RUN git clone --depth 1 https://github.com/Zon8Research/v8-vulnerabilities
RUN git clone --depth 1 https://github.com/v8/v8
RUN git clone https://github.com/facebook/hermes.git && \
git clone --depth 1 https://github.com/tc39/test262 && \
git clone --depth 1 https://github.com/Zon8Research/v8-vulnerabilities && \
git clone --depth 1 https://github.com/v8/v8
# Strip comments from corpus.
RUN find hermes/test -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
RUN find hermes/external/esprima/test_fixtures -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
RUN find hermes/external/flowtest/test/flow -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
RUN find test262/test -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
RUN find v8-vulnerabilities/pocs -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
RUN find v8/test/mjsunit -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
RUN find hermes/test -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+ && \
find hermes/external/esprima/test_fixtures -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+ && \
find hermes/external/flowtest/test/flow -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+ && \
find test262/test -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+ && \
find v8-vulnerabilities/pocs -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+ && \
find v8/test/mjsunit -iname '*.js' -exec stripcomments --write --confirm-overwrite '{}' \+
# Process corpora
COPY preprocess-corpus.py $SRC/
@ -56,17 +56,17 @@ RUN python preprocess-corpus.py
RUN rm $SRC/preprocess-corpus.py
# Add unit tests from project directory as seed corpus.
RUN find hermes/test -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
# Add tests from test262 as seed corpus.
RUN find test262/test -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
# Add V8 PoCs as seed corpus.
RUN find v8-vulnerabilities/pocs -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
# Add tests from esprima as seed corpus.
RUN find hermes/external/esprima/test_fixtures '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
# Add tests from flow as seed corpus.
RUN find hermes/external/flowtest/test/flow '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
# Add tests from v8 as seed corpus.
RUN find v8/test/mjsunit -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
RUN find hermes/test -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \
# Add tests from test262 as seed corpus.
find test262/test -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \
# Add V8 PoCs as seed corpus.
find v8-vulnerabilities/pocs -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \
# Add tests from esprima as seed corpus.
find hermes/external/esprima/test_fixtures '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \
# Add tests from flow as seed corpus.
find hermes/external/flowtest/test/flow '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip && \
# Add tests from v8 as seed corpus.
find v8/test/mjsunit -iname '*.js' | zip -@ -q $SRC/hermes_seed_corpus.zip
WORKDIR $SRC
COPY build.sh $SRC/