alina 🌸
alina 🌸•3w ago

any way to skip setting up binaries?

im building a deno project with nix, and since some recent version (problem arised when i bumped nixpkgs) i started getting this error:
error: builder for '/nix/store/b9l6jmzyp52wfscr870znpdx19lpr93k-gitea-catppuccin.drv' failed with exit code 1;
last 25 log lines:
> Initialize sass@1.86.3
> Initialize ajv@8.17.1
> Initialize @parcel/watcher@2.5.1
> Initialize chokidar@4.0.3
> Initialize immutable@5.1.1
> Initialize source-map-js@1.2.1
> Initialize fast-uri@3.0.6
> Initialize json-schema-traverse@1.0.0
> Initialize fast-deep-equal@3.1.3
> Initialize require-from-string@2.0.2
> Initialize @parcel/watcher-linux-x64-musl@2.5.1
> Initialize detect-libc@1.0.3
> Initialize node-addon-api@7.1.1
> Initialize @parcel/watcher-linux-x64-glibc@2.5.1
> Initialize micromatch@4.0.8
> Initialize is-glob@4.0.3
> Initialize readdirp@4.1.2
> Initialize picomatch@2.3.1
> Initialize braces@3.0.3
> Initialize is-extglob@2.1.1
> Initialize fill-range@7.1.1
> Initialize to-regex-range@5.0.1
> Initialize is-number@7.0.0
> error: Can't set up 'detect-libc' bin at /build/source/node_modules/.deno/detect-libc@1.0.3/node_modules/detect-libc/./bin/detect-libc.js
> 0: Permission denied (os error 13)
For full logs, run:
nix log /nix/store/b9l6jmzyp52wfscr870znpdx19lpr93k-gitea-catppuccin.drv
error: builder for '/nix/store/b9l6jmzyp52wfscr870znpdx19lpr93k-gitea-catppuccin.drv' failed with exit code 1;
last 25 log lines:
> Initialize sass@1.86.3
> Initialize ajv@8.17.1
> Initialize @parcel/watcher@2.5.1
> Initialize chokidar@4.0.3
> Initialize immutable@5.1.1
> Initialize source-map-js@1.2.1
> Initialize fast-uri@3.0.6
> Initialize json-schema-traverse@1.0.0
> Initialize fast-deep-equal@3.1.3
> Initialize require-from-string@2.0.2
> Initialize @parcel/watcher-linux-x64-musl@2.5.1
> Initialize detect-libc@1.0.3
> Initialize node-addon-api@7.1.1
> Initialize @parcel/watcher-linux-x64-glibc@2.5.1
> Initialize micromatch@4.0.8
> Initialize is-glob@4.0.3
> Initialize readdirp@4.1.2
> Initialize picomatch@2.3.1
> Initialize braces@3.0.3
> Initialize is-extglob@2.1.1
> Initialize fill-range@7.1.1
> Initialize to-regex-range@5.0.1
> Initialize is-number@7.0.0
> error: Can't set up 'detect-libc' bin at /build/source/node_modules/.deno/detect-libc@1.0.3/node_modules/detect-libc/./bin/detect-libc.js
> 0: Permission denied (os error 13)
For full logs, run:
nix log /nix/store/b9l6jmzyp52wfscr870znpdx19lpr93k-gitea-catppuccin.drv
4 Replies
alina 🌸
alina 🌸OP•3w ago
i build it like this:
let
version = "1.0.2";
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "gitea";
rev = "v${version}";
sha256 = "sha256-zoWKyCIhTKqR4u13QRCIJwOrU4irfVcoWteKQxsbFP8=";
};

deps = pkgs.stdenvNoCC.mkDerivation {
name = "gitea-catppuccin-deps";
inherit version src;

buildInputs = [ pkgs.deno ];

outputHashMode = "recursive";
outputHash = "sha256-C/9UgTRSp7kn0f9yEyP0TZ9Tvh6rbzHxmed4Z/yuUws=";

buildPhase = ''
mkdir -p $out
DENO_DIR=$out deno cache build.ts
'';
};
in
pkgs.stdenvNoCC.mkDerivation {
name = "gitea-catppuccin";
inherit version src;

buildInputs = [
pkgs.deno
];
buildPhase = ''
DENO_DIR=${deps} deno -A --cached-only build.ts
'';

installPhase = ''
mkdir -p $out
cp -r dist/* $out
'';
}
let
version = "1.0.2";
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "gitea";
rev = "v${version}";
sha256 = "sha256-zoWKyCIhTKqR4u13QRCIJwOrU4irfVcoWteKQxsbFP8=";
};

deps = pkgs.stdenvNoCC.mkDerivation {
name = "gitea-catppuccin-deps";
inherit version src;

buildInputs = [ pkgs.deno ];

outputHashMode = "recursive";
outputHash = "sha256-C/9UgTRSp7kn0f9yEyP0TZ9Tvh6rbzHxmed4Z/yuUws=";

buildPhase = ''
mkdir -p $out
DENO_DIR=$out deno cache build.ts
'';
};
in
pkgs.stdenvNoCC.mkDerivation {
name = "gitea-catppuccin";
inherit version src;

buildInputs = [
pkgs.deno
];
buildPhase = ''
DENO_DIR=${deps} deno -A --cached-only build.ts
'';

installPhase = ''
mkdir -p $out
cp -r dist/* $out
'';
}
the related strace output is:
openat(AT_FDCWD, "/build/source/node_modules/.deno/detect-libc@1.0.3/node_modules/detect-libc/./bin/detect-libc.js", O_RDWR|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/build/source/node_modules/.deno/detect-libc@1.0.3/node_modules/detect-libc/./bin/detect-libc.js", O_RDWR|O_CLOEXEC) = -1 EACCES (Permission denied)
considering this file is symlinked directly from nix store and deno tries to open it with O_RDWR, no wonder it fails. my current workaround is copying deps into a temporary writable directory before invoking deno:
buildPhase = ''
cp -r ${deps} ./deno-cache
chmod -R u+w ./deno-cache
DENO_DIR=./deno-cache deno -A --cached-only build.ts
'';
buildPhase = ''
cp -r ${deps} ./deno-cache
chmod -R u+w ./deno-cache
DENO_DIR=./deno-cache deno -A --cached-only build.ts
'';
but i feel like deno shouldn't try writing into DENO_DIR when i have the --cached-only flag set this is probably a regression, since the same derivation used to work under deno 2.2.2 (nixpkgs rev 199169a2135e6b864a888e89a2ace345703c025d) (now im using nixpkgs rev 64c8b7cef830215d12c06384b596ae274aa1eca5, deno 2.4.2)
marvinh.
marvinh.•3w ago
Can you file an issue on https://github.com/denoland/deno/issues ? That's always the best course of actions for posting bugs. That place is where the folks working on Deno itself hang out.
alina 🌸
alina 🌸OP•3w ago
yeah im just not sure if this is a bug or a feature thus asking here :D
jeff.hykin
jeff.hykin•2w ago
Just FYI, sadly I think all nix support for Deno is unofficial. As a fellow nix user tho I'd love a --please-dont-modify-anything-on-disk-fr-fr-please option

Did you find this page helpful?