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

Cargo Build is broken #8966

Closed
globin opened this Issue Jul 23, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@globin
Member

globin commented Jul 23, 2015

@wizeman

Could you clarify the steps for building a rust package?
I'd expect the following to work with nix-build, but I don't know how to find out the correct depsSha255 and specifying a wrong produces an error.

with import <nixpkgs> {};

rustPlatform.buildRustPackage {
  name = "duck";
  buildInputs = [
    cargoSnapshot.cargo
    rustPlatform.rustc
    openssl
    cmake
    zlibStatic
  ];
  depsSha256 = "0g420cbqpknhl61a4mpk3bbia8agf657d9vzzcqr338lmni80qzx";
}

EDIT:
oh I just noticed that it's actually cargo failing (http://hydra.nixos.org/build/23927558)
I guess this is caused by removing leaveDotGit from cargo

Nope, failing with that, too, in:

(cd $sourceRoot && cargo fetch &>/dev/null)

@globin globin changed the title from Rust Packaging to Cargo Build is broken Jul 23, 2015

@wizeman

This comment has been minimized.

Show comment
Hide comment
@wizeman

wizeman Jul 24, 2015

Member

Your code is almost correct. You need to remove cargoSnapshot.cargo and rustPlatform.rustc from buildInputs, because buildRustPackage already does that implicitly.

Regarding depsSha256, currently there isn't a good way to calculate it. What I do is to just put a valid but incorrect hash there (for example, taking an existing hash and replacing the last character with a zero), and then try to build. Nix will then tell you that your hash is incorrect, and it will tell you the correct one.

I will look into the cargo build failure.

Member

wizeman commented Jul 24, 2015

Your code is almost correct. You need to remove cargoSnapshot.cargo and rustPlatform.rustc from buildInputs, because buildRustPackage already does that implicitly.

Regarding depsSha256, currently there isn't a good way to calculate it. What I do is to just put a valid but incorrect hash there (for example, taking an existing hash and replacing the last character with a zero), and then try to build. Nix will then tell you that your hash is incorrect, and it will tell you the correct one.

I will look into the cargo build failure.

@wizeman wizeman closed this in a0249ed Jul 24, 2015

@wizeman

This comment has been minimized.

Show comment
Hide comment
@wizeman

wizeman Jul 24, 2015

Member

This should be fixed now.
If you have any issues, let me know. Thanks!

Member

wizeman commented Jul 24, 2015

This should be fixed now.
If you have any issues, let me know. Thanks!

@hiberno

This comment has been minimized.

Show comment
Hide comment
@hiberno

hiberno Jul 25, 2015

Contributor

@wizeman Fixed for me, thanks!

Contributor

hiberno commented Jul 25, 2015

@wizeman Fixed for me, thanks!

@globin

This comment has been minimized.

Show comment
Hide comment
@globin

globin Jul 25, 2015

Member

👍

Member

globin commented Jul 25, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment