lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
richiardiandrea 2018-04-06T00:43:50.000102Z

has anybody found that installing lumo on CI fails with:

npm install -g lumo-cljs --unsafe-perm
/bin/bash --noprofile --norc /opt/vsts/work/_temp/f61d6d50-8a9a-464b-b529-5b4562787990.sh
/usr/local/bin/lumo -> /usr/local/lib/node_modules/lumo-cljs/bin/lumo.js
> lumo-cljs@1.8.0 install /usr/local/lib/node_modules/lumo-cljs
> node scripts/npm_install.js || nodejs scripts/npm_install.js
/usr/local/lib/node_modules/lumo-cljs/node_modules/jszip/lib/zipEntries.js:176
                throw new Error("Corrupted zip : can't find end of central directory");
                ^
Error: Corrupted zip : can't find end of central directory
    at ZipEntries.readEndOfCentral (/usr/local/lib/node_modules/lumo-cljs/node_modules/jszip/lib/zipEntries.js:176:23)
    at ZipEntries.load (/usr/local/lib/node_modules/lumo-cljs/node_modules/jszip/lib/zipEntries.js:274:14)
    at new ZipEntries (/usr/local/lib/node_modules/lumo-cljs/node_modules/jszip/lib/zipEntries.js:22:14)
    at JSZip.module.exports [as load] (/usr/local/lib/node_modules/lumo-cljs/node_modules/jszip/lib/load.js:19:18)
    at Request.<anonymous> (/usr/local/lib/node_modules/lumo-cljs/scripts/npm_install.js:65:28)
    at emitOne (events.js:121:20)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/lumo-cljs/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
?

richiardiandrea 2018-04-06T19:30:49.000080Z

@anmonteiro any hint on the above? our CI is failing 50% of the times

richiardiandrea 2018-04-06T19:34:57.000527Z

it looks like there is a fix with the new JSZip

richiardiandrea 2018-04-06T19:34:59.000113Z

https://github.com/Stuk/jszip/issues/26

anmonteiro 2018-04-06T19:47:38.000284Z

@richiardiandrea you can’t upgrade JSZip to the latest version

anmonteiro 2018-04-06T19:47:54.000072Z

definitely not v3 at least

anmonteiro 2018-04-06T19:48:00.000315Z

they removed the sync methods

anmonteiro 2018-04-06T19:48:06.000025Z

we’re not using the async API

richiardiandrea 2018-04-06T19:48:16.000549Z

oh...I see

richiardiandrea 2018-04-06T19:49:00.000137Z

let me fetch the release that includes the fix

richiardiandrea 2018-04-06T19:50:25.000395Z

uhm weird, it says it should be included in 2.6.1 already

anmonteiro 2018-04-06T19:53:47.000433Z

then it might not be the same bug

richiardiandrea 2018-04-06T19:57:05.000139Z

well it says it happens for large files...that is why I thought about it, lumo now is 66MB...maybe we should drop it only in npm_install? find something more reliable?

richiardiandrea 2018-04-06T20:00:23.000140Z

in there you are actually using the async api only, I guess the sync one is used inside the repl?

anmonteiro 2018-04-06T20:00:24.000457Z

@richiardiandrea definitely

richiardiandrea 2018-04-06T20:00:29.000419Z

kk

anmonteiro 2018-04-06T20:00:39.000055Z

if you find a better Zip library let me know

anmonteiro 2018-04-06T20:00:51.000118Z

I wasn’t able to get one a couple years ago when doing Lumo at first

richiardiandrea 2018-04-06T20:01:11.000702Z

I will try to find it 😉

richiardiandrea 2018-04-06T20:02:56.000003Z

@anmonteiro Latest node supports gzip: https://nodejs.org/api/zlib.html

richiardiandrea 2018-04-06T20:03:31.000608Z

seems pretty low level tdough

anmonteiro 2018-04-06T20:03:41.000174Z

we use zlib for gzip already

anmonteiro 2018-04-06T20:04:00.000160Z

AFAIK it doesn’t support zip archives

richiardiandrea 2018-04-06T20:05:07.000188Z

do we need to have a zip there? can it be a tar?

anmonteiro 2018-04-06T20:05:24.000009Z

sorry I don’t follow

anmonteiro 2018-04-06T20:05:36.000645Z

we use JSZip to unzip .jar archives in Lumo

richiardiandrea 2018-04-06T20:05:47.000334Z

yep no that's fine sorry

richiardiandrea 2018-04-06T20:05:57.000094Z

npm_install.js is what is failing

richiardiandrea 2018-04-06T20:06:20.000329Z

so I assume it is using JSZip because the CIs build zip files only?

richiardiandrea 2018-04-06T20:07:08.000015Z

oh i see

richiardiandrea 2018-04-06T20:07:17.000336Z

so that gzip contains jars

richiardiandrea 2018-04-06T20:09:00.000142Z

mmmm, no I have just downloaded it 😄

richiardiandrea 2018-04-06T20:10:10.000371Z

very nice comparison here: https://nervous.io/node/javascript/2017/02/06/npm-unzip/

richiardiandrea 2018-04-06T20:43:38.000535Z

@anmonteiro https://github.com/anmonteiro/lumo/pull/383 will try it on Windows as well as Mac, we have many folks using lumo here 😄

anmonteiro 2018-04-06T20:48:21.000031Z

@richiardiandrea looks like that will just fail

anmonteiro 2018-04-06T20:48:32.000011Z

you didn’t add the dependency under packages/lumo/package.json

richiardiandrea 2018-04-06T20:49:40.000172Z

Uhm no?

richiardiandrea 2018-04-06T20:51:09.000053Z

Oh sorry will do

richiardiandrea 2018-04-06T20:52:43.000217Z

@anmonteiro thanks done

anmonteiro 2018-04-06T20:53:20.000151Z

@richiardiandrea can you revert the yarn.lock changes please

👍 1
richiardiandrea 2018-04-06T20:53:34.000183Z

sure maaan 😉

anmonteiro 2018-04-06T20:53:34.000614Z

did you test the script?

richiardiandrea 2018-04-06T20:53:38.000001Z

yep

anmonteiro 2018-04-06T20:53:39.000241Z

i.e. with npm install .

richiardiandrea 2018-04-06T20:57:23.000054Z

looks good:

~/tmp/lumo-asrasr$ ll node_modules/lumo/bin/lumo 
-rwxr-xr-x 1 arichiardi arichiardi 65472307 Apr  6 13:47 node_modules/lumo/bin/lumo*

richiardiandrea 2018-04-06T20:57:30.000429Z

I asked a colleague to try on win and mac

anmonteiro 2018-04-06T20:57:48.000060Z

thanks

richiardiandrea 2018-04-06T21:43:23.000337Z

looks like we can install on Mac, windows has some problem from the bash emulator

richiardiandrea 2018-04-06T21:43:32.000405Z

seems unrelated to the change

richiardiandrea 2018-04-06T21:45:10.000022Z

we are trying on a normal terminal

richiardiandrea 2018-04-06T22:00:55.000474Z

seems like a Windows weirdness when npm installing \some\folder so I would say all good