Open rnbguy opened 4 months ago
@rnbguy may I know the platform you're encoutering the issue on? The script works fine with Deno 1.44.4
on macOS
➜ 24314 deno --version
deno 1.44.4 (release, aarch64-apple-darwin)
v8 12.6.228.9
typescript 5.4.5
➜ 24314 cat a.ts
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: a.ts
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ import * as tar from "npm:tar@7.4.0";
2 │ import { pipeline } from "node:stream/promises";
3 │
4 │ await fetch(
5 │ "https://github.com/informalsystems/apalache/releases/download/v0.44.11/apalache.tgz",
6 │ ).then((resp) =>
7 │ pipeline(
8 │ resp.body,
9 │ tar.extract({ cwd: ".", strict: true }),
10 │ )
11 │ );
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜ 24314 deno run -A a.ts
➜ 24314 ls -lR apalache
total 24
-rw-r--r-- 1 sr staff 11945 May 6 18:07 LICENSE
drwxr-xr-x 3 sr staff 96 Jun 24 12:10 bin
drwxr-xr-x 3 sr staff 96 Jun 24 12:10 lib
apalache/bin:
total 8
-rwxr-xr-x 1 sr staff 1945 May 6 18:07 apalache-mc
apalache/lib:
total 230920
-rw-r--r-- 1 sr staff 104008305 May 6 18:07 apalache.jar
I am on Linux.
I just realized, this works fine on my personal Arch Linux computer. But fails on docker images. I tried:
alpine
, debian
, ubuntu
tags for denoland/deno
image.archlinux
image with pacman -S deno
(same setup as my personal computer).It looks like it might be something with root
user. The following works fine:
$ docker run --user=deno --workdir=/home/deno denoland/deno:alpine eval '
import * as tar from "npm:tar@7.4.0";
import { pipeline } from "node:stream/promises";
await fetch(
"https://github.com/informalsystems/apalache/releases/download/v0.44.11/apalache.tgz",
).then((resp) =>
pipeline(
resp.body,
tar.extract({ cwd: ".", strict: true }),
)
);
'
If you remove --user=deno
or --workdir=/home/deno
, the command fails.
Same here when installing the NPM Package cpu-features with deno version 2.0.3.
My Full Stacktrace:
Initialize cpu-features@0.0.2: running 'install' script
error: script 'install' in 'cpu-features@0.0.2' failed with exit code 7
stderr:
gyp info it worked if it ends with ok
gyp info using node-gyp@10.2.0
gyp info using node@20.11.1 | linux | x64
gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v20.11.1/node-v20.11.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v20.11.1/node-v20.11.1-headers.tar.gz
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: fs.fchown is not a function
gyp ERR! stack at WriteStream.<anonymous> (file:///home/container/node_modules/.deno/tar@6.2.1/node_modules/tar/lib/unpack.js:482:12)
gyp ERR! stack at WriteStream.emit (ext:deno_node/_events.mjs:393:28
gyp ERR! stack at WriteStream.emit (file:///home/container/node_modules/.deno/fs-minipass@2.1.0/node_modules/fs-minipass/index.js:257:18)
gyp ERR! stack at WriteStream.[_onwrite] (file:///home/container/node_modules/.deno/fs-minipass@2.1.0/node_modules/fs-minipass/index.js:342:16)
gyp ERR! stack at file:///home/container/node_modules/.deno/fs-minipass@2.1.0/node_modules/fs-minipass/index.js:325:21
gyp ERR! stack at ext:deno_node/_fs/_fs_write.mjs:102:9
gyp ERR! stack at eventLoopTick (ext:core/01_core.js:175:7)
gyp ERR! System Linux ***** (Censored by me)
gyp ERR! command "node-gyp" "/home/container/node_modules/.deno/node-gyp@10.2.0/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/container/node_modules/.deno/cpu-features@0.0.2/node_modules/cpu-features
gyp ERR! node -v v20.11.1
gyp ERR! node-gyp -v v10.2.0
gyp ERR! Node-gyp failed to build your package.
gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
error: failed to run scripts for packages: cpu-features@0.0.2
Extracting using
tar
fails withfs.fchown is not a function
error.Reproducible steps:
The
apalache.tgz
's content permissions:Version: Deno 1.44.4