-
Notifications
You must be signed in to change notification settings - Fork 89
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
can't build futures_util in some cases #83
Comments
Thank you for the report and the sample! I could reproduce it and I think that it is something that is useful and should be supported. I also verified quickly that each of these dependencies builds seperately. The generated code is already quite obviously wrong: {
# ...
dependencies = [
{
name = "futures";
packageId = "futures 0.1.29";
usesDefaultFeatures = false;
features = [ "compat" ];
}
{
name = "futures";
packageId = "futures 0.1.29";
rename = "futures01";
}
{
name = "futures";
packageId = "futures 0.3.4";
usesDefaultFeatures = false;
features = [ "compat" ];
}
{
name = "futures";
packageId = "futures 0.3.4";
rename = "futures01";
}
];
} The rename support in let # ...
crateRenames =
builtins.listToAttrs
(map (d: { name = d.name; value = d.rename; }) dependenciesWithRenames);
in
# This is the `buildRustCrate` call -- just that users can override it.
buildRustCrateFunc (
crateConfig // {
src = crateConfig.src or (
pkgs.fetchurl {
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz";
url = "https://crates.io/api/v1/crates/${crateConfig.crateName}/${crateConfig.version}/download";
sha256 = crateConfig.sha256;
}
);
inherit features dependencies buildDependencies crateRenames release;
}
) |
crate generate the correct ResolvedDependencies. `cargo metadata` really does not make this easy as there is not direct link between `NodeDep` and `Dependency`.
that it actually checks it got the right crates to compile.
I have fixed this but I need to wait for the related
|
It seems I'm not able to reproduce with my test case. Thanks! |
In #51, it seems like this issue is occurring again. The generated code in "futures-renamed-test" = rec {
crateName = "futures-renamed-test";
version = "0.1.0";
edition = "2018";
crateBin = [
{ name = "futures-renamed-test"; path = "src/main.rs"; }
];
src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; };
authors = [
"Peter Kolloch <[email protected]>"
];
dependencies = [
{
name = "futures";
packageId = "futures 0.1.29";
rename = "futures01";
}
{
name = "futures";
packageId = "futures 0.3.5";
usesDefaultFeatures = false;
features = [ "compat" ];
}
];
}; |
Hah! I didn't merge the fix to the master. That explains why it doesn't work. The integration test wasn't yet activated. Thank you for your insistance, @bbigras. I merge the fix now, sorry. |
hehe. It works and now I can use crate2nix with another project. Sweet. Thank you very much! |
crate2nix 0.7.0-beta.1
The text was updated successfully, but these errors were encountered: