dsfsa
November 14, 2022, 2:54pm
1
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: A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.
The environment I used to build:
git clone --recurse-submodules git@github.com :siyuan-note/siyuan.git
git checkout v2.4.12
./scripts/linux-build.sh
https://github.com/siyuan-note/siyuan/blob/34b49fe7ded987cac3bab8a7c588eac9f18778fa/scripts/linux-build.sh
nixos: NixOS 22.11
with flake nixos-unstable pkgs
TLATER
November 14, 2022, 2:59pm
2
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?
TLATER
November 15, 2022, 10:24am
4
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.
TLATER
November 15, 2022, 2:54pm
6
Oh, huh, you’re right. Strange, an ldd of the binary might help figure out what’s wrong then.