Skip to content

buildRustPackage failures with git repos #41518

@jbboehr

Description

@jbboehr

Issue description

buildRustPackage seems to not be working properly with Cargo.toml that include dependencies as git repos.

For example, a Cargo.toml with the following dependency:

[dependencies]
bart = { git = "https://github.com/maghoff/bart" }

is missing this section in .cargo/config:

[source."https://github.com/maghoff/bart"]
git = "https://github.com/maghoff/bart"
branch = "master"
replace-with = "vendored-sources"

Steps to reproduce

I've setup a repository to demonstrate a working configuration, you can switch the two sections in default.nix to see it fail: https://github.com/jbboehr/nix-fetch-cargo-update

Technical details

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.43, NixOS, 18.03.132500.2f6440eb09b (Impala)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.0.2`
 - channels(rin): `""`
 - channels(root): `"nixos-18.03.132500.2f6440eb09b"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions