rivet-gg / rivet

🔩 Open-source solution to deploy, scale, and operate your multiplayer game
https://rivet.gg
Apache License 2.0
1.99k stars 45 forks source link

Shell.nix build fails on Darwin (macOS) - patchelf: command not found #590

Open MaxCWhitehead opened 5 months ago

MaxCWhitehead commented 5 months ago

Environment

Version/commit: [main branch dc6cd79d254b76d326e3a09215e6853ee40df12d]

MacOS Sonoma 14.2.1 - running shell-nix

Description

patchelf package appears to be missing for shell.nix build. I am assuming this is specific to me being on macOS.

nix-shell
these 9 derivations will be built:
  /nix/store/ixs6ywskdapv3jkr4ps2964799wgzaaw-rust-1.77.0-2024-03-17-aedd173a2.drv
  /nix/store/02aqixfvfqy7adfscrkhmqdig3hcpw02-posthog-core-0.1.0.drv
  /nix/store/0cix1w639bia055ihjlp2zvrzj17i9gs-auditable-rust-1.77.0-2024-03-17-aedd173a2.drv
  /nix/store/3z2824jizk8yh72028w04mpyiq10qgbr-async-posthog-0.2.3.drv
  /nix/store/j6sj0q9a28zj75sn72l9vadv6g71lxq6-cargo-build-hook.sh.drv
  /nix/store/l3l5crfzbcv1rsky373rvirpnp79sbq4-cargo-check-hook.sh.drv
  /nix/store/z27d9wp614x6mnwy5jn2aw5f2dqpcp5l-rivet-term-0.1.0.drv
  /nix/store/qfsi5im1wspn0761w9ln1b2jwv2lk7kg-cargo-vendor-dir.drv
  /nix/store/ddm5ls5k9n814nvz1b5b9cjfs9mcma97-bolt.drv
building '/nix/store/ixs6ywskdapv3jkr4ps2964799wgzaaw-rust-1.77.0-2024-03-17-aedd173a2.drv'...
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
/private/tmp/nix-build-rust-1.77.0-2024-03-17-aedd173a2.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 18: patchelf: command not found
realpath: missing operand
Try 'realpath --help' for more information.
error: builder for '/nix/store/ixs6ywskdapv3jkr4ps2964799wgzaaw-rust-1.77.0-2024-03-17-aedd173a2.drv' failed with exit code 1;
       last 10 log lines:

Steps to reproduce

  1. Clone rivet
  2. run nix-shell in project root
  3. Observe errors

Workarounds

Updating the version of mozilla overlay (updating pkgs) in nix/common/pkgs.nix seemed to resolve the issue. I am new to nix and not sure about the full implications of updating packages, or if this package should be directly included elsewhere somehow, but it seems to me this may be the right fix.

I can open a PR if desired, but I intend to just track the issue / inform y'all on issue, otherwise let me know if a PR would be appreciated.

linear[bot] commented 5 months ago

RVT-3695 Shell.nix build fails on Darwin (macOS) - patchelf: command not found

NathanFlurry commented 5 months ago

If you can make a PR that'd be helpful. Thank you!

See devcontainers workaround -- https://github.com/rivet-gg/rivet/issues/588#issuecomment-2018558966