You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2024/08/21 11:05:39 UTC
(couchdb-glazier) branch main updated: dev(`toolchain`): Update toolchain and versions (#37)
This is an automated email from the ASF dual-hosted git repository.
ronny pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-glazier.git
The following commit(s) were added to refs/heads/main by this push:
new 6c2ca29 dev(`toolchain`): Update toolchain and versions (#37)
6c2ca29 is described below
commit 6c2ca2968a1ab13d6a7d6db22aed5fd6914d738b
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Wed Aug 21 13:05:35 2024 +0200
dev(`toolchain`): Update toolchain and versions (#37)
- Bump build tools versions
- Install dev dependencies into own tools directory (default: c:\tools)
- Save download artifacts in separate directory
- Don't mix Spidermonkey bins with vcpkg bins
---
README.md | 9 ++++-----
bin/build_installer.ps1 | 8 ++++++++
bin/install_dependencies.ps1 | 47 +++++++++++++++++++++++++-------------------
bin/shell.ps1 | 23 ++++++++++++++--------
bin/variables.ps1 | 45 ++++++++++++++++++++++++------------------
5 files changed, 80 insertions(+), 52 deletions(-)
diff --git a/README.md b/README.md
index 21fdae3..d8cd25c 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ a consistent, repeatable build environment.
Note that the scripts you'll run will modify your system extensively. We recommend a *dedicated build machine or VM image* for this work:
- 64-bit Windows 7+. *As of CouchDB 2.0 we only support a 64-bit build of CouchDB*.
- - We like 64-bit Windows 10 Enterprise N (missing Media Player, etc.) from MSDN.
+ - We like 64-bit Windows 10 from MSDN.
- Apply Windows Updates and reboot until no more updates appear.
- If using a VM, shutdown and snapshot your VM at this point.
@@ -40,11 +40,10 @@ You should go get lunch. The last step will take over an hour, even on a speedy
You're finally ready. You should have the following installed:
* Visual Studio 2022 (Build Tools, Visual C++ workload, native desktop workload)
-* Windows 10 SDK (by native desktop workload; 10.0.19041.0)
+* Windows 10 SDK (by native desktop workload)
* NodeJS (LTS version)
-* WiX Toolset 3.11
+* WiX Toolset 3.14
* Python 3
- * Python packages sphinx, sphinx_rtd_theme, pygments, nose2 and hypothesis
* NSSM
* GNU make
* NuGet
@@ -52,7 +51,7 @@ You're finally ready. You should have the following installed:
* VSWhere
* GNU CoreUtils (cp, rm, rmdir, ...)
* VCPkg (https://github.com/Microsoft/vcpkg), which built and installed:
- * ICU (at time of writing, 69.1)
+ * ICU
* OpenSSL 3
* SpiderMonkey 91
diff --git a/bin/build_installer.ps1 b/bin/build_installer.ps1
index ef70078..32a8b6f 100644
--- a/bin/build_installer.ps1
+++ b/bin/build_installer.ps1
@@ -27,11 +27,18 @@ if (-Not ((Test-Path $CouchDB) -and ($CouchDB.EndsWith("rel\couchdb"))))
Write-Error "CouchDB release directory not found. Have you run make release? Exiting..."
exit 1
}
+
+# Test for existing env vars from shell.ps1
if (! $env:VCPKG_BIN)
{
Write-Error "Your VCPKG_BIN environment variable is not set! Exiting..."
exit 1
}
+if (! $env:COUCHDB_MOZJS_BIN)
+{
+ Write-Error "Your COUCHDB_MOZJS_BIN environment variable is not set! Exiting..."
+ exit 1
+}
$Glazier = "${PSScriptRoot}\.."
$VersionMK = Get-Content -Path "$CouchDB_Root\version.mk" | Out-String | ConvertFrom-StringData
@@ -47,6 +54,7 @@ Remove-Item "${CouchDB}\bin\*.dll", "${CouchDB}\bin\nssm.exe" -ErrorAction Ignor
# add build assets we need in the package
Copy-Item -Path "${env:VCPKG_BIN}\*.dll" -Destination "${CouchDB}\bin"
+Copy-Item -Path "${env:COUCHDB_MOZJS_BIN}\*.dll" -Destination "${CouchDB}\bin"
Copy-Item -Path "C:\ProgramData\Chocolatey\lib\nssm\tools\nssm.exe" -Destination "${CouchDB}\bin"
Move-Item -Path "${CouchDB}\etc\default.ini" -Destination "."
Move-Item -Path "${CouchDB}\etc\local.ini" -Destination "${CouchDB}\etc\local.ini.dist"
diff --git a/bin/install_dependencies.ps1 b/bin/install_dependencies.ps1
index bbe7828..afb8fe7 100644
--- a/bin/install_dependencies.ps1
+++ b/bin/install_dependencies.ps1
@@ -13,18 +13,27 @@
# Sourcing variable definitions
. ${PSScriptRoot}\variables.ps1
-# Exclude c:\relax from MS defender to speed up things
+# Create needed directories if not exist
+if (-not (Test-Path -Path $toolsDir)) {
+ New-Item -Path $toolsDir -ItemType Directory
+}
+if (-not (Test-Path -Path $artifactDir)) {
+ New-Item -Path $artifactDir -ItemType Directory
+}
+
+# Exclude c:\relax and tools directory from MS defender to speed up things
Add-MpPreference -ExclusionPath "C:\relax"
+Add-MpPreference -ExclusionPath "${toolsDir}"
# Install build tools - requires English language pack installed
choco install visualstudio2022buildtools "--passive --locale en-US"
choco install visualstudio2022-workload-vctools --package-parameters "--add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.Redist.MSM --add Microsoft.Net.Component.4.8.TargetingPack"
choco install make nssm vswhere gnuwin32-coreutils.portable
-choco install wixtoolset --version=3.11.2
-choco install nodejs --version=18.18.2
-choco install python --version=3.11.6
+choco install wixtoolset --version=3.14.1
+choco install nodejs --version=18.20.3
+choco install python --version=3.11.9
choco install archiver --version=3.1.0
-choco install msys2 --version=20240113.0.0
+choco install msys2 --version=20240727.0.0
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module VSSetup -Scope CurrentUser -Force
@@ -41,15 +50,15 @@ msys2_shell.cmd -defterm -no-start -ucrt64 -lc 'pacman -Syu'
msys2_shell.cmd -defterm -no-start -ucrt64 -lc 'pacman -S --noconfirm --needed base-devel make mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-dlfcn'
Write-Output " ******** Finished setting up MSYS ********"
+# Upgrade pip
python -m pip install --upgrade pip
-pip install --upgrade sphinx sphinxcontrib-httpdomain sphinx_rtd_theme pygments nose2 hypothesis
# Hide the Download-StatusBar and improve download speed of wget-Cmdlet
$ProgressPreference = 'SilentlyContinue'
# Download and install Erlang/OTP
Write-Output "Downloading Erlang ..."
-Invoke-WebRequest -Uri $erlBuildUri -OutFile $erlBuildFile
+Invoke-WebRequest -Uri $erlBuildUri -OutFile "$erlBuildFile"
Write-Output "Installing Erlang ..."
Start-Process -Wait -Filepath "$erlBuildFile" -ArgumentList "/S /D=${erlInstallPath}"
@@ -63,36 +72,34 @@ Expand-Archive -Path $elxBuildFile -DestinationPath $elxInstallPath
Write-Output "Downloading VCPkg ..."
Invoke-WebRequest -Uri $vcpkgUri -OutFile $vcpkgFile
Write-Output "Installing VCPkg ..."
-arc unarchive $vcpkgFile
-copy -Recurse -Force "vcpkg-${vcpkgVersion}" $vcpkgInstallPath
+arc unarchive $vcpkgFile $toolsDir
& "${vcpkgInstallPath}\bootstrap-vcpkg.bat" -disableMetrics
$vcpkg = "${vcpkgInstallPath}\vcpkg"
-& $vcpkg integrate install --triplet x64-windows
+& $vcpkg integrate install
Write-Output "Installing ICU ..."
-& $vcpkg install icu --triplet x64-windows
+& $vcpkg install icu
Write-Output "Installing OpenSSL ..."
-& $vcpkg install openssl --triplet x64-windows
+& $vcpkg install openssl
# Download and install SpiderMonkey
Write-Output "Downloading SpiderMonkey ..."
Invoke-WebRequest -Uri $smBuildUri -OutFile $smBuildFile
Write-Output "Installing SpiderMonkey ..."
-arc unarchive $smBuildFile
-copy -Recurse -Force "$smBuild\*" $vcpkgBase
+arc unarchive $smBuildFile $toolsDir
# Download and install Java 8
Write-Output "Downloading OpenJDK 8 ..."
Invoke-WebRequest -Uri $java8BuildUri -OutFile $java8BuildFile
Write-Output "Installing OpenJDK 8 ..."
-arc unarchive $java8BuildFile "C:\tools"
+arc unarchive $java8BuildFile "${toolsDir}"
-# Download and install Java 11
-Write-Output "Downloading OpenJDK 11 ..."
-Invoke-WebRequest -Uri $java11BuildUri -OutFile $java11BuildFile
-Write-Output "Installing OpenJDK 11 ..."
-arc unarchive $java11BuildFile "C:\tools"
+# Download and install Java 21
+Write-Output "Downloading OpenJDK 21 ..."
+Invoke-WebRequest -Uri $java21BuildUri -OutFile $java21BuildFile
+Write-Output "Installing OpenJDK 21 ..."
+arc unarchive $java21BuildFile "${toolsDir}"
# we know what we are doing (, do we really?)
Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
diff --git a/bin/shell.ps1 b/bin/shell.ps1
index e7d7ce1..45a1b72 100644
--- a/bin/shell.ps1
+++ b/bin/shell.ps1
@@ -28,16 +28,23 @@ if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.
Import-Module ${PSScriptRoot}\which.psm1
$env:VCPKG_BIN = "${vcpkgBase}\bin"
+$env:COUCHDB_MOZJS_BIN = "${smInstallPath}\bin"
+
$env:PATH += ";${erlInstallPath}\bin"
$env:PATH += ";${elxInstallPath}\bin"
$env:PATH += ";${vcpkgBase}\bin"
-$env:PATH += ";C:\Program Files (x86)\WiX Toolset v3.11\bin"
-$env:PATH += ";C:\tools\${java11Build}\bin"
-$env:PATH += ";C:\tools\msys64;C:\tools\msys64\ucrt64\bin"
+$env:PATH += ";${env:wix}\bin"
+$env:PATH += ";${smInstallPath}\bin"
+$env:PATH += ";${toolsDir}\${java21Build}\bin"
+$env:PATH += ";${toolsDir}\msys64;${toolsDir}\msys64\ucrt64\bin"
+
+$env:LIB = "${vcpkgBase}\lib;${smInstallPath}\lib;" + $env:LIB
+$env:INCLUDE = "${vcpkgBase}\include;${smInstallPath}\include;" + $env:INCLUDE
+$env:LIBPATH = "${vcpkgBase}\lib;${smInstallPath}\lib;" + $env:LIBPATH
-$env:LIB = "${vcpkgBase}\lib;" + $env:LIB
-$env:INCLUDE = "${vcpkgBase}\include;" + $env:INCLUDE
-$env:LIBPATH = "${vcpkgBase}\lib;" + $env:LIBPATH
+# Needed for Nouveau
+$env:JAVA_HOME = "${toolsDir}\${java21Build}"
+$env:PATH += ";${env:JAVA_HOME}\bin"
-$env:JAVA_HOME = "C:\tools\${java11Build}"
-$env:CLOUSEAU_JAVA_HOME = "C:\tools\${java8Build}"
+# Needed for Closeau
+$env:CLOUSEAU_JAVA_HOME = "${toolsDir}\${java8Build}"
diff --git a/bin/variables.ps1 b/bin/variables.ps1
index 8284738..5523358 100644
--- a/bin/variables.ps1
+++ b/bin/variables.ps1
@@ -10,49 +10,56 @@
# License for the specific language governing permissions and limitations under
# the License.
+# Installation directory for build tools
+$toolsDir = "C:\tools"
+$artifactDir = "${toolsDir}\ArtifactDownloads"
+
# VCPKG SETTINGS
# Download location of Vcpkg for Windows
-$vcpkgVersion = "2023.10.19"
+$vcpkgVersion = "2024.07.12"
$vcpkgUri = "https://github.com/microsoft/vcpkg/archive/refs/tags/${vcpkgVersion}.zip"
-$vcpkgFile = Split-Path $vcpkgUri -Leaf
-$vcpkgInstallPath = "C:\tools\vcpkg"
+$vcpkgFile = "${artifactDir}\$(Split-Path $vcpkgUri -Leaf)"
+$vcpkgInstallPath = "${toolsDir}\vcpkg-${vcpkgVersion}"
$vcpkgBase = "${vcpkgInstallPath}\installed\x64-windows"
# ERLANG BUILD SETTINGS
# Download location of the Erlang/OTP Environment for Windows (x64)
-$erlVersion = "25.3.2.12"
+$erlVersion = "25.3.2.13"
$erlBuildUri = "https://github.com/erlang/otp/releases/download/OTP-${erlVersion}/otp_win64_${erlVersion}.exe"
-$erlBuildFile = Split-Path $erlBuildUri -Leaf
+$erlBuildFile = "${artifactDir}\$(Split-Path $erlBuildUri -Leaf)"
$erlDir = "erl-${erlVersion}"
-$erlInstallPath = "C:\tools\${erlDir}"
+$erlInstallPath = "${toolsDir}\${erlDir}"
# ERLANG BUILD SETTINGS
# Download location of the Elixir binaries for Windows (x64)
-$elxBuildUri = "https://github.com/elixir-lang/elixir/releases/download/v1.15.7/elixir-otp-25.zip"
-$elxBuildFile = Split-Path $elxBuildUri -Leaf
-$elxInstallPath = "C:\relax\elixir"
+$elxVersion = "1.15.7"
+$elxBuildUri = "https://github.com/elixir-lang/elixir/releases/download/v${elxVersion}/elixir-otp-25.zip"
+$elxBuildFile = "${artifactDir}\$(Split-Path $elxBuildUri -Leaf)"
+$elxDir = "elixir-${elxVersion}"
+$elxInstallPath = "${toolsDir}\${elxDir}"
# SPIDERMONKEY SETTINGS
-# Donwload location of the SpiderMonkey development files for Windows (x64)
+# Download location of the pre-build SpiderMonkey development files for Windows (x64)
$smBuild = "Windows-mozjs-91"
-$smBuildUri = "https://github.com/big-r81/couchdb-sm/releases/download/v0.0.3/$smBuild.tar.xz"
-$smBuildFile = Split-Path $smBuildUri -Leaf
-$smInstallPath = "C:\relax\vcpkg\installed\x64-windows"
+$smBuildVersion = "0.0.6"
+$smBuildUri = "https://github.com/big-r81/couchdb-sm/releases/download/v${smBuildVersion}/${smBuild}.tar.xz"
+$smBuildFile = "${artifactDir}\$(Split-Path $smBuildUri -Leaf)"
+$smInstallPath = "${toolsDir}\${smBuild}"
# JAVA 8 SETTINGS
# Donwload location of OpenJDK 8 for Windows (x64)
$java8Build = "zulu8.80.0.17-ca-jdk8.0.422-win_x64"
$java8BuildUri = "https://cdn.azul.com/zulu/bin/$java8Build.zip"
-$java8BuildFile = Split-Path $java8BuildUri -Leaf
+$java8BuildFile = "${artifactDir}\$(Split-Path $java8BuildUri -Leaf)"
-# JAVA 11 SETTINGS
+# JAVA 21 SETTINGS
-# Donwload location of OpenJDK 11 for Windows (x64)
-$java11Build = "zulu11.74.15-ca-jdk11.0.24-win_x64"
-$java11BuildUri = "https://cdn.azul.com/zulu/bin/$java11Build.zip"
-$java11BuildFile = Split-Path $java11BuildUri -Leaf
+# Donwload location of OpenJDK 21 for Windows (x64)
+$java21Build = "zulu21.36.17-ca-jdk21.0.4-win_x64"
+$java21BuildUri = "https://cdn.azul.com/zulu/bin/$java21Build.zip"
+$java21BuildFile = "${artifactDir}\$(Split-Path $java21BuildUri -Leaf)"