GoogleChromeLabs/jsvu

QuickJS now has win32, win64, linux32 and linux64 binaries

bellard opened this issue · 7 comments

QuickJS now has win32, win64, linux32 and linux64 binaries

Thanks for the heads up! Will make the changes.

URLs: https://bellard.org/quickjs/binary_releases/?C=M;O=D

@mathiasbynens When I install quickjs in windows,I get error as follow:

✔ Found latest QuickJS version: v2021-03-27.
✔ URL: https://bellard.org/quickjs/binary_releases/quickjs-win-x86_64-2021-03-27.zip
✔ Download completed.
❯ Extracting…
✔ Extraction completed.
❯ Testing…
✖ Error: Command failed with exit code 2 (ENOENT): C:\Users\licheng/.jsvu/quickjs C:\Users\licheng\AppData\Local\Temp\7f89afc0c281b62e4f8fb296f5396916
spawn C:\Users\licheng/.jsvu/quickjs ENOENT

This error seem like jsvu not create quickjs.cmd. I have checked code in quickjs/extract.js,I find this code not use 'win64' in case statement, maybe this code is not correct?

switch (os) {
case 'linux64': {
installer.installBinary({ 'qjs': binary });
break;
}

@muzinian Could you send a patch? Thanks!

@mathiasbynens I'm so sorry .I can only read some javascript code.Sending a patch is beyond my power.

@muzinian Could you send a patch? Thanks!

The problem is the current code did not install correctly or completely. Maybe we can borrow some code from xs

const extract = ({ filePath, binary, os }) => {
return new Promise(async (resolve, reject) => {
const tmpPath = path.dirname(filePath);
await unzip({
from: filePath,
to: tmpPath,
});
const installer = new Installer({
engine: binary,
path: tmpPath,
});
switch (os) {
case 'linux64': {
installer.installBinary({ 'qjs': binary });
break;
}
}
resolve();
});
};

const extract = ({ filePath, binary, os }) => {
return new Promise(async (resolve, reject) => {
const tmpPath = path.dirname(filePath);
await unzip({
from: filePath,
to: tmpPath,
});
const installer = new Installer({
engine: binary,
path: tmpPath,
});
if (os.startsWith('win')) {
installer.installBinary(
{ 'xst.exe': `${binary}.exe` },
{ symlink: false }
);
installer.installScript({
name: `${binary}.cmd`,
generateScript: (targetPath) => {
return `
@echo off
"${targetPath}\\${binary}.exe" %*
`;
}
});
} else {
installer.installBinary({ 'xst': binary }, { symlink: true });
}
resolve();
});
};

I changed some code, it seemed to work as expected.
image

saghul commented

@mathiasbynens I guess this one can be closed now.