-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
[Do not merge] Rust packaging #4568
Conversation
Great work! From what I can tell it is looking good to me, but I'm not familiar with prefetch scripts or custom builders so unfortunately I can't provide better feedback... Am I deducing correctly that the current problem with building cargo itself with buildRustPackage is that cargo is downloading native code library dependencies outside of "cargo fetch"? |
@wizeman Not at all. The problem with building cargo itself is that one of its native dependencies does not built because of a missing flag somewhere. If you want to investigate the problem, you can try to build cargo outside of nixpkgs, the same problem will appears. |
rust-lang/rfcs#403 is closed. So what situation do we have now? |
It's merged but not yet implemented. I'll probably have time to look into it next week, and I'll try to ship something usable. I'll also try a different approach that uses dependencies overrides instead of cargo fetch. |
Nice. Maybe I can help you? |
Sure! Independently of the nixpkgs part, the main problem is with compiling
|
+1, I'm interested in Rust development with Nix. Happy to help/test if I can. |
I've added racer and a vim plugin for it (a tool to provide rust code completion). |
Update: I've started working on a new approach, which makes package expressions nicer. The result can me seen there: https://github.com/madjar/nixpkgs/blob/rust/pkgs/development/tools/build-managers/cargo/default.nix. The good news is that cargo now build without any trouble in NixOS. The bad news is that cargo now wants to fetch its registry: we can't keep it around because it's nondeterministic as hell, but if it isn't there, cargo tries to download at build time (which is not possible). So, for now, it stuck until it's possible to build without fetching in cargo. |
Maybe patch cargo and create a PR there? Explain why deteemenistic is On December 4, 2014 6:13:38 PM Georges Dubus [email protected] wrote:
|
Or patch cargo to use local db and pass it to it? On December 4, 2014 6:13:38 PM Georges Dubus [email protected] wrote:
|
Updates? ;) |
Not really. I planned to use a dirty hack to force nix to consider the result of It's pretty low on my todo-list, so if someone wants to give it a go, I'll be able to provide any help I can. |
I've picked up from where @madjar left off, and I've made some improvements. Also, I think I've finally found a good (or at least, working) solution to make I will keep you updated and post something up once I make some more progress in the next few days. |
@wizeman Awesome, thanks! I can't wait to see how you solved it. |
Awesome! Thank you! On 16 April 2015 15:08:10 "Ricardo M. Correia" [email protected]
|
Ok, I finally have something that works. See #7501 |
Awesome! I'll close this PR, then. |
Hello there
I've been working on the packaging of rust program (those that use cargo, to be specific), and here is what I've got for now.
You can package arbitrary rust package using
buildRustPackage
. It takes 4 arguments: a name, a src (a fetchgit derivation for example), sha256 (the sha of the cargo dependencies), and a optional buildInputs.You can look at the provided
rust-example.nix
to see what it looks like and try it out (it is a small game I wrote to try rust out).A lot of things must be finished before merging:
buildRustPackage
is not final at all. If you have comment on the right way to do it, or if you can me to good examples in nixpkgs, I'd be grateful.nix-prefetch-cargo
should be on par with othernix-prefetch
script, because it is required to determine the sha of the dependencies.@wizeman