Skip to content

Commit

Permalink
Merge pull request #46 from billywhizz/main
Browse files Browse the repository at this point in the history
0.0.18-pre release
  • Loading branch information
billywhizz authored Jan 19, 2025
2 parents 8f43ae3 + 6503c88 commit 9af90a8
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 90 deletions.
63 changes: 36 additions & 27 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ jobs:
build-mac:
# if: ${{ false }} # disable
name: mac
runs-on: macos-12
runs-on: macos-14
strategy:
fail-fast: false
matrix:
platform: [x64]
platform: [arm64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version: '^1.22.1'
- name: compile runtime
run: |
make ARCH=${{ matrix.platform }} lo
- name: check
env:
LO_HOME: ${{ github.workspace }}
PREFIX: /opt/homebrew/opt
run: |
make check
pip install jsonschema
Expand All @@ -34,14 +38,14 @@ jobs:
path: ${{ github.workspace }}/lo
name: lo-mac-${{ matrix.platform }}

build-mac-arm:
build-mac-x64:
# if: ${{ false }} # disable
name: mac
runs-on: macos-14
name: mac-x64
runs-on: macos-13
strategy:
fail-fast: false
matrix:
platform: [arm64]
platform: [x64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
Expand All @@ -56,7 +60,7 @@ jobs:
PREFIX: /opt/homebrew/opt
run: |
make check
pip install jsonschema
pip install jsonschema jinja2
brew install lz4 zstd openssl@3
./lo test/build.js
./lo build runtime runtime/lo
Expand All @@ -66,9 +70,9 @@ jobs:
path: ${{ github.workspace }}/lo
name: lo-mac-${{ matrix.platform }}

build-linux-x64:
build-linux:
# if: ${{ false }} # disable
name: linux-x64
name: linux
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -82,7 +86,7 @@ jobs:
sudo apt-get install -qy libcurl4-openssl-dev
- name: compile
run: |
make lo
make ARCH=${{ matrix.platform }} lo
- name: check
env:
LO_HOME: ${{ github.workspace }}
Expand All @@ -95,49 +99,54 @@ jobs:
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/lo
name: lo-linux-x64
name: lo-linux-${{ matrix.platform }}

build-linux-arm:
build-linux-arm64:
if: ${{ false }} # disable
name: linux-arm64
name: linux
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
platform: [x64]
platform: [arm64]
steps:
- uses: actions/checkout@v3
- name: install libcurl
run: |
sudo apt-get install -qy libcurl4-openssl-dev
- name: install arm64 tools
run: |
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get update -y
sudo apt-get install -qy libcurl4-openssl-dev clang
- name: compile
run: |
make ARCH=arm64 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ lo
make CC=clang CXX=clang++ LINK=clang++ ARCH=${{ matrix.platform }} lo
- name: check
env:
LO_HOME: ${{ github.workspace }}
run: |
make check
sudo apt-get install -qy libffi-dev liblz4-dev libseccomp-dev libsqlite3-dev libtcc-dev zlib1g-dev tcc
LINK=clang++ CC=clang CXX=clang++ ./lo test/build.js
LINK=clang++ CC=clang CXX=clang++ ./lo build runtime runtime/lo
- name: upload artifact
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/lo
name: lo-linux-arm64
name: lo-linux-${{ matrix.platform }}

build-windows:
if: ${{ false }} # disable
name: windows
runs-on: windows-latest
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
platform: [x64]
platform: [x64,arm64]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform }}
- name: Install MSVC/MCBuild (Windows)
uses: microsoft/[email protected]
- name: compile
run: |
make BINDINGS= lo.exe
make BINDINGS= ARCH=${{ matrix.platform }} lo.exe
- name: check
run: |
make check
Expand Down
62 changes: 15 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
build-mac:
# if: ${{ false }} # disable
name: mac
runs-on: macos-12
runs-on: macos-14
strategy:
fail-fast: false
matrix:
platform: [x64]
platform: [arm64]
steps:
- uses: actions/checkout@v3
- name: compile
Expand All @@ -43,14 +43,14 @@ jobs:
asset_name: lo-mac-${{ matrix.platform }}.gz
asset_content_type: application/gzip

