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/10/18 07:03:13 UTC
(couchdb-glazier) branch feature/win/download-helper updated (51cd489 -> aaec4e2)
This is an automated email from the ASF dual-hosted git repository.
ronny pushed a change to branch feature/win/download-helper
in repository https://gitbox.apache.org/repos/asf/couchdb-glazier.git
omit 51cd489 Helper scripts for Windows
new aaec4e2 Helper scripts for Windows
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (51cd489)
\
N -- N -- N refs/heads/feature/win/download-helper (aaec4e2)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
bin/download_extract_rc.ps1 | 10 +++++-----
bin/exclude_tests_win.ps1 | 47 ++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 47 insertions(+), 10 deletions(-)
(couchdb-glazier) 01/01: Helper scripts for Windows
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ronny pushed a commit to branch feature/win/download-helper
in repository https://gitbox.apache.org/repos/asf/couchdb-glazier.git
commit aaec4e2c5cc01c77a0ab04ee987aa6fa7897cd10
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Thu Oct 17 08:57:25 2024 +0200
Helper scripts for Windows
Adding two helper scripts for Windows:
- `download_extract_rc.ps1` doing the boring and repetitive work
when testing a release. Downloads, checks and extract the source
tarball
- `exclude-tests-win.ps1` can be run to exclude some tests before
running `make check`
---
README.md | 20 +++++++++-
bin/download_extract_rc.ps1 | 89 +++++++++++++++++++++++++++++++++++++++++++++
bin/exclude_tests_win.ps1 | 72 ++++++++++++++++++++++++++++++++++++
3 files changed, 180 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d8cd25c..f87868f 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,8 @@ You're finally ready. You should have the following installed:
* VSSetup
* VSWhere
* GNU CoreUtils (cp, rm, rmdir, ...)
+* MSYS2 (for building QuickJS)
+* Java (for building Nouveau)
* VCPkg (https://github.com/Microsoft/vcpkg), which built and installed:
* ICU
* OpenSSL 3
@@ -97,8 +99,24 @@ The installer will be placed in your current working directory.
You made it! Time to relax. :D
-If you're a release engineer, you may find the following commands useful too:
+If you're a release engineer, the script `download_extract_rc.ps1` in
+the `bin\` directory helps you to download, check and extract a
+CouchDB source tarball.
+```
+SYNTAX
+ C:\relax\couchdb-glazier\bin\download_extract_rc.ps1 [[-CouchDBVersion] <String>] [[-ReleaseCandidate] <String>] [[-DownloadRootDirectory] <String>] [<CommonParameters>]
+
+
+DESCRIPTION
+ This command downloads, checks and extract a CouchDB source tarball
+
+ -CouchDBVersion CouchDB version number to download (default 3.4.2)
+ -ReleaseCandidate Release candidate version number (default rc1)
+ -DownloadRootDirectory Root directory to store the artifacts (default c:\relax\releases)
+```
+
+To checksum a source tarball, you may find the following commands useful too:
```
checksum -t sha256 apache-couchdb.#.#.#-RC#.tar.gz
checksum -t sha512 apache-couchdb.#.#.#-RC#.tar.gz
diff --git a/bin/download_extract_rc.ps1 b/bin/download_extract_rc.ps1
new file mode 100644
index 0000000..c4fc4f1
--- /dev/null
+++ b/bin/download_extract_rc.ps1
@@ -0,0 +1,89 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+
+# Helper script for lazy Windows Developers
+# Downloading, checking and extracting the sources of a rc candidate for Windows
+
+<#
+.SYNOPSIS
+ Little helper script for lazy Windows (Release) Developers
+.DESCRIPTION
+ This command downloads, checks and extract a CouchDB source tarball
+
+ -CouchDBVersion CouchDB version number to download (default 3.4.2)
+ -ReleaseCandidate Release candidate version number (default rc1)
+ -Path Directory to store the artifacts (default c:\relax\releases)
+
+.LINK
+ https://couchdb.apache.org/
+#>
+
+[CmdletBinding()]
+param(
+ [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
+ [ValidateNotNullOrEmpty()]
+ [String]$CouchDBVersion = "3.4.2",
+
+ [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
+ [ValidateNotNullOrEmpty()]
+ [String]$ReleaseCandidate = "rc1",
+
+ [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
+ [ValidateNotNullOrEmpty()]
+ [String]$Path = "C:\relax\releases"
+)
+
+$DOWNLOAD_URL = "https://dist.apache.org/repos/dist/dev/couchdb/source/$CouchDBVersion/$ReleaseCandidate/"
+$DOWNLOAD_DIR = Join-Path (Join-Path $Path $CouchDBVersion) $ReleaseCandidate
+
+# start shell
+. ${PSScriptRoot}\shell.ps1
+
+if(Test-Path -Path $DOWNLOAD_DIR) {
+ Remove-Item -Path $DOWNLOAD_DIR -Recurse -Force
+}
+New-Item -ItemType Directory -Path $DOWNLOAD_DIR
+
+# Download tarball and checksums
+$ProgressPreference = "SilentlyContinue"
+Write-Output "####### DOWNLOAD SOURCES ########"
+$fileList = Invoke-WebRequest $DOWNLOAD_URL -UseBasicParsing
+$fileNames = $($fileList.Links |?{$_.href -match "apache-couchdb"}).href
+foreach ($file in $fileNames)
+{
+ Write-Output $DOWNLOAD_URL$file
+ Invoke-WebRequest -Uri "$DOWNLOAD_URL$file" -OutFile $(Join-Path $DOWNLOAD_DIR $file)
+}
+Write-Output "#################################`n`n"
+
+# Used Software for compiling CouchDB
+Write-Output "####### SOFTWARE VERSIONS #######"
+erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
+elixir --version
+python --version
+java -version
+Write-Output "#################################`n`n"
+
+# Check signature and checksum
+Write-Output "######## CHECK SIGNATURE ########"
+C:\tools\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -where $DOWNLOAD_DIR -c "curl -s -L https://apache.org/dist/couchdb/KEYS | gpg --import -"
+C:\tools\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -where $DOWNLOAD_DIR -c "gpg --verify apache-couchdb-*.tar.gz.asc"
+C:\tools\msys64\msys2_shell.cmd -defterm -no-start -mingw64 -where $DOWNLOAD_DIR -c "sha256sum --check apache-couchdb-*.tar.gz.sha256"
+Write-Output "#################################`n`n"
+
+# Extract sources
+Write-Output "######## EXTRACT SORUCES ########"
+arc unarchive $(Join-Path $DOWNLOAD_DIR "apache-couchdb-*.tar.gz" -Resolve) "$DOWNLOAD_DIR"
+Write-Output "#################################`n`n"
+
+Set-Location "$DOWNLOAD_DIR\apache-couchdb-$CouchDBVersion"
diff --git a/bin/exclude_tests_win.ps1 b/bin/exclude_tests_win.ps1
new file mode 100644
index 0000000..93e2aa5
--- /dev/null
+++ b/bin/exclude_tests_win.ps1
@@ -0,0 +1,72 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+
+# Helper script for excluding some tests which fail under Windows
+# see https://github.com/apache/couchdb/issues/4398
+
+
+<#
+.SYNOPSIS
+ Little helper script to exclude some CouchDB before doing a "make check"
+
+.DESCRIPTION
+ This command renames some test files to get excluded/included from running tests
+
+ -IncludeTests Include already excluded tests for the next test run
+ -Path <string> Path to the CouchDB source tree directory
+
+.LINK
+ https://couchdb.apache.org/
+#>
+
+[CmdletBinding()]
+param(
+ [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
+ [ValidateNotNullOrEmpty()]
+ [string]$Path,
+
+ [switch]$IncludeTests = $false #include tests again
+)
+
+$excludeTests = @(
+ "src\couch\test\eunit\couchdb_attachments_tests.erl",
+ "src\chttpd\test\eunit\chttpd_db_test.erl",
+ "src\chttpd\test\eunit\chttpd_dbs_info_test.erl",
+ "src\chttpd\test\eunit\chttpd_security_tests.erl",
+ "src\chttpd\test\eunit\chttpd_socket_buffer_size_test.erl",
+ "src\chttpd\test\eunit\chttpd_socket_buffer_size_test.erl"
+)
+
+function renameFile ([string]$file, [bool]$exclude = $true) {
+ if($exclude) {
+ if( Test-Path -path $file ) {
+ Write-Host "$file is excluded during testing..."
+ Rename-Item -path $file -NewName "$file.old"
+ }
+ } else {
+ if( Test-Path -path "$file.old" ) {
+ Write-Host "$file is considered during testing..."
+ Rename-Item -path "$file.old" -NewName "$file"
+ }
+ }
+}
+
+foreach ($test in $excludeTests)
+{
+ $file = Join-Path $Path $test
+ if($IncludeTests) {
+ renameFile $file $false
+ } else {
+ renameFile $file $true
+ }
+}