pip install failed: js contenthash changed
dylex opened this issue · comments
Apologies in advace -- this may well not be a ipyparallel bug, but some incompatibility with dependency versions or a bug in jupyterlab/builder or in spack or something else, but I'm a bit stuck.
Trying to pip install ipyparallel (via spack), using the .tar.gz source distribution (of 8.2.0, same issue with 8.0.0). During the wheel build it runs jlpm build:prod, which runs jupyter labextension build and webpack, which ends up regenerating the assets with different content hashes (i.e., file names). Since the data files were collected in setup.py before this, it is then unable the find the old names by the time it gets to installing them, and fails.
Is it expected that it should regenerate these files? Why would the contenthash change if nothing else has? Does the content depend on other npm package versions which have to match? Partial logs below.
==> [2022-03-23-15:25:23.171636] '/mnt/sw/nix/store/8ipsqq6nvyrb6024cp73g31p46aizkrz-python-3.9.10/bin/python3.9' '-m' 'pip' '-vvv' '--no-input' '--no-cache-dir' '--disable-pip-version-check' 'install' '--no-deps' '--ignore-installed' '--no-build-isolation' '--no-warn-script-location' '--no-index' '--prefix=/mnt/sw/nix/store/2gnb08x477c
45sirniiv5wcssxbb7dc8-py-ipyparallel-8.2.0' '.'
Using pip 21.3.1 from /mnt/sw/nix/store/8g645mwxxrpwanzaq3xnavv5ismjqhnj-py-pip-21.3.1/lib/python3.9/site-packages/pip (python 3.9)
Non-user install due to --prefix or --target option
... (snip) ...
running bdist_wheel
running pre_dist
Installing build dependencies with npm. This may take a while...
> jlpm install
yarn install v1.21.1
info No lockfile found.
[1/4] Resolving packages...
warning @jupyterlab/application > @jupyterlab/apputils > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @jupyterlab/application > @jupyterlab/ui-components > @blueprintjs/core > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning @jupyterlab/application > @jupyterlab/ui-components > @blueprintjs/core > react-popper > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning @jupyterlab/builder > @jupyterlab/buildutils > 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.
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > @verdaccio/readme > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > request > har-validator@5.1.5: this library is no longer supported
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > @verdaccio/readme > jsdom > request > har-validator@5.1.5: this library is no longer supported
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > request > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > @verdaccio/readme > jsdom > request > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning @jupyterlab/builder > @jupyterlab/buildutils > verdaccio > @verdaccio/readme > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning mocha > debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning mocha > mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
[2/4] Fetching packages...
warning @blueprintjs/core@3.54.0: Invalid bin entry for "upgrade-blueprint-2.0.0-rename" (in "@blueprintjs/core").
warning @blueprintjs/core@3.54.0: Invalid bin entry for "upgrade-blueprint-3.0.0-rename" (in "@blueprintjs/core").
[3/4] Linking dependencies...
warning " > @lumino/coreutils@1.12.0" has unmet peer dependency "crypto@1.0.1".
warning "@jupyterlab/builder > @jupyterlab/buildutils > verdaccio > clipanion@3.1.0" has unmet peer dependency "typanion@*".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
success Saved lockfile.
Done in 28.56s.
> jlpm run build:prod
yarn run v1.21.1
$ jlpm run build:lib && jlpm run build:labextension
$ tsc
$ jupyter labextension build .
Building extension in .
Compilation starting�
Compilation finished
asset 592.091cccee73d6f860058d.js?v=091cccee73d6f860058d 24.9 KiB [emitted] [immutable] [minimized]
asset 114.4bf63cfcb3dbce9ca76f.js?v=4bf63cfcb3dbce9ca76f 8.38 KiB [emitted] [immutable] [minimized] (id hint: vendors)
asset remoteEntry.25b6321c1b0524794234.js 7.57 KiB [emitted] [immutable] [minimized] (name: ipyparallel-labextension)
asset third-party-licenses.json 2.53 KiB [emitted]
runtime modules 19.5 KiB 12 modules
orphan modules 26.5 KiB [orphan] 6 modules
built modules 756 bytes (consume-shared) 79.6 KiB (javascript) 84 bytes (share-init) [built]
consume-shared-module modules 756 bytes
modules by path consume shared module (default) @jupyterlab/*.9 (singleton) 378 bytes 9 modules
modules by path consume shared module (default) @lumino/ 294 bytes 7 modules
modules by path *.1 (singleton) 84 bytes 2 modules
javascript modules 79.6 KiB
modules by path ./lab/ 46.9 KiB 4 modules
modules by path ./node_modules/ 32.7 KiB 4 modules
container entry 42 bytes [built] [code generated]
provide-module modules 84 bytes
provide shared module (default) @lumino/polling@1.10.0 = ./node_modules/@lumino/polling/dist/index.es6.js 42 bytes [built] [code generated]
provide shared module (default) ipyparallel-labextension@8.2.0 = ./lab/lib/index.js 42 bytes [built] [code generated]
WARNING in license-webpack-plugin: could not find any license file for @lumino/polling. Use the licenseTextOverrides option to add the license text if desired.
webpack 5.70.0 compiled with 1 warning in 893 ms
Done in 14.44s.
...
running install_data
...
creating build/bdist.linux-x86_64/wheel/ipyparallel-8.2.0.data/data/share/jupyter/labextensions/ipyparallel-labextension/static
error: can't copy 'ipyparallel/labextension/static/remoteEntry.34efbd5c8b146e4195cf.js': doesn't exist or not a regular file
Building wheel for ipyparallel (pyproject.toml): finished with status 'error'
ERROR: Failed building wheel for ipyparallel
I think the simplest workaround is to set IPP_DISABLE_JS=1
to skip the js installation steps, and it will install what's already in the sdist rather than rebuilding it.
I suppose it is an error in ipyparallel's setup.py, in that we build the data_files manifest based on present files, but then regenerate new ones without regenerating the data_files list. It should do that, at least. I think it's a little odd to reject a wheel and then build a new one prior to installing, but I guess building wheels as part of installation is no longer optional. The logic we have is based on my now-outdated expectation that install from sdist does 'install' while building a wheel is mostly part of making a release. Now that building a wheel is an unskippable part of installing from an sdist, I need to update the logic for when regenerating js is skipped.