Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esy install: Cannot read property 'length' of undefined (Ubuntu) #21

Closed
IwanKaramazow opened this issue Nov 2, 2017 · 5 comments
Closed
Labels

Comments

@IwanKaramazow
Copy link

Steps to reproduce:

git clone https://github.com/iwankaramazow/track
cd track
docker build -t track .
docker run -it track
esy install

captura de pantalla 2017-11-02 a las 20 12 07

The dockerfile starts with the base ubuntu:17.10 image, installs node & esy.
As soon as I run esy install in the dockercontainer (e.g. on a ci), node crashes with

  TypeError: Cannot read property 'length' of undefined
      at Object.add_string (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:44669:15)
      at strput_acc (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:52981:25)
      at strput_acc (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:52983:11)
      at Object.strput_acc (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:52980:11)
      at k$prime (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:64574:24)
      at Object._2 (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:56228:12)
      at make_printf (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:52214:20)
      at /usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:52707:20
      at app (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:56125:16)
      at curry_2 (/usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-opam/dist/esy-opam.js:56197:18)

The stack trace & other logs can be found at
https://gist.github.com/IwanKaramazow/a00d813c9f4f9b6e7f8864aa37f1c972

The ubuntu-container probably misses some utility. What kind of tools are missing? Can we throw a warning if they aren't installed? Is that tool windows-proof?

@andreypopp
Copy link
Member

Traceback originates from BS compiled esy-opam package.

@andreypopp
Copy link
Member

UnixNode.getlogin returns undefined for root.

@andreypopp andreypopp added the bug label Nov 6, 2017
@andreypopp
Copy link
Member

Fixed in esy@0.0.30 it can be installed as npm i -g esy@next at this time.

Also your Dockerfile seems to be missing apt-get install xz-utils.

@andreypopp
Copy link
Member

Btw. apt-get install bzip2 is also missing from the Dockerfile. Currently we spawn tar process in esy-install as npm packages for tar/gzip/bzip2 weren't able all the variety of tarballs we have on opam. I

Regarding the docker workflow — don't you think that it's better to ship a preinstalled node_modules in docker image so you don't have to run installation in it? As I understand docker workflow is made for cross compilation here?

@IwanKaramazow
Copy link
Author

Thanks for the quick fix!

don't you think that it's better to ship a preinstalled node_modules in docker image so you don't have to run installation in it
but I probably cannot ship a preinstalled node_modules from my mac to a linux docker container?I'm using docker for cross compilation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants