aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/bun-mac-aarch64.yml8
-rw-r--r--.github/workflows/bun-mac-x64-baseline.yml8
-rw-r--r--.github/workflows/bun-mac-x64.yml8
-rw-r--r--.gitignore3
-rwxr-xr-x.scripts/postinstall.sh36
-rw-r--r--.vscode/settings.json1
-rw-r--r--Dockerfile1
-rw-r--r--docs/project/developing.md2
8 files changed, 66 insertions, 1 deletions
diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml
index 642f20d0c..df1cb292f 100644
--- a/.github/workflows/bun-mac-aarch64.yml
+++ b/.github/workflows/bun-mac-aarch64.yml
@@ -164,6 +164,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
@@ -184,6 +185,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -200,6 +202,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -215,6 +218,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -281,6 +285,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
@@ -299,6 +304,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
@@ -326,6 +332,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -342,6 +349,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml
index 919333fa5..22309203f 100644
--- a/.github/workflows/bun-mac-x64-baseline.yml
+++ b/.github/workflows/bun-mac-x64-baseline.yml
@@ -164,6 +164,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
@@ -191,6 +192,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
@@ -204,6 +206,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
@@ -218,6 +221,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
@@ -282,6 +286,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
@@ -300,6 +305,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -330,6 +336,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -346,6 +353,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml
index 434c43e4e..e6df81926 100644
--- a/.github/workflows/bun-mac-x64.yml
+++ b/.github/workflows/bun-mac-x64.yml
@@ -164,6 +164,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
@@ -178,6 +179,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
@@ -205,6 +207,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
@@ -219,6 +222,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
@@ -284,6 +288,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
run: |
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
@@ -297,6 +302,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -332,6 +338,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
@@ -348,6 +355,7 @@ jobs:
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
+ IS_BUN_RELEASE_BUILD: true
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
diff --git a/.gitignore b/.gitignore
index 49fb9c41d..05cb69fa0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -113,4 +113,5 @@ src/bun.js/debug-bindings-obj
failing-tests.txt
test.txt
-myscript.sh \ No newline at end of file
+myscript.sh
+zls
diff --git a/.scripts/postinstall.sh b/.scripts/postinstall.sh
index 9bc888037..abbf04582 100755
--- a/.scripts/postinstall.sh
+++ b/.scripts/postinstall.sh
@@ -1,9 +1,45 @@
#!/bin/bash
set -euxo pipefail
+parent_path=$(
+ cd "$(dirname "${BASH_SOURCE[0]}")"
+ pwd -P
+)
+
+cd "$parent_path/../"
+
# if bun-webkit node_modules directory exists
+# this is how we know we are in development mode
if [ -d ./node_modules/bun-webkit ]; then
rm -f bun-webkit
# get the first matching bun-webkit-* directory name
ln -s ./node_modules/$(ls ./node_modules | grep bun-webkit- | head -n 1) ./bun-webkit
fi
+
+IS_BUN_RELEASE_BUILD=${IS_BUN_RELEASE_BUILD:-"false"}
+ZLS_VERSION_USED_BY_BUN=${ZLS_VERSION_USED_BY_BUN:-"4b034f1afba5c6d1224ee76f69bedd3f82cf65a6"}
+
+if [ "$IS_BUN_RELEASE_BUILD" == "false" ]; then
+ if command -v zig && command -v git; then
+ if [ ! -d ./zls ]; then
+ echo "Cloning Zig Language Server..."
+ git clone https://github.com/zigtools/zls --depth 1 --recurse-submodules
+ echo "Cloned Zig Language Server"
+ fi
+
+ # if zls executable does not exist OR if the zls version is not the same as the one we want to clone
+ if [ ! -f ./zls/zig-out/bin/zls ] || [ ! -f ./zls/.zls-version ] || [ "$(cat ./zls/.zls-version)" != "$ZLS_VERSION_USED_BY_BUN" ]; then
+ echo "Updating Zig Language Server to $ZLS_VERSION_USED_BY_BUN..."
+ cd ./zls
+ git fetch origin $ZLS_VERSION_USED_BY_BUN
+ git checkout --force "$ZLS_VERSION_USED_BY_BUN"
+ git submodule update --init --recursive
+ zig build -Doptimize=ReleaseFast
+ rm -f .zls-version
+ echo "$ZLS_VERSION_USED_BY_BUN" > .zls-version
+ echo ""
+ echo "Zig Language Server updated to $ZLS_VERSION_USED_BY_BUN"
+ cd ..
+ fi
+ fi
+fi
diff --git a/.vscode/settings.json b/.vscode/settings.json
index b535a1bd5..368b5f1f9 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -10,6 +10,7 @@
"zig.buildArgs": ["obj", "-Dfor-editor"],
"zig.buildOption": "build",
"zig.buildFilePath": "${workspaceFolder}/build.zig",
+ "zig.zls.path": "${workspaceFolder}/zls/zig-out/bin/zls",
"[zig]": {
"editor.tabSize": 4,
"editor.useTabStops": false,
diff --git a/Dockerfile b/Dockerfile
index ec11e9aea..08d8da83a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -417,6 +417,7 @@ ARG BUN_BASE_VERSION
ENV BUN_BASE_VERSION=${BUN_BASE_VERSION}
ENV GIT_SHA=${GIT_SHA}
+ENV IS_BUN_RELEASE_BUILD=true
COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer/
COPY --from=node_fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
diff --git a/docs/project/developing.md b/docs/project/developing.md
index 50da312a4..daa4aea43 100644
--- a/docs/project/developing.md
+++ b/docs/project/developing.md
@@ -108,6 +108,8 @@ Use [`zigup`](https://github.com/marler8997/zigup) to install the version of Zig
$ zigup 0.11.0-dev.1783+436e99d13
```
+[Zig Language Server](https://github.com/zigtools/zls) is automatically compiled & installed to `zls/zig-out/bin/zls` when you run `bun install` (or npm install) in bun's repository.
+
### Building
To install and build dependencies: