Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build gRPC in a pure nix environment #58

Open
tjhunter opened this issue May 26, 2018 · 4 comments
Open

Cannot build gRPC in a pure nix environment #58

tjhunter opened this issue May 26, 2018 · 4 comments

Comments

@tjhunter
Copy link

Hello,
I was trying to compile gRPC on my computer (a recent version of Ubuntu). It looks like the current nix instructions do not express all the proper dependencies (or I am not using the proper nix channels).

Here is my setup:

  • nix --version nix (Nix) 2.0.2
  • nix-channel --list:
    nixpkgs https://nixos.org/channels/nixpkgs-unstable
  • grpc-haskell revision: 55f51eaa24e8a4dfeb1b477b2fe46a2d79652ca8 (latest master)

When launching the nix shell with nix-shell release.nix --pure -A grpc-haskell.env, here is what I get:

$ stack setup
bash: stack: command not found
$ cabal update
Downloading the latest package list from hackage.haskell.org

$ cabal configure --enable-tests
Resolving dependencies...
Configuring grpc-haskell-0.0.0.0...
Warning: 'include-dirs: include' directory does not exist.
cabal: The program 'c2hs' is required but it could not be found.

I tried to also download and run the latest release of stack, but ghc and gcc do not seem to find GMP in that case:

The GHC located at /home/tjhunter/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc failed to compile a sanity check. Please see:

    http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Running /home/tjhunter/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc /tmp/stack-sanity-check11158/Main.hs -no-user-package-db in directory /tmp/stack-sanity-check11158/ exited with ExitFailure 1

[1 of 1] Compiling Main             ( /tmp/stack-sanity-check11158/Main.hs, /tmp/stack-sanity-check11158/Main.o )
Linking /tmp/stack-sanity-check11158/Main ...

/nix/store/zi17ydzr9x1kqjcpfjr93iwg1frpmv8s-binutils-2.28.1/bin/ld : ne peut trouver -lgmp
collect2: erreur : ld a retourné 1 code d'état d'exécution
`gcc' failed in phase `Linker'. (Exit code: 1)

It is probably a simple fix in the nix derivations, but my understanding of these is pretty limited...

Thank you in advance.

@tjhunter tjhunter changed the title Cannot build gRPC in a pure environment Cannot build gRPC in a pure nix environment May 26, 2018
@Gabriella439
Copy link
Contributor

Are you able to successfully do cabal configure inside of a nix-shell when not using the --pure flag?

@sboosali
Copy link

fwiw, i've seen this error when working with nix on non-NixOS platforms. .nix file (and/or stack.yaml and/or cabal.project file) needs gmp to be listed, i can't say weather this solves this particular problem, since I haven't looked at this project's build files.

@Gabriella439
Copy link
Contributor

I've been testing on OS X (albeit without the --pure flag), so I think it should work without explicitly listing gmp

@sboosali
Copy link

sboosali commented Sep 18, 2018 via email

RichardWarfield pushed a commit to litxio/gRPC-haskell that referenced this issue Apr 25, 2023
…y#58)

Fixes awakesecurity#53

The motivation for this change is so that generated code does not need to
depend on the `grpc-haskell-core` package

This removes the unnecessary `Network.GRPC.HighLevel.Server.Unregistered`
import from the generated code since everything provided by the low-level
library is already re-exported by the high-level library
RichardWarfield pushed a commit to litxio/gRPC-haskell that referenced this issue Apr 25, 2023
Without the pragma one could accidentally leave both 'ifNat'
and 'boolNat' undefined, leading to an infinite loop because
each has a default implementation in terms of the other.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants