Unable to compile pnpm project under nix-shell

Unable to compile node/pnpm project under nixos nix-shell
with cmd : pnpm run dist-linux

i was compiled successfully on windows and wsl-ubuntu

my shell.nix:

Project Name:siyuan
Project Repo:GitHub - siyuan-note/siyuan: SiYuan is a local-first personal knowledge management system, supports fine-grained block-level reference, and Markdown WYSIWYG. 思源笔记是一款本地优先的个人知识管理系统, 支持细粒度块级引用和 Markdown 所见即所得。Roadmap https://github.com/orgs/siyuan-note/projects/1

The environment I used to build:
git clone --recurse-submodules git@github.com:siyuan-note/siyuan.git
git checkout v2.4.12
siyuan/linux-build.sh at 34b49fe7ded987cac3bab8a7c588eac9f18778fa · siyuan-note/siyuan · GitHub

nixos: NixOS 22.11
with flake nixos-unstable pkgs

According to your logs, the package vendors a copy of 7z. This will have an interpreter that is incompatible with nix’ fhs env.

You can patchelf that binary, it’s the one in comand= in your log.

Note that this is a very common problem when dealing with npm. Lots of people seem to think it’s ok to bundle random executables with their javascript.

See also Packaging/Binaries - NixOS Wiki

@TLATER Isn’t buildFhsUserEnv supposed to deal with such binaries?

It can as well. Harder to explain, though, and patchelf is probably sufficient for a one-off binary.

The correct fix is anyway to patch the build scripts to use nixpkgs’ 7z.

I was asking because the OP seems to say that they are using buildFhsUserEnv already, so I was expecting it to work without patch.

Oh, huh, you’re right. Strange, an ldd of the binary might help figure out what’s wrong then.