purescript-protobuf icon indicating copy to clipboard operation
purescript-protobuf copied to clipboard

`nix develop` dies on me

Open i-am-the-slime opened this issue 9 months ago • 4 comments

Hey! I just cloned this repo and ran nix develop.

The output was:

error: builder for '/nix/store/2cipm5d7ff35v52dwi13sdcm4rh9106w-protobuf-v28.2.drv' failed with exit code 127;
       last 25 log lines:
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/reflection/message_reserved_range.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/reflection/method_def.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/reflection/oneof_def.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/reflection/service_def.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/text/encode.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/text/internal/encode.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/text/options.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/util/def_to_proto.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/util/required_fields.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/wire/decode.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/wire/encode.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/wire/eps_copy_input_stream.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/wire/internal/decode_fast.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/wire/reader.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/include/upb/wire/types.h
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-targets.cmake
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-targets-release.cmake
       > -- Up-to-date: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-module.cmake
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-generate.cmake
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-options.cmake
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-config.cmake
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/cmake/protobuf/protobuf-config-version.cmake
       > -- Installing: /nix/store/cqzxlgmgw7aan249yggjahncd4r7g2y3-protobuf-v28.2/lib/libgmock.a
       > /nix/store/h3sjynwq0s33d60f7r69bidiyb9ba0wl-stdenv-darwin/setup: line 131: patchelf: command not found
       For full logs, run 'nix log /nix/store/2cipm5d7ff35v52dwi13sdcm4rh9106w-protobuf-v28.2.drv'.
error: 1 dependencies of derivation '/nix/store/rm5k60d7k6k9fx9gwqcfaj4jyvjaq62z-purescript-protobuf-devshell-env.drv' failed to build

I'm not very familiar with nix, it sounds like I should add patchelf as a dependency somehow?

i-am-the-slime avatar Feb 26 '25 20:02 i-am-the-slime

Okay I tried via some docker container and failed. Actually just following the non-nix instructions is quite easy.

i-am-the-slime avatar Feb 26 '25 21:02 i-am-the-slime

It looks like you're in a Darwin (MacOS) environment?

The special derivation I wrote for protobuf will clearly not work in Darwin I guess because I'm using patchelf and there is no such thing as ELF in MacOS?

You could swap in the nixpkgs protobuf here

https://github.com/rowtype-yoga/purescript-protobuf/blob/d740e32d2222423d1487fdc62efe131e4ae53a88/flake.nix#L102

and then I think nix develop should work.

jamesdbrock avatar Feb 27 '25 05:02 jamesdbrock

I would like to help you get nix develop working. Ping me on the PureScript discord if you want to try to do this.

jamesdbrock avatar Feb 27 '25 06:02 jamesdbrock

I just pushed some flake.nix improvements to master so you should be able to nix develop now?

I don't have a Mac so can't test it but I think it should work.

jamesdbrock avatar Feb 27 '25 09:02 jamesdbrock