MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add compat memmem for windows

+239 -49
+20 -3
.github/workflows/build-linux-glibc-aarch64.yml
··· 34 34 apt-get install -y python3-pip ninja-build cmake pkg-config \ 35 35 uuid-dev libssl-dev libsodium-dev 36 36 pip3 install meson 37 + - name: Cache native dependencies 38 + id: cache-deps 39 + uses: actions/cache@v4 40 + with: 41 + path: ~/deps-cache 42 + key: deps-linux-glibc-aarch64-llhttp-9.2.1-libuv-1.51.0-v1 37 43 - name: Build llhttp 44 + if: steps.cache-deps.outputs.cache-hit != 'true' 38 45 run: | 39 46 export CFLAGS="-Os -flto" 40 47 export AR=llvm-ar-21 41 48 export RANLIB=llvm-ranlib-21 42 49 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 43 50 cd /tmp/llhttp 44 - CC=clang-21 CXX=clang++-21 cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 51 + CC=clang-21 CXX=clang++-21 cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 45 52 cmake --build build 46 53 cmake --install build 47 54 - name: Build libuv 55 + if: steps.cache-deps.outputs.cache-hit != 'true' 48 56 run: | 49 57 export CFLAGS="-Os -flto" 50 58 export AR=llvm-ar-21 51 59 export RANLIB=llvm-ranlib-21 52 60 git clone --depth 1 --branch v1.51.0 https://github.com/libuv/libuv.git /tmp/libuv 53 61 cd /tmp/libuv 54 - CC=clang-21 cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 62 + CC=clang-21 cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 55 63 cmake --build build 56 64 cmake --install build 57 65 - run: npm ci ··· 68 76 build/oxc-target 69 77 key: cargo-linux-arm64-${{ hashFiles('src/strip/Cargo.lock') }} 70 78 restore-keys: cargo-linux-arm64- 71 - - run: CC=clang-21 CC_LD=lld-21 meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 79 + - name: Cache meson subprojects 80 + uses: actions/cache@v4 81 + with: 82 + path: build/vendor 83 + key: subprojects-linux-glibc-aarch64-${{ hashFiles('vendor/*.wrap') }} 84 + restore-keys: subprojects-linux-glibc-aarch64- 85 + - run: | 86 + export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 87 + export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH" 88 + CC=clang-21 CC_LD=lld-21 meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 72 89 - run: llvm-strip-21 build/ant 73 90 - uses: actions/upload-artifact@v4 74 91 with:
+20 -3
.github/workflows/build-linux-glibc-x64.yml
··· 34 34 apt-get install -y python3-pip ninja-build cmake pkg-config \ 35 35 uuid-dev libssl-dev libsodium-dev 36 36 pip3 install meson 37 + - name: Cache native dependencies 38 + id: cache-deps 39 + uses: actions/cache@v4 40 + with: 41 + path: ~/deps-cache 42 + key: deps-linux-glibc-x64-llhttp-9.2.1-libuv-1.51.0-v1 37 43 - name: Build llhttp 44 + if: steps.cache-deps.outputs.cache-hit != 'true' 38 45 run: | 39 46 export CFLAGS="-Os -flto" 40 47 export AR=llvm-ar-21 41 48 export RANLIB=llvm-ranlib-21 42 49 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 43 50 cd /tmp/llhttp 44 - CC=clang-21 CXX=clang++-21 cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 51 + CC=clang-21 CXX=clang++-21 cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 45 52 cmake --build build 46 53 cmake --install build 47 54 - name: Build libuv 55 + if: steps.cache-deps.outputs.cache-hit != 'true' 48 56 run: | 49 57 export CFLAGS="-Os -flto" 50 58 export AR=llvm-ar-21 51 59 export RANLIB=llvm-ranlib-21 52 60 git clone --depth 1 --branch v1.51.0 https://github.com/libuv/libuv.git /tmp/libuv 53 61 cd /tmp/libuv 54 - CC=clang-21 cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 62 + CC=clang-21 cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 55 63 cmake --build build 56 64 cmake --install build 57 65 - run: npm ci ··· 68 76 build/oxc-target 69 77 key: cargo-linux-amd64-${{ hashFiles('src/strip/Cargo.lock') }} 70 78 restore-keys: cargo-linux-amd64- 71 - - run: CC=clang-21 CC_LD=lld-21 meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 79 + - name: Cache meson subprojects 80 + uses: actions/cache@v4 81 + with: 82 + path: build/vendor 83 + key: subprojects-linux-glibc-x64-${{ hashFiles('vendor/*.wrap') }} 84 + restore-keys: subprojects-linux-glibc-x64- 85 + - run: | 86 + export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 87 + export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH" 88 + CC=clang-21 CC_LD=lld-21 meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 72 89 - run: llvm-strip-21 build/ant 73 90 - uses: actions/upload-artifact@v4 74 91 with:
+47 -17
.github/workflows/build-linux-musl-aarch64.yml
··· 15 15 - uses: actions/checkout@v4 16 16 with: 17 17 submodules: recursive 18 + - name: Cache native dependencies 19 + id: cache-deps 20 + uses: actions/cache@v4 21 + with: 22 + path: ~/deps-cache 23 + key: deps-linux-musl-aarch64-llhttp-9.2.1-libuv-1.51.0-zlib-1.3.1-v1 24 + - name: Cache meson subprojects 25 + uses: actions/cache@v4 26 + with: 27 + path: build/vendor 28 + key: subprojects-linux-musl-aarch64-${{ hashFiles('vendor/*.wrap') }} 29 + restore-keys: subprojects-linux-musl-aarch64- 30 + - name: Cache cargo 31 + uses: actions/cache@v4 32 + with: 33 + path: | 34 + ~/.cargo-cache/registry 35 + ~/.cargo-cache/git 36 + build/oxc-target 37 + key: cargo-linux-musl-aarch64-${{ hashFiles('src/strip/Cargo.lock') }} 38 + restore-keys: cargo-linux-musl-aarch64- 18 39 - name: Build in Alpine container 19 40 run: | 20 - docker run --rm -v "$PWD":/work -w /work alpine:edge sh -c ' 41 + mkdir -p ~/.cargo-cache 42 + docker run --rm -v "$PWD":/work -v "$HOME/deps-cache":/deps-cache -v "$HOME/.cargo-cache":/root/.cargo -w /work alpine:edge sh -c ' 21 43 apk add --no-cache git clang lld llvm meson ninja cmake pkgconf curl npm nodejs \ 22 44 musl-dev openssl-dev openssl-libs-static libsodium-dev libsodium-static \ 23 45 util-linux-dev util-linux-static linux-headers libunwind-dev libunwind-static rust cargo ··· 28 50 export AR=llvm-ar 29 51 export RANLIB=llvm-ranlib 30 52 31 - git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 32 - cd /tmp/llhttp 33 - CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 34 - cmake --build build 35 - cmake --install build 53 + if [ ! -f /deps-cache/lib/libllhttp.a ]; then 54 + git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 55 + cd /tmp/llhttp 56 + CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 57 + cmake --build build 58 + cmake --install build 59 + fi 36 60 37 - git clone --depth 1 --branch v1.51.0 https://github.com/libuv/libuv.git /tmp/libuv 38 - cd /tmp/libuv 39 - CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 40 - cmake --build build 41 - cmake --install build 61 + if [ ! -f /deps-cache/lib/libuv.a ]; then 62 + git clone --depth 1 --branch v1.51.0 https://github.com/libuv/libuv.git /tmp/libuv 63 + cd /tmp/libuv 64 + CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/deps-cache -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 65 + cmake --build build 66 + cmake --install build 67 + fi 42 68 43 - git clone --depth 1 --branch v1.3.1 https://github.com/madler/zlib.git /tmp/zlib 44 - cd /tmp/zlib 45 - CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 46 - cmake --build build 47 - cmake --install build 48 - rm -f /usr/local/lib/libz.so* 69 + if [ ! -f /deps-cache/lib/libz.a ]; then 70 + git clone --depth 1 --branch v1.3.1 https://github.com/madler/zlib.git /tmp/zlib 71 + cd /tmp/zlib 72 + CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/deps-cache -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 73 + cmake --build build 74 + cmake --install build 75 + rm -f /deps-cache/lib/libz.so* 76 + fi 49 77 50 78 cd /work 51 79 npm ci --prefix src/tools 80 + export PKG_CONFIG_PATH="/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 81 + export CMAKE_PREFIX_PATH="/deps-cache:$CMAKE_PREFIX_PATH" 52 82 CC=clang CC_LD=lld meson setup build --prefer-static -Db_lto=true --buildtype=release -Dstatic_link=true -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 53 83 llvm-strip build/ant 54 84 '
+23 -5
.github/workflows/build-linux-musl-x64.yml
··· 23 23 - uses: actions/checkout@v4 24 24 with: 25 25 submodules: recursive 26 + - name: Cache native dependencies 27 + id: cache-deps 28 + uses: actions/cache@v4 29 + with: 30 + path: ~/deps-cache 31 + key: deps-linux-musl-x64-llhttp-9.2.1-libuv-1.51.0-zlib-1.3.1-v1 26 32 - name: Build llhttp 33 + if: steps.cache-deps.outputs.cache-hit != 'true' 27 34 run: | 28 35 export CFLAGS="-Os -flto" 29 36 export AR=llvm-ar 30 37 export RANLIB=llvm-ranlib 31 38 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 32 39 cd /tmp/llhttp 33 - CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 40 + CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=MinSizeRel 34 41 cmake --build build 35 42 cmake --install build 36 43 - name: Build libuv 44 + if: steps.cache-deps.outputs.cache-hit != 'true' 37 45 run: | 38 46 export CFLAGS="-Os -flto" 39 47 export AR=llvm-ar 40 48 export RANLIB=llvm-ranlib 41 49 git clone --depth 1 --branch v1.51.0 https://github.com/libuv/libuv.git /tmp/libuv 42 50 cd /tmp/libuv 43 - CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 51 + CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 44 52 cmake --build build 45 53 cmake --install build 46 54 - name: Build zlib 55 + if: steps.cache-deps.outputs.cache-hit != 'true' 47 56 run: | 48 57 export CFLAGS="-Os -flto" 49 58 export AR=llvm-ar 50 59 export RANLIB=llvm-ranlib 51 60 git clone --depth 1 --branch v1.3.1 https://github.com/madler/zlib.git /tmp/zlib 52 61 cd /tmp/zlib 53 - CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 62 + CC=clang cmake -G Ninja -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel 54 63 cmake --build build 55 64 cmake --install build 56 - rm -f /usr/local/lib/libz.so* 65 + rm -f $HOME/deps-cache/lib/libz.so* 57 66 - run: npm ci 58 67 working-directory: src/tools 59 68 - name: Install Rust ··· 68 77 build/oxc-target 69 78 key: cargo-linux-musl-amd64-${{ hashFiles('src/strip/Cargo.lock') }} 70 79 restore-keys: cargo-linux-musl-amd64- 71 - - run: CC=clang CC_LD=lld meson setup build --prefer-static -Db_lto=true --buildtype=release -Dstatic_link=true -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 80 + - name: Cache meson subprojects 81 + uses: actions/cache@v4 82 + with: 83 + path: build/vendor 84 + key: subprojects-linux-musl-x64-${{ hashFiles('vendor/*.wrap') }} 85 + restore-keys: subprojects-linux-musl-x64- 86 + - run: | 87 + export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 88 + export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH" 89 + CC=clang CC_LD=lld meson setup build --prefer-static -Db_lto=true --buildtype=release -Dstatic_link=true -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 72 90 - run: llvm-strip build/ant 73 91 - uses: actions/upload-artifact@v4 74 92 with:
+29 -8
.github/workflows/build-macos-aarch64-mbedtls.yml
··· 19 19 with: 20 20 node-version: '22' 21 21 - run: brew install meson ninja llvm 22 + - name: Cache native dependencies 23 + id: cache-deps 24 + uses: actions/cache@v4 25 + with: 26 + path: ~/deps-cache 27 + key: deps-macos-aarch64-mbedtls-libsodium-1.0.20-mbedtls-3.6.5-llhttp-9.2.1-v1 22 28 - name: Build libsodium 29 + if: steps.cache-deps.outputs.cache-hit != 'true' 23 30 run: | 24 31 export LLVM_PREFIX=$(brew --prefix llvm) 25 32 git clone --depth 1 --branch 1.0.20-RELEASE https://github.com/jedisct1/libsodium.git /tmp/libsodium 26 33 cd /tmp/libsodium 27 - ./configure CC=$LLVM_PREFIX/bin/clang --prefix=/usr/local --disable-shared --enable-static 34 + ./configure CC=$LLVM_PREFIX/bin/clang --prefix=$HOME/deps-cache --disable-shared --enable-static 28 35 make -j$(sysctl -n hw.ncpu) 29 - sudo make install 36 + make install 30 37 - name: Build mbedTLS 38 + if: steps.cache-deps.outputs.cache-hit != 'true' 31 39 run: | 32 40 export LLVM_PREFIX=$(brew --prefix llvm) 33 41 git clone --depth 1 --branch mbedtls-3.6.5 --recurse-submodules https://github.com/Mbed-TLS/mbedtls.git /tmp/mbedtls 34 42 cd /tmp/mbedtls 35 43 CC=$LLVM_PREFIX/bin/clang cmake -B build \ 36 - -DCMAKE_INSTALL_PREFIX=/usr/local \ 44 + -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache \ 37 45 -DENABLE_PROGRAMS=OFF \ 38 46 -DENABLE_TESTING=OFF \ 39 47 -DCMAKE_BUILD_TYPE=Release \ 40 48 -DUSE_STATIC_MBEDTLS_LIBRARY=ON \ 41 49 -DUSE_SHARED_MBEDTLS_LIBRARY=OFF 42 50 cmake --build build -j$(sysctl -n hw.ncpu) 43 - sudo cmake --install build 51 + cmake --install build 44 52 - name: Build llhttp 53 + if: steps.cache-deps.outputs.cache-hit != 'true' 45 54 run: | 46 55 export LLVM_PREFIX=$(brew --prefix llvm) 47 56 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 48 57 cd /tmp/llhttp 49 - CC=$LLVM_PREFIX/bin/clang cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release 58 + CC=$LLVM_PREFIX/bin/clang cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release 50 59 cmake --build build 51 - sudo cmake --install build 60 + cmake --install build 52 61 - run: npm ci 53 62 working-directory: src/tools 54 63 - uses: dtolnay/rust-toolchain@stable 55 64 - uses: Swatinem/rust-cache@v2 56 65 with: 57 66 workspaces: src/strip 67 + - name: Cache oxc build 68 + uses: actions/cache@v4 69 + with: 70 + path: build/oxc-target 71 + key: oxc-macos-aarch64-mbedtls-${{ hashFiles('src/strip/Cargo.lock') }} 72 + restore-keys: oxc-macos-aarch64-mbedtls- 73 + - name: Cache meson subprojects 74 + uses: actions/cache@v4 75 + with: 76 + path: build/vendor 77 + key: subprojects-macos-aarch64-mbedtls-${{ hashFiles('vendor/*.wrap') }} 78 + restore-keys: subprojects-macos-aarch64-mbedtls- 58 79 - run: | 59 - export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" 60 - export CMAKE_PREFIX_PATH="/usr/local:$CMAKE_PREFIX_PATH" 80 + export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 81 + export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH" 61 82 export LLVM_PREFIX=$(brew --prefix llvm) 62 83 CC=$LLVM_PREFIX/bin/clang AR=$LLVM_PREFIX/bin/llvm-ar RANLIB=$LLVM_PREFIX/bin/llvm-ranlib meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} -Dtls_library=mbedtls && meson compile -C build 63 84 - run: strip build/ant
+26 -6
.github/workflows/build-macos-aarch64.yml
··· 19 19 with: 20 20 node-version: '22' 21 21 - run: brew install meson ninja openssl@3 llvm 22 + - name: Cache native dependencies 23 + id: cache-deps 24 + uses: actions/cache@v4 25 + with: 26 + path: ~/deps-cache 27 + key: deps-macos-aarch64-libsodium-1.0.20-llhttp-9.2.1-v1 22 28 - name: Build libsodium 29 + if: steps.cache-deps.outputs.cache-hit != 'true' 23 30 run: | 24 31 export LLVM_PREFIX=$(brew --prefix llvm) 25 32 git clone --depth 1 --branch 1.0.20-RELEASE https://github.com/jedisct1/libsodium.git /tmp/libsodium 26 33 cd /tmp/libsodium 27 - ./configure CC=$LLVM_PREFIX/bin/clang --prefix=/usr/local --disable-shared --enable-static 34 + ./configure CC=$LLVM_PREFIX/bin/clang --prefix=$HOME/deps-cache --disable-shared --enable-static 28 35 make -j$(sysctl -n hw.ncpu) 29 - sudo make install 36 + make install 30 37 - name: Build llhttp 38 + if: steps.cache-deps.outputs.cache-hit != 'true' 31 39 run: | 32 40 export LLVM_PREFIX=$(brew --prefix llvm) 33 41 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 34 42 cd /tmp/llhttp 35 - CC=$LLVM_PREFIX/bin/clang cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release 43 + CC=$LLVM_PREFIX/bin/clang cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/deps-cache -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release 36 44 cmake --build build 37 - sudo cmake --install build 45 + cmake --install build 38 46 - run: npm ci 39 47 working-directory: src/tools 40 48 - uses: dtolnay/rust-toolchain@stable 41 49 - uses: Swatinem/rust-cache@v2 42 50 with: 43 51 workspaces: src/strip 52 + - name: Cache oxc build 53 + uses: actions/cache@v4 54 + with: 55 + path: build/oxc-target 56 + key: oxc-macos-aarch64-${{ hashFiles('src/strip/Cargo.lock') }} 57 + restore-keys: oxc-macos-aarch64- 58 + - name: Cache meson subprojects 59 + uses: actions/cache@v4 60 + with: 61 + path: build/vendor 62 + key: subprojects-macos-aarch64-${{ hashFiles('vendor/*.wrap') }} 63 + restore-keys: subprojects-macos-aarch64- 44 64 - run: | 45 - export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" 46 - export CMAKE_PREFIX_PATH="/usr/local:$CMAKE_PREFIX_PATH" 65 + export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 66 + export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH" 47 67 export LLVM_PREFIX=$(brew --prefix llvm) 48 68 CC=$LLVM_PREFIX/bin/clang AR=$LLVM_PREFIX/bin/llvm-ar RANLIB=$LLVM_PREFIX/bin/llvm-ranlib meson setup build -Db_lto=true --buildtype=release -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 49 69 - run: strip build/ant
+12
.github/workflows/build-macos-x64-mbedtls.yml
··· 64 64 - uses: Swatinem/rust-cache@v2 65 65 with: 66 66 workspaces: src/strip 67 + - name: Cache oxc build 68 + uses: actions/cache@v4 69 + with: 70 + path: build/oxc-target 71 + key: oxc-macos-x64-mbedtls-${{ hashFiles('src/strip/Cargo.lock') }} 72 + restore-keys: oxc-macos-x64-mbedtls- 73 + - name: Cache meson subprojects 74 + uses: actions/cache@v4 75 + with: 76 + path: build/vendor 77 + key: subprojects-macos-x64-mbedtls-${{ hashFiles('vendor/*.wrap') }} 78 + restore-keys: subprojects-macos-x64-mbedtls- 67 79 - run: | 68 80 export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 69 81 export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH"
+12
.github/workflows/build-macos-x64.yml
··· 49 49 - uses: Swatinem/rust-cache@v2 50 50 with: 51 51 workspaces: src/strip 52 + - name: Cache oxc build 53 + uses: actions/cache@v4 54 + with: 55 + path: build/oxc-target 56 + key: oxc-macos-x64-${{ hashFiles('src/strip/Cargo.lock') }} 57 + restore-keys: oxc-macos-x64- 58 + - name: Cache meson subprojects 59 + uses: actions/cache@v4 60 + with: 61 + path: build/vendor 62 + key: subprojects-macos-x64-${{ hashFiles('vendor/*.wrap') }} 63 + restore-keys: subprojects-macos-x64- 52 64 - run: | 53 65 export PKG_CONFIG_PATH="$HOME/deps-cache/lib/pkgconfig:$PKG_CONFIG_PATH" 54 66 export CMAKE_PREFIX_PATH="$HOME/deps-cache:$CMAKE_PREFIX_PATH"
+25 -1
.github/workflows/build-windows-x64.yml
··· 30 30 mingw-w64-x86_64-libsodium 31 31 mingw-w64-x86_64-nodejs 32 32 git 33 + - name: Cache native dependencies 34 + id: cache-deps 35 + uses: actions/cache@v4 36 + with: 37 + path: ${{ runner.temp }}/deps-cache 38 + key: deps-windows-x64-llhttp-9.2.1-v1 33 39 - name: Build llhttp 40 + if: steps.cache-deps.outputs.cache-hit != 'true' 34 41 run: | 42 + DEPS_CACHE=$(cygpath "${{ runner.temp }}/deps-cache") 35 43 git clone --depth 1 --branch release/v9.2.1 https://github.com/nodejs/llhttp.git /tmp/llhttp 36 44 cd /tmp/llhttp 37 - cmake -G "MinGW Makefiles" -B build -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON 45 + cmake -G "MinGW Makefiles" -B build -DCMAKE_INSTALL_PREFIX=$DEPS_CACHE -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON 38 46 cmake --build build 39 47 cmake --install build 48 + ln -sf $DEPS_CACHE/lib/pkgconfig/libllhttp.pc $DEPS_CACHE/lib/pkgconfig/llhttp.pc 40 49 - run: npm ci 41 50 working-directory: src/tools 42 51 - uses: dtolnay/rust-toolchain@stable ··· 45 54 - uses: Swatinem/rust-cache@v2 46 55 with: 47 56 workspaces: src/strip 57 + - name: Cache oxc build 58 + uses: actions/cache@v4 59 + with: 60 + path: build/oxc-target 61 + key: oxc-windows-x64-${{ hashFiles('src/strip/Cargo.lock') }} 62 + restore-keys: oxc-windows-x64- 63 + - name: Cache meson subprojects 64 + uses: actions/cache@v4 65 + with: 66 + path: build/vendor 67 + key: subprojects-windows-x64-${{ hashFiles('vendor/*.wrap') }} 68 + restore-keys: subprojects-windows-x64- 48 69 - run: | 70 + DEPS_CACHE=$(cygpath "${{ runner.temp }}/deps-cache") 49 71 export PATH="/c/Users/$USER/.cargo/bin:$PATH" 72 + export PKG_CONFIG_PATH="$DEPS_CACHE/lib/pkgconfig:$PKG_CONFIG_PATH" 73 + export CMAKE_PREFIX_PATH="$DEPS_CACHE:$CMAKE_PREFIX_PATH" 50 74 meson setup build -Dc_std=gnu2x -Dbuild_timestamp=${{ inputs.build_timestamp }} && meson compile -C build 51 75 - uses: actions/upload-artifact@v4 52 76 with:
+5 -2
.github/workflows/build.yml
··· 2 2 3 3 on: 4 4 push: 5 - branches: [main] 6 5 pull_request: 7 6 workflow_dispatch: 8 7 9 8 concurrency: 10 9 group: ${{ github.workflow }}-${{ github.ref }} 11 - cancel-in-progress: true 10 + cancel-in-progress: false 12 11 13 12 jobs: 14 13 prepare: 15 14 runs-on: ubuntu-latest 15 + if: | 16 + github.event_name == 'workflow_dispatch' || 17 + github.event_name == 'pull_request' || 18 + (github.event_name == 'push' && contains(github.event.head_commit.message, '[ci] run build')) 16 19 outputs: 17 20 timestamp: ${{ steps.timestamp.outputs.value }} 18 21 steps:
+20 -4
include/compat.h
··· 1 1 #ifndef ANT_COMPAT_H 2 2 #define ANT_COMPAT_H 3 3 4 + #if defined(__linux__) && !defined(_GNU_SOURCE) 5 + #define _GNU_SOURCE 6 + #endif 7 + 4 8 #include <time.h> 5 9 #include <string.h> 6 10 #include <stdlib.h> ··· 68 72 static inline char *compat_strndup(const char *s, size_t n) { 69 73 size_t len = strnlen(s, n); 70 74 char *dup = malloc(len + 1); 71 - if (dup) { 72 - memcpy(dup, s, len); 73 - dup[len] = '\0'; 74 - } 75 + if (dup) { memcpy(dup, s, len); dup[len] = '\0'; } 75 76 return dup; 77 + } 78 + 79 + static inline void *compat_memmem(const void *haystack, size_t h_len, const void *needle, size_t n_len) { 80 + const char *h = haystack; 81 + const char *last = h + h_len - n_len; 82 + const char *n = needle; 83 + char first; 84 + if (n_len == 0) return (void *)h; 85 + if (h_len < n_len) return NULL; 86 + if (n_len == 1) return memchr(haystack, *n, h_len); 87 + first = *n++; 88 + for (; h <= last; h++) 89 + if (*h == first && !memcmp(h + 1, n, n_len - 1)) return (void *)h; 90 + return NULL; 76 91 } 77 92 78 93 static inline char *compat_basename(char *path) { ··· 101 116 #define usleep compat_usleep 102 117 #define sleep compat_sleep 103 118 #define strndup compat_strndup 119 + #define memmem compat_memmem 104 120 #define basename compat_basename 105 121 #define dirname compat_dirname 106 122