mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
feat: Implement using keyword (explicit resource management) (#8151)
* port 'initial support for using declarations' 1:1 port of this commit:56a3e01244* port 'initial support for await using declarations' 1:1 port of this commit:1634a0b5ad* fix cmake config for local jsc * add global defines for symbols * begin porting lowering implementation based off of https://github.com/evanw/esbuild/pull/3192 * [autofix.ci] apply automated fixes * add some fun webkit scripts * fix the minification bug * refactor runtime_js, etc * rename test file * finished yapping * silly silyl * Update src/bundler.zig * ok * a * Fix crash --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
56
scripts/fork-webkit.sh
Executable file
56
scripts/fork-webkit.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
# this script is the magic script to configure your devenv for making a patch to WebKit
|
||||
# once you are done with the patch you can run this again with --undo
|
||||
# you can also run this with --danger-reset to force reset the submodule (danger)
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [ "$#" == "0" ]; then
|
||||
if ! [ -d build ]; then
|
||||
bash ./scripts/setup.sh
|
||||
fi
|
||||
|
||||
bash ./scripts/update-submodules.sh --webkit
|
||||
|
||||
platform=linux
|
||||
if [ "$(uname)" == "Darwin" ]; then
|
||||
platform=mac
|
||||
fi
|
||||
|
||||
make jsc-build-${platform}-compile-debug
|
||||
cmake -Bbuild -DWEBKIT_DIR=$(pwd)/src/bun.js/WebKit/WebKitBuild/Debug
|
||||
# ninja -Cbuild
|
||||
|
||||
echo ""
|
||||
echo "Ready"
|
||||
echo ""
|
||||
echo "TODO: add a better way to invoke the webkit build script"
|
||||
echo "For now to recompile WebKit, run:"
|
||||
echo ""
|
||||
echo " $ make jsc-build-${platform}-compile-debug && ninja -Cbuild"
|
||||
echo ""
|
||||
echo "To reset this back to using prebuild, run:"
|
||||
echo ""
|
||||
echo " $ $0 --undo"
|
||||
echo " $ $0 --danger-reset # this invokes 'git reset --hard'"
|
||||
echo ""
|
||||
|
||||
|
||||
exit;
|
||||
fi
|
||||
|
||||
if [ "$1" == '--undo' ]; then
|
||||
cmake -Bbuild -UWEBKIT_DIR
|
||||
echo Reset ./build to use the system WebKit
|
||||
exit;
|
||||
fi
|
||||
|
||||
if [ "$1" == '--danger-reset' ]; then
|
||||
cmake -Bbuild -UWEBKIT_DIR
|
||||
bash ./scripts/set-webkit-submodule-to-cmake.sh
|
||||
exit;
|
||||
fi
|
||||
|
||||
echo "Unknown argument: $1"
|
||||
echo "Usage: $0 [--undo/--danger-reset]"
|
||||
15
scripts/set-webkit-submodule-to-cmake.sh
Executable file
15
scripts/set-webkit-submodule-to-cmake.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
|
||||
|
||||
WEBKIT_TAG=$(grep 'set(WEBKIT_TAG' "CMakeLists.txt" | awk '{print $2}' | cut -f 1 -d ')')
|
||||
if [ -z "${WEBKIT_TAG}" ]; then
|
||||
echo "Could not find WEBKIT_TAG in CMakeLists.txt"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Setting WebKit submodule to ${WEBKIT_TAG}"
|
||||
cd src/bun.js/WebKit
|
||||
git fetch origin "${WEBKIT_TAG}"
|
||||
git reset --hard "${WEBKIT_TAG}"
|
||||
Reference in New Issue
Block a user