build-mac-arm:
build-mac-x64:
# if: ${{ false }} # disable
name: mac
runs-on: macos-14
name: mac-x64
runs-on: macos-13
strategy:
fail-fast: false
matrix:
platform: [arm64]
platform: [x64]
steps:
- uses: actions/checkout@v3
- name: compile
Expand All @@ -59,7 +59,6 @@ jobs:
- name: check
env:
LO_HOME: ${{ github.workspace }}
PREFIX: /opt/homebrew/opt
run: |
make check
brew install lz4 zstd openssl@3
Expand All @@ -77,9 +76,9 @@ jobs:
asset_name: lo-mac-${{ matrix.platform }}.gz
asset_content_type: application/gzip

build-linux-x64:
build-linux:
# if: ${{ false }} # disable
name: linux-x64
name: linux
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -103,45 +102,15 @@ jobs:
./lo build runtime runtime/lo
- name: compress runtime
run: |
gzip -9 -c lo > lo-linux-x64.gz
gzip -9 -c lo > lo-linux-${{ matrix.platform }}.gz
- name: upload compressed artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: lo-linux-x64.gz
asset_name: lo-linux-x64.gz
asset_content_type: application/gzip

build-linux-arm:
if: ${{ false }} # disable
name: linux-arm64
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
platform: [x64]
steps:
- uses: actions/checkout@v3
- name: install arm64 tools
run: |
sudo apt-get update -y
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: compile
run: |
make ARCH=arm64 C=aarch64-linux-gnu-gcc CC=aarch64-linux-gnu-g++ lo
- name: compress runtime
run: |
gzip -9 -c lo > lo-linux-arm64.gz
- name: upload compressed artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: lo-linux-arm64.gz
asset_name: lo-linux-arm64.gz
asset_path: lo-linux-${{ matrix.platform }}.gz
asset_name: lo-linux-${{ matrix.platform }}.gz
asset_content_type: application/gzip

build-windows:
Expand All @@ -151,15 +120,14 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [x64]
platform: [x64,arm64]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform }}
- name: Install MSVC/MCBuild (Windows)
uses: microsoft/[email protected]
- name: compile
run: |
make lo.exe
make BINDINGS= ARCH=${{ matrix.platform }} lo.exe
- name: check
run: |
make check
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ v8/libv8_monolith.a: ## download the v8 static libary for linux/macos

v8/v8_monolith.lib: ## download the v8 static library for windows
curl -C - -L -o v8/v8_monolith.lib.zip https://github.com/just-js/v8/releases/download/${V8_VERSION}/libv8_monolith-${os}-${ARCH}.zip
tar -C v8 -xf v8/v8_monolith.lib.zip
unzip v8/v8_monolith.lib.zip

main.o: ## compile the main.cc object file
$(CXX) ${CCARGS} ${OPT} -DRUNTIME='"${RUNTIME}"' -DVERSION='"${VERSION}"' -I./v8 -I./v8/include ${WARN} ${V8_FLAGS} main.cc
Expand Down
2 changes: 1 addition & 1 deletion lib/curl/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Socket {
return
}
this.mode = SocketModes.readable
assert(!loop.modify(fd, Loop.Readable, resolve))
assert(!loop.modify(fd, resolve, Loop.Readable))
})
}

Expand Down
2 changes: 1 addition & 1 deletion lib/sqlite/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const preamble = `typedef int (*callback)(void*,int,char**,char**);\n`
//const obj = []
//const libs = ['sqlite3']
const libs = []
const obj = ['deps/sqlite/.libs/libsqlite3.a']
const obj = ['deps/sqlite/libsqlite3.a']
const constants = {
SQLITE_OPEN_READWRITE: 'i32', SQLITE_OPEN_PRIVATECACHE: 'i32',
SQLITE_ROW: 'i32', SQLITE_OPEN_NOMUTEX: 'i32', SQLITE_OPEN_CREATE: 'i32',
Expand Down
5 changes: 2 additions & 3 deletions lib/sqlite/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function build () {
assert(chdir('../') === 0)
}
if (obj.some(o => !isFile(o))) {
const sqlite_opts = `--disable-readline --disable-tcl --with-pic --disable-session --disable-libtool-lock --disable-largefile --disable-threadsafe --disable-load-extension`
const sqlite_opts = `--disable-readline --disable-tcl --disable-session --disable-largefile --disable-threadsafe --disable-load-extension`
assert(chdir('deps/sqlite') === 0)
if (!isFile('Makefile')) {
exec_env('./configure', sqlite_opts.split(' '), [
Expand Down Expand Up @@ -82,14 +82,13 @@ async function build () {
'-DSQLITE_USE_ALLOCA'
]
const C_FLAGS = [
'-flto ',
'-fPIC',
'-O3',
'-march=native',
'-mtune=native',
]
//assert(exec('make', ['clean'])[0] === 0)
assert(exec_env('make', ['-j', '4', 'libsqlite3.la'], [[
assert(exec_env('make', ['-j', '4', 'libsqlite3.a'], [[
'CFLAGS',
`${C_FLAGS.join(' ')} ${SQLITE_OPTS.join(' ')}`]])[0] === 0)
if (os === 'mac') unlink('VERSION') // on macos with clang, this gets included and causes a conflict which breaks the compiler. similar to https://trac.macports.org/ticket/62758
Expand Down
1 change: 1 addition & 0 deletions lo.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#include <unistd.h>
#endif

#if defined _WIN32 || defined __CYGWIN__
Expand Down
8 changes: 3 additions & 5 deletions runtime/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ const embeds = [


const target = 'lo'
const opt = '-O3 -march=native -mtune=native'
const opt = '-O3 -march=native -mtune=native -std=c++20 -c -fno-omit-frame-pointer -fno-rtti -fno-exceptions'

const v8_opts = {
v8_cleanup: 0, v8_threads: 2, on_exit: 0,
v8flags: '--stack-trace-limit=10 --use-strict --turbo-fast-api-calls --no-freeze-flags-after-init --cppgc-young-generation'
v8flags: '--stack-trace-limit=10 --use-strict --turbo-fast-api-calls --no-freeze-flags-after-init'
}

let link_type = '-rdynamic'
if (lo.core.os === 'linux') {
link_type += ' -static-libgcc -static-libstdc++'
}
if (lo.core.os === 'linux') link_type += ' -static-libgcc -static-libstdc++'

export default { bindings, libs, embeds, target, opt, v8_opts, link_type }
4 changes: 2 additions & 2 deletions runtime/core.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const bindings = [
const libs = []
const embeds = []
const target = 'lo'
const opt = '-O3 -march=native -mtune=native'
const opt = '-O3 -march=native -mtune=native -std=c++20 -c -fno-omit-frame-pointer -fno-rtti -fno-exceptions'

const v8_opts = {
v8_cleanup: 0, v8_threads: 2, on_exit: 0,
v8flags: '--stack-trace-limit=10 --use-strict --turbo-fast-api-calls --no-freeze-flags-after-init --cppgc-young-generation'
v8flags: '--stack-trace-limit=10 --use-strict --turbo-fast-api-calls --no-freeze-flags-after-init'
}

let link_type = '-rdynamic'
Expand Down
4 changes: 2 additions & 2 deletions runtime/lo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ const embeds = [


const target = 'lo'
const opt = '-DV8_ATOMIC_OBJECT_FIELD_WRITES -O3 -march=native -mtune=native -std=c++20 -c -fno-omit-frame-pointer -fno-rtti -fno-exceptions'
const opt = '-O3 -march=native -mtune=native -std=c++20 -c -fno-omit-frame-pointer -fno-rtti -fno-exceptions'

const v8_opts = {
v8_cleanup: 0, v8_threads: 8, on_exit: 0,
v8_cleanup: 0, v8_threads: 2, on_exit: 0,
v8flags: '--stack-trace-limit=10 --use-strict --turbo-fast-api-calls --no-freeze-flags-after-init'
// v8flags: '--stack-trace-limit=10 --use-strict --turbo-fast-api-calls --no-freeze-flags-after-init --max-heap-size 1024'
}
Expand Down

0 comments on commit 9af90a8

Please sign in to comment.