glue-viz / bqplot-image-gl

Jupyter widget for displaying images with a focus on astronomy
MIT License
19 stars 13 forks source link

bqplot-image-gl fails to build from source #99

Closed pllim closed 1 year ago

pllim commented 1 year ago

It was working before but now it is failing. Definitely not because of something you did here, because the last commit was from Aug 2022. So it is something you did not do, i.e., upstream changed and is no longer compatible.

Example log: https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133

× Building wheel for bqplot-image-gl (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [161 lines of output]
      running bdist_wheel
      running jsdeps
      Installing build dependencies with npm.  This may take a while...
      > npm install
      npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
      npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
      npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
      npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
      npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
      npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
      npm WARN deprecated crypto@1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
      npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
      npm WARN deprecated topojson@1.6.27: Use topojson-client, topojson-server or topojson-simplify directly.
      npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

      > bqplot-image-gl@1.4.11 postinstall
      > patch-package

      patch-package 6.5.1
      Applying patches...
      three@0.97.0 ✔

      > bqplot-image-gl@1.4.11 prepare
      > npm run build

      > bqplot-image-gl@1.4.11 build
      > npm run build:labextension && webpack --mode=production

      > bqplot-image-gl@1.4.11 build:labextension
      > jupyter labextension build .

      Building extension in .

      Compilation starting…

      Compilation finished

      assets by chunk 742 KiB (id hint: vendors)
        asset 212.1a3db135695e51e781e2.js?v=1a3db135695e51e781e2 547 KiB [emitted] [immutable] [minimized] [big] (id hint: vendors) 1 related asset
        asset 486.3a1b2f5aba4c76cb7e99.js?v=3a1b2f5aba4c76cb7e99 69 KiB [emitted] [immutable] [minimized] (id hint: vendors) 1 related asset
        asset 822.ed05ba9b0a28029a54b4.js?v=ed05ba9b0a28029a54b4 56.9 KiB [emitted] [immutable] [minimized] (id hint: vendors) 1 related asset
        asset 737.4b3d09861495f1[62](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:63)be6c.js?v=4b3d09861495f162be6c 36.6 KiB [emitted] [immutable] [minimized] (id hint: vendors)
        asset 374.70cfa7411427495179e3.js?v=70cfa7411427495179e3 26.3 KiB [emitted] [immutable] [minimized] (id hint: vendors)
        asset 779.1ec270975c36b07fb461.js?v=1ec270975c36b07fb461 6.78 KiB [emitted] [immutable] [minimized] (id hint: vendors)
      asset 568.43bd08fa01c83019625b.js?v=43bd08fa01c83019625b 53.7 KiB [emitted] [immutable] [minimized]
      asset third-party-licenses.json 19.8 KiB [emitted]
      asset remoteEntry.880f5a65ca2601cda16d.js 8.53 KiB [emitted] [immutable] [minimized] (name: bqplot-image-gl)
      asset 501.2039d5d0f728[64](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:65)eac0c7.js?v=2039d5d0f72864eac0c7 728 bytes [emitted] [immutable] [minimized]
      asset 261.3bfa212b3b67b52cda4f.js?v=3bfa212b3b67b52cda4f 305 bytes [emitted] [immutable] [minimized]
      orphan modules 208 KiB [orphan] 2[65](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:66) modules
      runtime modules 20.4 KiB 13 modules
      built modules 2.09 MiB (javascript) 462 bytes (consume-shared) 294 bytes (share-init) [built]
        cacheable modules 2.09 MiB 57 modules
        consume-shared-module modules 462 bytes
          modules by path consume shared module (default) @jupyter-widgets/ 84 bytes
            consume shared module (default) @jupyter-widgets/base@^1.0.0 || ^2.0.0 || ^3.0.0 (singleton) 42 bytes [built] [code generated]
            consume shared module (default) @jupyter-widgets/base@^1.1.8 (singleton) 42 bytes [built] [code generated]
          + 9 modules
        provide-module modules 294 bytes
          provide shared module (default) bqplot-image-gl@1.4.11 = ./lib/index.js 42 bytes [built] [code generated]
          provide shared module (default) d3-contour@1.3.2 = ./node_modules/d3-contour/src/index.js 42 bytes [built] [code generated]
          provide shared module (default) d3-geo@1.12.1 = ./node_modules/d3-geo/src/index.js 42 bytes [built] [code generated]
          + 4 modules
        container entry 42 bytes [built] [code generated]

      WARNING in license-webpack-plugin: could not find any license file for jupyter-dataserializers. Use the licenseTextOverrides option to add the license text if desired.

      WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
      This can impact web performance.
      Assets:
        212.1a3db135695e51e781e2.js?v=1a3db135695e51e781e2 (547 KiB)

      webpack 5.75.0 compiled with 2 warnings in 8838 ms
      node:internal/crypto/hash:71
        this[kHandle] = new _Hash(algorithm, xofLen);
                        ^

      Error: error:0308010C:digital envelope routines::unsupported
          at new Hash (node:internal/crypto/hash:71:19)
          at Object.createHash (node:crypto:133:10)
          at module.exports (/tmp/pip-req-build-j6n2hs2k/js/node_modules/webpack/lib/util/createHash.js:135:53)
          at NormalModule._initBuildHash (/tmp/pip-req-build-j6n2hs2k/js/node_modules/webpack/lib/NormalModule.js:417:16)
          at handleParseError (/tmp/pip-req-build-j6n2hs2k/js/node_modules/webpack/lib/NormalModule.js:471:10)
          at /tmp/pip-req-build-j6n2hs2k/js/node_modules/webpack/lib/NormalModule.js:503:5
          at /tmp/pip-req-build-j6n2hs2k/js/node_modules/webpack/lib/NormalModule.js:358:12
          at /tmp/pip-req-build-j6n2hs2k/js/node_modules/loader-runner/lib/LoaderRunner.js:373:3
          at iterateNormalLoaders (/tmp/pip-req-build-j6n2hs2k/js/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
          at Array.<anonymous> (/tmp/pip-req-build-j6n2hs2k/js/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
          at Storage.finished (/tmp/pip-req-build-j6n2hs2k/js/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
          at /tmp/pip-req-build-j6n2hs2k/js/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
          at /tmp/pip-req-build-j6n2hs2k/js/node_modules/graceful-fs/graceful-fs.js:123:16
          at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:[68](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:69):3) {
        opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
        library: 'digital envelope routines',
        reason: 'unsupported',
        code: 'ERR_OSSL_EVP_UNSUPPORTED'
      }

      Node.js v18.14.1
      npm ERR! code 1
      npm ERR! path /tmp/pip-req-build-j6n2hs2k/js
      npm ERR! command failed
      npm ERR! command sh -c npm run build

      npm ERR! A complete log of this run can be found in:
      npm ERR!     /home/runner/.npm/_logs/2023-02-22T22_38_54_641Z-debug-0.log
      Traceback (most recent call last):
        File "/home/runner/work/jdaviz/jdaviz/.tox/py311-test-devdeps/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/runner/work/jdaviz/jdaviz/.tox/py311-test-devdeps/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/jdaviz/jdaviz/.tox/py311-test-devdeps/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 413, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 46, in <module>
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 9[69](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:70), in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/jupyter_packaging/setupbase.py", line 503, in run
          [self.run_command(cmd) for cmd in cmds]
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/jupyter_packaging/setupbase.py", line 503, in <listcomp>
          [self.run_command(cmd) for cmd in cmds]
           ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/jupyter_packaging/setupbase.py", line 2[74](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:75), in run
          c.run()
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/jupyter_packaging/setupbase.py", line 3[79](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:80), in run
          run(npm_cmd + ['install'], cwd=node_package)
        File "/tmp/pip-build-env-3dmpta49/overlay/lib/python3.11/site-packages/jupyter_packaging/setupbase.py", line [225](https://github.com/spacetelescope/jdaviz/actions/runs/4247392893/jobs/7385696133#step:5:226), in run
          return subprocess.check_call(cmd, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/local/bin/npm', 'install']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bqplot-image-gl
mariobuikhuizen commented 1 year ago

This is an issue with newer versions of nodejs, you can use export NODE_OPTIONS=--openssl-legacy-provider in the terminal of Linux or MacOS to work around this.

pllim commented 1 year ago

Thanks!