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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 180ae3d371b5
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 84b91899c371
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 13, 2020

  1. Copy the full SHA
    a9fdfeb View commit details
  2. Merge pull request #85172 from andir/buildRustCrate-proc-macro

    buildRustCrate: support proc-macro in default prelude
    andir authored Apr 13, 2020
    Copy the full SHA
    84b9189 View commit details
Showing with 15 additions and 0 deletions.
  1. +3 −0 pkgs/build-support/rust/build-rust-crate/build-crate.nix
  2. +12 −0 pkgs/build-support/rust/build-rust-crate/test/default.nix
3 changes: 3 additions & 0 deletions pkgs/build-support/rust/build-rust-crate/build-crate.nix
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@
++ [crateFeatures]
++ extraRustcOpts
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--target ${rust.toRustTarget stdenv.hostPlatform} -C linker=${stdenv.hostPlatform.config}-gcc"
# since rustc 1.42 the "proc_macro" crate is part of the default crate prelude
# https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022
++ lib.optional (lib.elem "proc-macro" crateType) "--extern proc_macro"
;
rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}";

12 changes: 12 additions & 0 deletions pkgs/build-support/rust/build-rust-crate/test/default.nix
Original file line number Diff line number Diff line change
@@ -457,6 +457,18 @@ let
"test ignore_main ... ok"
];
};
procMacroInPrelude = {
procMacro = true;
edition = "2018";
src = symlinkJoin {
name = "proc-macro-in-prelude";
paths = [
(mkFile "src/lib.rs" ''
use proc_macro::TokenTree;
'')
];
};
};
};
brotliCrates = (callPackage ./brotli-crates.nix {});
tests = lib.mapAttrs (key: value: mkTest (value // lib.optionalAttrs (!value?crateName) { crateName = key; })) cases;