update bun to 1.2.0 (#4678)

This commit is contained in:
Khaleel Al-Adhami 2025-01-22 15:19:25 -08:00 committed by GitHub
parent 1106aae76e
commit 8dea682781
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 11 deletions

View File

@ -37,10 +37,10 @@ class Bun(SimpleNamespace):
"""Bun constants.""" """Bun constants."""
# The Bun version. # The Bun version.
VERSION = "1.1.29" VERSION = "1.2.0"
# Min Bun Version # Min Bun Version
MIN_VERSION = "0.7.0" MIN_VERSION = "1.1.0"
# URL to bun install script. # URL to bun install script.
INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/bun_install.sh" INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/bun_install.sh"

View File

@ -921,6 +921,7 @@ def install_bun():
constants.Bun.INSTALL_URL, constants.Bun.INSTALL_URL,
f"bun-v{constants.Bun.VERSION}", f"bun-v{constants.Bun.VERSION}",
BUN_INSTALL=str(constants.Bun.ROOT_PATH), BUN_INSTALL=str(constants.Bun.ROOT_PATH),
BUN_VERSION=str(constants.Bun.VERSION),
) )

View File

@ -78,6 +78,14 @@ case $platform in
;; ;;
esac esac
case "$target" in
'linux'*)
if [ -f /etc/alpine-release ]; then
target="$target-musl"
fi
;;
esac
if [[ $target = darwin-x64 ]]; then if [[ $target = darwin-x64 ]]; then
# Is this process running in Rosetta? # Is this process running in Rosetta?
# redirect stderr to devnull to avoid error message when not running in Rosetta # redirect stderr to devnull to avoid error message when not running in Rosetta
@ -91,19 +99,20 @@ GITHUB=${GITHUB-"https://github.com"}
github_repo="$GITHUB/oven-sh/bun" github_repo="$GITHUB/oven-sh/bun"
if [[ $target = darwin-x64 ]]; then # If AVX2 isn't supported, use the -baseline build
# If AVX2 isn't supported, use the -baseline build case "$target" in
'darwin-x64'*)
if [[ $(sysctl -a | grep machdep.cpu | grep AVX2) == '' ]]; then if [[ $(sysctl -a | grep machdep.cpu | grep AVX2) == '' ]]; then
target=darwin-x64-baseline target="$target-baseline"
fi fi
fi ;;
'linux-x64'*)
if [[ $target = linux-x64 ]]; then
# If AVX2 isn't supported, use the -baseline build # If AVX2 isn't supported, use the -baseline build
if [[ $(cat /proc/cpuinfo | grep avx2) = '' ]]; then if [[ $(cat /proc/cpuinfo | grep avx2) = '' ]]; then
target=linux-x64-baseline target="$target-baseline"
fi fi
fi ;;
esac
exe_name=bun exe_name=bun
@ -113,8 +122,10 @@ if [[ $# = 2 && $2 = debug-info ]]; then
info "You requested a debug build of bun. More information will be shown if a crash occurs." info "You requested a debug build of bun. More information will be shown if a crash occurs."
fi fi
bun_version=BUN_VERSION
if [[ $# = 0 ]]; then if [[ $# = 0 ]]; then
bun_uri=$github_repo/releases/latest/download/bun-$target.zip bun_uri=$github_repo/releases/download/bun-v$bun_version/bun-$target.zip
else else
bun_uri=$github_repo/releases/download/$1/bun-$target.zip bun_uri=$github_repo/releases/download/$1/bun-$target.zip
fi fi

View File

@ -214,8 +214,12 @@ function Install-Bun {
# http://community.sqlbackupandftp.com/t/error-1073741515-solved/1305 # http://community.sqlbackupandftp.com/t/error-1073741515-solved/1305
if (($LASTEXITCODE -eq 3221225781) -or ($LASTEXITCODE -eq -1073741515)) # STATUS_DLL_NOT_FOUND if (($LASTEXITCODE -eq 3221225781) -or ($LASTEXITCODE -eq -1073741515)) # STATUS_DLL_NOT_FOUND
{ {
# TODO: as of July 2024, Bun has no external dependencies.
# I want to keep this error message in for a few months to ensure that
# if someone somehow runs into this, it can be reported.
Write-Output "Install Failed - You are missing a DLL required to run bun.exe" Write-Output "Install Failed - You are missing a DLL required to run bun.exe"
Write-Output "This can be solved by installing the Visual C++ Redistributable from Microsoft:`nSee https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist`nDirect Download -> https://aka.ms/vs/17/release/vc_redist.x64.exe`n`n" Write-Output "This can be solved by installing the Visual C++ Redistributable from Microsoft:`nSee https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist`nDirect Download -> https://aka.ms/vs/17/release/vc_redist.x64.exe`n`n"
Write-Output "The error above should be unreachable as Bun does not depend on this library. Please comment in https://github.com/oven-sh/bun/issues/8598 or open a new issue.`n`n"
Write-Output "The command '${BunBin}\bun.exe --revision' exited with code ${LASTEXITCODE}`n" Write-Output "The command '${BunBin}\bun.exe --revision' exited with code ${LASTEXITCODE}`n"
return 1 return 1
} }