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: 0bfdab21cf69
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: f83a26291fce
Choose a head ref
  • 6 commits
  • 8 files changed
  • 2 contributors

Commits on Sep 13, 2018

  1. buildRustCrate: add heuristic to picking the right source files

    Cargo has a few odd (old) ways of picking source files if the `bin.path`
    attribute isn't given in the Cargo.toml. This commit adds support for
    some of those. The previous behaviour always defaulted to `src/main.rs`
    which was not always the right choice.
    
    Since there is  look-ahead into the unpacked sources before running the
    actual builder the path selection logic has to be embedded within the
    build script.
    
    `buildRustCrate` currently supports two ways of running building
    binaries when processing a crate:
    
    - Explicit definition of all the binaries (& optionally the paths to
    their respective `main.rs`) and,
    - if not binary was explictly configured all files matching the patterns
      `src/main.rs`, `src/bin/*.rs`.
    
    When the explicit list is given without path information paths are now
    being picked from a list of candidates. The first match wins. The order
    is the same as within the cargo compatibility code.
    
    If the crate does not provide any libraries the path `src/{bin_name}.rs`
    is also considered.
    
    All underscores within the binary names are translated into dashes (`-`)
    before the lookups are made. This seems to be a common convention.
    andir committed Sep 13, 2018
    Copy the full SHA
    0c50140 View commit details
    Browse the repository at this point in the history
  2. buildRustCrate: extracted builder scripts into dedicated files

    The build expression got quiet large over time and to make it a bit
    easier to grasp the different scripts involved in the build are now
    separated from the nix file.
    andir committed Sep 13, 2018
    Copy the full SHA
    1371815 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    fdc2017 View commit details
    Browse the repository at this point in the history
  4. buildRustCrate: add test cases

    andir committed Sep 13, 2018
    Copy the full SHA
    0f95d05 View commit details
    Browse the repository at this point in the history
  5. buildRustCrate: added some edge cases with binaries

    This commit adds test based on real-world crates (brotli).
    There were a few more edge cases that were missing beforehand. Also it
    turned out that we can get rid of the `finalBins` list since that will
    now be handled during runtime.
    andir committed Sep 13, 2018
    Copy the full SHA
    fc5e595 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2018

  1. Merge pull request #46210 from andir/build-rust-crate-changes

    buildRustCrate: add heuristic to picking the right binary source files
    Mic92 committed Sep 15, 2018
    Copy the full SHA
    f83a262 View commit details
    Browse the repository at this point in the history