]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: update nodejs to 18.17.0
authorNizamudeen A <nia@redhat.com>
Mon, 28 Aug 2023 14:45:06 +0000 (20:15 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 3 Oct 2023 05:25:50 +0000 (10:55 +0530)
the latest npm doesn't support setting python as a config like `npm
config set python3` instead it needs to be either set in the node-gyp
explicitly using the node-gyp command or through an environment
variable.
Since we are calling the node-gyp through npm, we need to set the
environment variable which is documented here: https://github.com/nodejs/node-gyp?tab=readme-ov-file#configuring-python-dependency

Accordingly the CMakeLists.txt for dashboard is adapted

Fixes: https://tracker.ceph.com/issues/62844
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 47f49e5b1ae2e5bf7aad5df23d877ae5df00210c)

doc/dev/developer_guide/dash-devel.rst
make-dist
src/pybind/mgr/dashboard/frontend/CMakeLists.txt

index cbeead788eb691b8ac0404e549565d5b0616ebbc..1277cecc552f7c6bec864163a86f89cf6e200ee4 100644 (file)
@@ -214,8 +214,8 @@ The build process is based on `Node.js <https://nodejs.org/>`_ and requires the
 Prerequisites
 ~~~~~~~~~~~~~
 
- * Node 16.20.0 or higher
- * NPM 6.14.9 or higher
+ * Node 18.17.0 or higher
+ * NPM 9.6.7 or higher
 
 nodeenv:
   During Ceph's build we create a virtualenv with ``node`` and ``npm``
index f38e1365991aede03898ccdfbb6e53c18f6257d0..721e9128c45ceeba17e86dfed0d1cd7f2e0bf3e3 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -132,7 +132,7 @@ build_dashboard_frontend() {
 
   $CURR_DIR/src/tools/setup-virtualenv.sh $TEMP_DIR
   $TEMP_DIR/bin/pip install nodeenv
-  $TEMP_DIR/bin/nodeenv --verbose -p --node=16.20.1
+  $TEMP_DIR/bin/nodeenv --verbose -p --node=18.17.0
   cd src/pybind/mgr/dashboard/frontend
 
   . $TEMP_DIR/bin/activate
index 78ba7620d589b874b40c2a86e968a286bd1f2139..2527ef23e85e5cd2d83e38ef475e23a96fd11431 100644 (file)
@@ -40,6 +40,7 @@ function(add_npm_options)
       npm config set ${key} ${value} --userconfig ${NC_NODEENV_DIR}/.npmrc &&
       deactivate)
   endforeach()
+  set(npm_config_python ${MGR_PYTHON_EXECUTABLE})
   add_custom_target(${NC_TARGET}
     ${commands}
     DEPENDS ${NC_NODEENV_DIR}/bin/npm
@@ -63,7 +64,7 @@ else(WITH_SYSTEM_NPM)
     OUTPUT "${mgr-dashboard-nodeenv-dir}/bin/npm"
     COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${mgr-dashboard-nodeenv-dir}
     COMMAND ${mgr-dashboard-nodeenv-dir}/bin/pip install nodeenv
-    COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv --verbose ${node_mirror_opt} -p --node=16.20.1
+    COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv --verbose ${node_mirror_opt} -p --node=18.17.0
     COMMAND mkdir ${mgr-dashboard-nodeenv-dir}/.npm
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "dashboard nodeenv is being installed")
@@ -73,7 +74,6 @@ else(WITH_SYSTEM_NPM)
   add_npm_options(
     NODEENV_DIR ${mgr-dashboard-nodeenv-dir}
     TARGET mgr-dashboard-nodeenv
-    OPTION python=${MGR_PYTHON_EXECUTABLE}
     OPTION cache=${mgr-dashboard-nodeenv-dir}/.npm
     ${npm_registry_opts})
   add_custom_target(mgr-dashboard-frontend-deps