Forráskód Böngészése

update bun to 1.2.0 (#4678)

Khaleel Al-Adhami 3 hónapja
szülő
commit
8dea682781

+ 2 - 2
reflex/constants/installer.py

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

+ 1 - 0
reflex/utils/prerequisites.py

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

+ 20 - 9
scripts/bun_install.sh

@@ -78,6 +78,14 @@ case $platform in
     ;;
 esac
 
+case "$target" in
+'linux'*)
+    if [ -f /etc/alpine-release ]; then
+        target="$target-musl"
+    fi
+    ;;
+esac
+
 if [[ $target = darwin-x64 ]]; then
     # Is this process 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"
 
-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
-        target=darwin-x64-baseline
+        target="$target-baseline"
     fi
-fi
-
-if [[ $target = linux-x64 ]]; then
+    ;;
+'linux-x64'*)
     # If AVX2 isn't supported, use the -baseline build
     if [[ $(cat /proc/cpuinfo | grep avx2) = '' ]]; then
-        target=linux-x64-baseline
+        target="$target-baseline"
     fi
-fi
+    ;;
+esac
 
 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."
 fi
 
+bun_version=BUN_VERSION
+
 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
     bun_uri=$github_repo/releases/download/$1/bun-$target.zip
 fi

+ 4 - 0
scripts/install.ps1

@@ -214,8 +214,12 @@ function Install-Bun {
   # http://community.sqlbackupandftp.com/t/error-1073741515-solved/1305
   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 "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"
     return 1
   }