Files
bun.sh/scripts/cross-compile-codegen.sh
dave caruso 441612917d windows: more windows stuff (#6938)
* fix(win/upgrade): do not show powershell expand-archive info while upgrading

* start working bun run

* experiment: `bun.new`

* you can now bun run

* Update src/install/install.zig

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* Update src/install/install.zig

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* stuff

* fix stuff

* fix this

* farther but not really

* sadfs

* path hell

not sure how much worse or better this makes things. its a mess. windows path handlign is a mess aaaaaaaaaaaaaaaa

* path.resolve bs

* remove old build system stuff from pr

* a

* fix some path.parse/join cases

* path closer not perfect

* normalize and join tests tests  done

* paths

* implement path.relative

* ,

* stuff

* assert

* fix compile

* hate

* the code isnt great

* stuff

* housekeeping for build system

* blah

* explain windows sitaution in docs

* some progress? not much though

* zig compiler crashes here

* fix

* yippee

* ok

* a

* ala wala

* fix builds on stuff

* clean

* the tests now run

* a

* aa

* dedupe uv event loop

* fix fs test accuracy

* stuff

* [autofix.ci] apply automated fixes

* huge updat e

* [autofix.ci] apply automated fixes

* url

* [autofix.ci] apply automated fixes

* start windows spawnSync

* [autofix.ci] apply automated fixes

* add --webkit for update submodules

* add better err message for `bun setup`

* fix unix platform build

* .

* [autofix.ci] apply automated fixes

* un-upgrade libarchive

* z

* asdfghj

* wrk

* todo -> panic

* ok

* a

* [autofix.ci] apply automated fixes

* fix build scripts l ol

* dfghj

* fa

* [autofix.ci] apply automated fixes

* aaaa

* a

* l

* [autofix.ci] apply automated fixes

* more logs

* [autofix.ci] apply automated fixes

* j

* fix init_command

* CORE DUMP HELL

* i swear im being pranked by the github actions gods

* fadsjkfdshjkhjkdfsahjkdfshjksdafjkhhjkfdsahfsdkjhfsdjkahf

* thanks IAS

* this is the correct fix

* personal review

* ddisablbe these

* revisions!

* ok

* fix submodule

* stuff

* fix libarchive

* [autofix.ci] apply automated fixes

* stuff

* [autofix.ci] apply automated fixes

* a

* fix addressToJS on windows

* make dns async again

* dx: add flag to update submodules ps1 to clone webkit

* dns error case for libuv

* dx improvements on windows

* newline

* obvious fix

* install steps

* extra note

* fix fs test

* Update building-windows.md

* fix builtins bundler to support \r\n line endnigs

* better

* some windows stuff

* a

* a

* a

* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

* [autofix.ci] apply automated fixes

* bunfile text works

* fix build on the mac

* hellooooooooooo

* install steps

* ci for baseline?

* fix

* aaa

* wow

* install script revamp

* bug

* OK

* ok

* aaaaaaaaaaaaaa

* okay

* fix the node test runner lol

* fix napi stuff

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-12-14 16:56:33 -08:00

75 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
export TARGET_PLATFORM=${1:-win32}
export TARGET_ARCH=${2:-x64}
if ! which bun; then
export PATH="$PATH:$HOME/.bun/bin"
fi
cd "$(dirname "${BASH_SOURCE[0]}")/../"
OUT=build-codegen-${TARGET_PLATFORM}-${TARGET_ARCH}
if [ -n "$3" ]; then
OUT="$3"
fi
rm -rf "$OUT/codegen"
rm -rf "$OUT/js"
mkdir -p "$OUT"
mkdir -p "$OUT/"{codegen,js,tmp_functions,tmp_modules}
OUT=$(realpath "$OUT")
task() {
echo '$ '"$@"
"$@"
if [ "$?" != "0" ]; then
# some scripts are flaky, run them again
echo "!!! retrying"
"$@"
if [ "$?" != "0" ]; then
echo "!!! failed"
exit 1
fi
fi
}
task bun ./src/codegen/bundle-functions.ts --debug=OFF "$OUT"
task bun ./src/codegen/bundle-modules.ts --debug=OFF "$OUT"
rm -rf "$OUT/tmp_functions"
rm -rf "$OUT/tmp_modules"
CLASSES=(
./src/bun.js/*.classes.ts
./src/bun.js/api/*.classes.ts
./src/bun.js/test/*.classes.ts
./src/bun.js/webcore/*.classes.ts
./src/bun.js/node/*.classes.ts
)
task bun "./src/codegen/generate-classes.ts" ${CLASSES[@]} "$OUT/codegen"
LUTS=(
./src/bun.js/bindings/BunObject.cpp
./src/bun.js/bindings/ZigGlobalObject.lut.txt
./src/bun.js/bindings/JSBuffer.cpp
./src/bun.js/bindings/BunProcess.cpp
./src/bun.js/bindings/ProcessBindingConstants.cpp
./src/bun.js/bindings/ProcessBindingNatives.cpp
)
for lut in ${LUTS[@]}; do
result=$(basename $lut | sed 's/.lut.txt/.cpp/' | sed 's/.cpp/.lut.h/')
task bun "./src/codegen/create-hash-table.ts" "$lut" "$OUT/codegen/$result"
done
task bun "./src/codegen/generate-jssink.ts" "$OUT/codegen"
wait
rm -rf "$OUT/tmp"*
echo "-> `basename "$OUT"`"