forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff1f8e2
commit 8c70a89
Showing
16 changed files
with
440 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
node_modules | ||
**/node_modules | ||
LayoutTests | ||
zig-out | ||
zig-build | ||
**/*.o | ||
**/*.a | ||
**/.next | ||
.git | ||
**/CMakeCache.txt | ||
CMakeCache.txt | ||
WebKitBuild | ||
ManualTests | ||
Websites | ||
WebDriverTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,5 @@ __cmake_systeminformation/ | |
|
||
# Local overrides configuration files | ||
LocalOverrides.xcconfig | ||
|
||
DerivedData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# BuildKit is required to build this | ||
# Enable via DOCKER_BUILDKIT=1 | ||
FROM ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh --no-check-certificate | ||
RUN chmod +x llvm.sh | ||
RUN ./llvm.sh 13 | ||
|
||
# Use the same version of LLVM/clang used to build Zig | ||
# This prevents the allocation failure | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
bc \ | ||
build-essential \ | ||
ca-certificates \ | ||
clang-13 \ | ||
clang-format-13 \ | ||
cmake \ | ||
cpio \ | ||
curl \ | ||
file \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
gnupg2 \ | ||
libicu66 \ | ||
libc++-13-dev \ | ||
libc++abi-13-dev \ | ||
libclang-13-dev \ | ||
liblld-13-dev \ | ||
libssl-dev \ | ||
lld-13 \ | ||
make \ | ||
ninja-build \ | ||
perl \ | ||
python2 \ | ||
rsync \ | ||
ruby \ | ||
software-properties-common \ | ||
unzip \ | ||
wget | ||
|
||
RUN update-alternatives --install /usr/bin/ld ld /usr/bin/lld-13 90 && \ | ||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 90 && \ | ||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-13 90 && \ | ||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 90 | ||
|
||
|
||
ENV WEBKIT_OUT_DIR=/webkitbuild | ||
|
||
ENV CC=clang-13 | ||
ENV CXX=clang++-13 | ||
|
||
COPY . /webkit | ||
WORKDIR /webkit | ||
|
||
RUN mkdir -p /output/lib /output/include /output/include/JavaScriptCore /output/include/wtf /output/include/bmalloc | ||
|
||
ARG WEBKIT_RELEASE_TYPE=Release | ||
|
||
# | Explanation | Flag | ||
# ----------------------------------------------------------------------------------------------------------------------------------------------------- | ||
# | Use the "JSCOnly" WebKit port | -DPORT="JSCOnly" | | ||
# | Build JavaScriptCore as a static library | -DENABLE_STATIC_JSC=ON | | ||
# | Build for release mode but include debug symbols | -DCMAKE_BUILD_TYPE=relwithdebuginfo | | ||
# | The .a files shouldn't be symlinks to UnifiedSource.cpp files or else you can't move the files | -DUSE_THIN_ARCHIVES=OFF | | ||
# | Enable the FTL Just-In-Time Compiler | -DENABLE_FTL_JIT=ON | | ||
# ----------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
# Using tmpfs this way makes it compile 2x faster | ||
# But means everything has to be one "RUN" statement | ||
RUN --mount=type=tmpfs,target=/webkitbuild \ | ||
cd /webkitbuild && \ | ||
cmake \ | ||
-DPORT="JSCOnly" \ | ||
-DENABLE_STATIC_JSC=ON \ | ||
-DCMAKE_BUILD_TYPE=$WEBKIT_RELEASE_TYPE \ | ||
-DUSE_THIN_ARCHIVES=OFF \ | ||
-DENABLE_FTL_JIT=ON \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
-G Ninja \ | ||
-DCMAKE_CXX_COMPILER=$(which clang++-13) \ | ||
-DCMAKE_C_COMPILER=$(which clang-13) \ | ||
/webkit && \ | ||
cd /webkitbuild && \ | ||
CFLAGS="$CFLAGS -ffat-lto-objects" CXXFLAGS="$CXXFLAGS -ffat-lto-objects" cmake --build /webkitbuild --config $WEBKIT_RELEASE_TYPE -- "jsc" -j$(nproc) && \ | ||
cp -r $WEBKIT_OUT_DIR/lib/*.a /output/lib && \ | ||
cp $WEBKIT_OUT_DIR/*.h /output/include && \ | ||
find $WEBKIT_OUT_DIR/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} /output/include/JavaScriptCore/ \; && \ | ||
find $WEBKIT_OUT_DIR/JavaScriptCore/PrivateHeaders/JavaScriptCore/ -name "*.h" -exec cp {} /output/include/JavaScriptCore/ \; && \ | ||
cp -r $WEBKIT_OUT_DIR/WTF/Headers/wtf/ /output/include && \ | ||
cp -r $WEBKIT_OUT_DIR/bmalloc/Headers/bmalloc/ /output/include; echo ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM alpine:3.15 as base | ||
|
||
RUN apk update | ||
RUN apk add --no-cache cmake make clang clang-static clang-dev llvm12-dev llvm12-static musl-dev git lld libgcc gcc g++ libstdc++ build-base lld-dev lld-static llvm12-libs libc-dev xz zlib zlib-dev libxml2 libxml2-dev | ||
|
||
ENV CXX=clang++ | ||
ENV CC=clang | ||
ENV LDFLAGS='-L/usr/include -L/usr/include/llvm12' | ||
ENV CXXFLAGS="-I/usr/include -I/usr/include/llvm12" | ||
ENV PATH="/usr/bin:/usr/local/bin:/zig/bin:$PATH" | ||
|
||
FROM base as build_webkit | ||
|
||
RUN apk add --no-cache cpio curl file gnupg icu-dev ninja ruby unzip rsync perl python2 openssl-dev openssl linux-headers | ||
|
||
ENV WEBKIT_OUT_DIR=/webkit | ||
# These are unnecessary on musl | ||
# ENV CFLAGS="$CFLAGS -ffat-lto-objects" | ||
# ENV CXXFLAGS="$CXXFLAGS -ffat-lto-objects" | ||
|
||
WORKDIR /webkit-build | ||
|
||
COPY . /webkit-src | ||
|
||
RUN --mount=type=tmpfs,target=/webkit-build; \ | ||
cmake \ | ||
-DPORT="JSCOnly" \ | ||
-DENABLE_STATIC_JSC=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DUSE_THIN_ARCHIVES=OFF \ | ||
-DENABLE_FTL_JIT=ON \ | ||
-G Ninja \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
/webkit-src && \ | ||
cd /webkit-build && \ | ||
cmake --build /webkit-build --config release -- "jsc" && \ | ||
mkdir -p ${WEBKIT_OUT_DIR}/lib ${WEBKIT_OUT_DIR}/include/JavaScriptCore && \ | ||
cp -r /webkit-build/lib/*.a $WEBKIT_OUT_DIR/lib && \ | ||
cp /webkit-build/*.h $WEBKIT_OUT_DIR/include && \ | ||
find /webkit-build/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} $WEBKIT_OUT_DIR/include/JavaScriptCore/ \; && \ | ||
find /webkit-build/JavaScriptCore/PrivateHeaders/JavaScriptCore/ -name "*.h" -exec cp {} $WEBKIT_OUT_DIR/include/JavaScriptCore/ \; && \ | ||
cp -r /webkit-build/WTF/Headers/wtf/ $WEBKIT_OUT_DIR/include && \ | ||
cp -r /webkit-build/bmalloc/Headers/bmalloc/ $WEBKIT_OUT_DIR/include && echo "Done"; | ||
|
||
|
||
FROM base as build_icu | ||
|
||
RUN apk add --no-cache cpio curl icu-dev tar | ||
|
||
|
||
WORKDIR /icu-src | ||
RUN --mount=type=tmpfs,target=/icu-src; curl -L https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz > icu4c-66_1-src.tgz && \ | ||
tar -xzf icu4c-66_1-src.tgz && \ | ||
rm icu4c-66_1-src.tgz && \ | ||
cd icu/source && \ | ||
./configure --enable-static --disable-shared && \ | ||
make -j$(nproc) && \ | ||
mkdir -p /icu && \ | ||
cp -r lib/*.a /icu | ||
|
||
|
||
FROM alpine:3.15 as webkit | ||
|
||
COPY --from=build_webkit /webkit /webkit | ||
COPY --from=build_icu /icu/*.a /webkit/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"cmake.configureOnOpen": false, | ||
"files.exclude": { | ||
"ThirdParty/": true, | ||
"WebDriver": true, | ||
"WebInspectorUI/": true, | ||
"WebKit": true, | ||
"WebKitBuild": true, | ||
"WebKitLegacy": true | ||
}, | ||
"files.associations": { | ||
"memory": "cpp", | ||
"__functional_base": "cpp", | ||
"__functional_base_03": "cpp", | ||
"__hash_table": "cpp", | ||
"__tree": "cpp", | ||
"__tuple": "cpp", | ||
"algorithm": "cpp", | ||
"array": "cpp", | ||
"chrono": "cpp", | ||
"cstddef": "cpp", | ||
"type_traits": "cpp", | ||
"filesystem": "cpp", | ||
"functional": "cpp", | ||
"iterator": "cpp", | ||
"limits": "cpp", | ||
"random": "cpp", | ||
"ratio": "cpp", | ||
"tuple": "cpp", | ||
"utility": "cpp", | ||
"*.idl": "cpp", | ||
"__mutex_base": "cpp", | ||
"__locale": "cpp", | ||
"__config": "cpp", | ||
"__threading_support": "cpp", | ||
"thread": "cpp", | ||
"__split_buffer": "cpp", | ||
"atomic": "cpp", | ||
"deque": "cpp", | ||
"forward_list": "cpp", | ||
"ios": "cpp", | ||
"list": "cpp", | ||
"map": "cpp", | ||
"set": "cpp", | ||
"string": "cpp", | ||
"system_error": "cpp", | ||
"unordered_map": "cpp", | ||
"unordered_set": "cpp", | ||
"vector": "cpp", | ||
"__bit_reference": "cpp", | ||
"__node_handle": "cpp", | ||
"bitset": "cpp", | ||
"__memory": "cpp", | ||
"locale": "cpp", | ||
"optional": "cpp", | ||
"regex": "cpp" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.