Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: ac82b1216cab
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 09e633d6805f
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Sep 10, 2019

  1. buildRustCrate: add support for renaming crates

    Before this change, buildRustCrate always called rustc with
    
    --extern libName=[...]libName[...]
    
    However, Cargo permits using a different name under which a dependency
    is known to a crate. For example, rand 0.7.0 uses:
    
    [dependencies]
    getrandom_package = { version = "0.1.1", package = "getrandom", optional = true }
    
    Which introduces the getrandom dependency such that it is known as
    getrandom_package to the rand crate. In this case, the correct extern
    flag is of the form
    
    --extern getrandom_package=[...]getrandom[...]
    
    which is currently not supported. In order to support such cases, this
    change introduces a crateRenames argument to buildRustCrate. This
    argument is an attribute set of dependencies that should be renamed. In
    this case, crateRenames would be:
    
    {
      "getrandom" = "getrandom_package";
    }
    
    The extern options are then built such that if the libName occurs as
    an attribute in this set, it value will be used as the local
    name. Otherwise libName will be used as before.
    
    (cherry picked from commit 85c6d72)
    danieldk authored and andir committed Sep 10, 2019
    Copy the full SHA
    1c29120 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #68409 from andir/19.09/build-rust-crate-renames

    [19.03] buildRustCrate: add support for renaming crates
    andir committed Sep 10, 2019
    Copy the full SHA
    09e633d View commit details
    Browse the repository at this point in the history