pyodide-kernel icon indicating copy to clipboard operation
pyodide-kernel copied to clipboard

Can't run `npm run quickstart` on main branch -> lerna bootstrap was removed in v7

Open jonas-w opened this issue 2 years ago • 6 comments
trafficstars

Description

Running npm run quickstart in a new environment, yields the following error

ERR! bootstrap The "bootstrap" command was removed by default in v7, and is no longer maintained.
ERR! bootstrap Learn more about this change at https://lerna.js.org/docs/legacy-package-management

Reproduce

  1. run npm run quickstart

Expected behavior

Build the repo.

Context

  • JupyterLite version: 0.2.0a1 ?
  • Operating System and version: ArchLinux
  • Browser and version: irrelevant

jonas-w avatar Sep 26 '23 12:09 jonas-w

Thanks @jonas-w for reporting.

Looks like Lerna was updated to version 7 in https://github.com/jupyterlite/pyodide-kernel/pull/58.

Maybe we can just remove the bootstrap script. Would you like to open a PR? Thanks!

jtpio avatar Sep 26 '23 12:09 jtpio

@jtpio I'm not really adapt with node/yarn/... but I tried something locally, and it seems like to do the same stuff as lerna bootstrap/lerna run, one would need to use yarn >2, which changes many things. I could publish my current state, but I don't know if this is really what you wanted.

jonas-w avatar Sep 26 '23 15:09 jonas-w

would need to use yarn >2

Right, this should already be the case as the repo is now using jlpm which is a pinned version of Yarn 3 provided by JupyterLab.

So opening a PR that removes this line might be enough:

https://github.com/jupyterlite/pyodide-kernel/blob/9e98597d6cdc1c4787ed0c8fcdeac0044fb78561/package.json#L11

jtpio avatar Sep 26 '23 15:09 jtpio

@jtpio thanks now it makes sense, but when I removed just that line the build scripts in the package subdirectory used the wrong python executable while the scripts in the root package.json used the correct python executable, I'm using a mamba/conda environment. That's why I tried using the yarn workspaces plugins for the lerna run commands, but this showed dependency errors with typescript and ts-jest.

EDIT: just checked, lerna also used the wrong python executable previously, don't know why I didn't have this error previously. lerna prepends /usr/bin in front of my PATH variables (and many other paths, but /usr/bin creates the problem).

EDIT2: Okay, previously I had a different work machine, which hadn't python in /usr/bin that's why this never happened until now. Is there an easy way to use the correct python executable other than ditching lerna completely?

jonas-w avatar Sep 26 '23 17:09 jonas-w

I find the same problem but not the same error,

I agree that bootstrap can be removed thus appending https://github.com/jupyterlite/pyodide-kernel/blob/1bf33bf6e0c1f7d2853f128e0207f3607a65f119/package.json#L11 https://github.com/jupyterlite/pyodide-kernel/blob/1bf33bf6e0c1f7d2853f128e0207f3607a65f119/package.json#L42

But I have tried a few items before that, it appe

Build windows with conda env

jlpm clean:all error involved in the quickstart command. It was regarding removal of particular file in the .cache folder

Building from a docker container Ubuntu

Firstly, I noticed that the readme has https://github.com/jupyterlite/pyodide-kernel/blob/1bf33bf6e0c1f7d2853f128e0207f3607a65f119/README.md?plain=1#L130-L132

Whereas the contributing has https://github.com/jupyterlite/pyodide-kernel/blob/1bf33bf6e0c1f7d2853f128e0207f3607a65f119/CONTRIBUTING.md?plain=1#L17-L21

Using the container, which had git, conda, I tested in either nodejs versions but appear to be stuck with errors involving the packages such as I individually ran each jlpm ... command in quickstart

(base) root@590fa2df78c0:/code# jlpm build:prod
lerna notice cli v7.3.0
lerna info versioning independent

 >  Lerna (powered by Nx)   Running target build:prod for 2 projects and 1 task they depend on:

    - @jupyterlite/pyodide-kernel
    - @jupyterlite/pyodide-kernel-extension

> @jupyterlite/pyodide-kernel:"build:py"

@jupyterlite/pyodide-kernel: fatal: not a git repository: /code/../.git/modules/pyodide-kernel
@jupyterlite/pyodide-kernel: Traceback (most recent call last):
@jupyterlite/pyodide-kernel:   File "/code/packages/pyodide-kernel/scripts/generate-wheels-js.py", line 32, in <module> 
@jupyterlite/pyodide-kernel:     subprocess.check_output([which("git"), "log", "-1", "--format=%ct"])
@jupyterlite/pyodide-kernel:   File "/root/miniconda3/lib/python3.11/subprocess.py", line 466, in check_output
@jupyterlite/pyodide-kernel:     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
@jupyterlite/pyodide-kernel:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@jupyterlite/pyodide-kernel:   File "/root/miniconda3/lib/python3.11/subprocess.py", line 571, in run
@jupyterlite/pyodide-kernel:     raise CalledProcessError(retcode, process.args,
@jupyterlite/pyodide-kernel: subprocess.CalledProcessError: Command '['/usr/bin/git', 'log', '-1', '--format=%ct']' returned non-zero exit status 128.

 >  Lerna (powered by Nx)   Running target build:prod for 2 projects and 1 task they depend on failed

   Tasks not run because their dependencies failed or --nx-bail=true:

   - @jupyterlite/pyodide-kernel:build:prod
   - @jupyterlite/pyodide-kernel-extension:build:prod

   Failed tasks:

   - @jupyterlite/pyodide-kernel:build:py

So It seems that the packages aren't built so I tried building them individually but I get the following set of errors

(base) root@590fa2df78c0:/code/packages/pyodide-kernel# jlpm build
src/kernel.ts:12:45 - error TS2307: Cannot find module './_pypi' or its corresponding type declarations.

12 import { allJSONUrl, pipliteWheelUrl } from './_pypi';
                                               ~~~~~~~~~

src/index.ts:4:15 - error TS2307: Cannot find module './_pypi' or its corresponding type declarations.

4 export * from './_pypi';
                ~~~~~~~~~


Found 2 errors.

savakarrohan avatar Oct 02 '23 11:10 savakarrohan

My error was related to the .git folder not moving in to the docker container And the windows path being too long,

savakarrohan avatar Oct 02 '23 12:10 savakarrohan