You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2023/06/15 20:23:47 UTC

[arrow] branch main updated: GH-36025: [JS] Allow Node.js 18.14 or later in `verify-release-candidate.sh` (#36089)

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 28884b2e68 GH-36025: [JS] Allow Node.js 18.14 or later in `verify-release-candidate.sh` (#36089)
28884b2e68 is described below

commit 28884b2e6868b5cd1dae6550d240f83b25ae78df
Author: Abe Tomoaki <ab...@enzou.tokyo>
AuthorDate: Fri Jun 16 05:23:41 2023 +0900

    GH-36025: [JS] Allow Node.js 18.14 or later in `verify-release-candidate.sh` (#36089)
    
    
    
    ### Rationale for this change
    
    In Node.js 18.14 or later, `gulp bundle:webpack` succeeds.
    So we support running `verify-release-candidate.sh` with Node.js 18.14 or later.
    
    ### What changes are included in this PR?
    
    Node.js version check allows 16, 18.14 or later.
    Install Node.js LTS with `nvm`.
    
    ### Are these changes tested?
    
    I have tested that `TEST_DEFAULT=0 TEST_JS=1 dev/release/verify-release-candidate.sh` succeeds in several environments.
    
    * Node.js is not installed
        * v18.16.0 installed with `nvm` and `verify-release-candidate.sh` succeeded.
    * Node.js 16.x installed
        *  Node.js 16.x is used and `verify-release-candidate.sh` succeeded.
    * Node.js 18.13.0 installed
        * v18.16.0 installed  with `nvm` and `verify-release-candidate.sh` succeeded.
    * Node.js 18.14.0 installed
        *  Node.js 18.14.0 is used and `verify-release-candidate.sh` succeeded.
    * Node.js 20.x installed
        *  Node.js 20.x is used and `verify-release-candidate.sh` succeeded.
    
    ### Are there any user-facing changes?
    
    * Closes: #36025
    
    Authored-by: abetomo <ab...@enzou.tokyo>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 dev/release/verify-release-candidate.sh | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh
index 4183520a06..510751ef60 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -315,21 +315,21 @@ install_nodejs() {
     return 0
   fi
 
-  required_node_major_version=16
   node_major_version=$(node --version 2>&1 | grep -o '^v[0-9]*' | sed -e 's/^v//g' || :)
-
-  if [ -n "${node_major_version}" ] && [ "${node_major_version}" -ge ${required_node_major_version} ]; then
-    show_info "Found NodeJS installation with major version ${node_major_version}"
+  node_minor_version=$(node --version 2>&1 | grep -o '^v[0-9]*\.[0-9]*' | sed -e 's/^v[0-9]*\.//g' || :)
+  if [[ -n "${node_major_version}" && -n "${node_minor_version}" &&
+      ("${node_major_version}" -eq 16 ||
+        ("${node_major_version}" -eq 18 && "${node_minor_version}" -ge 14) ||
+        "${node_major_version}" -ge 20) ]]; then
+    show_info "Found NodeJS installation with version v${node_major_version}.${node_minor_version}.x"
   else
-    export NVM_DIR="`pwd`/.nvm"
+    export NVM_DIR="$(pwd)/.nvm"
     mkdir -p $NVM_DIR
-    curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | \
+    curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | \
       PROFILE=/dev/null bash
     [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
 
-    # ARROW-18335: "gulp bundle" failed with Node.js 18.
-    # nvm install --lts
-    nvm install 16
+    nvm install --lts
     show_info "Installed NodeJS $(node --version)"
   fi
 
@@ -837,7 +837,7 @@ test_js() {
   show_header "Build and test JavaScript libraries"
 
   maybe_setup_nodejs || exit 1
-  maybe_setup_conda nodejs=16 || exit 1
+  maybe_setup_conda nodejs=18 || exit 1
 
   if ! command -v yarn &> /dev/null; then
     npm install yarn