feat(third_party/rust-crates): default to 2018 rust edition

We override the default `buildRustCrate` with our default options.

Kinda amazing how many crates still default to the 2015 edition;
probably to be backwards compatible with older compilers?

Change-Id: Ic571f527b1575a03b8b58e6b75bcf12c4b9b7d9c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2842
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
Profpatsch 2021-04-04 15:38:06 +02:00
parent 808448682c
commit 25ba2ef5f6

View file

@ -1,11 +1,17 @@
{ depot, pkgs, ... }: { depot, ... }:
let let
inherit (pkgs) buildRustCrate = attrs@{
buildRustCrate edition ? "2018",
; ...
}: depot.third_party.buildRustCrate (attrs // {
inherit
edition
;
});
in in
# TODO: remove this giant with because it screws with the static analyzer
with depot.third_party.rust-crates; with depot.third_party.rust-crates;
{ {
@ -27,6 +33,7 @@ with depot.third_party.rust-crates;
pname = "ascii"; pname = "ascii";
crateName = "ascii"; crateName = "ascii";
version = "1.0.0"; version = "1.0.0";
edition = "2015";
sha256 = "0gam8xsn981wfa40srsniivffjsfz1pg0xnigmczk9k7azb1ks1m"; sha256 = "0gam8xsn981wfa40srsniivffjsfz1pg0xnigmczk9k7azb1ks1m";
}; };
@ -34,6 +41,7 @@ with depot.third_party.rust-crates;
pname = "regex-syntax"; pname = "regex-syntax";
crateName = "regex-syntax"; crateName = "regex-syntax";
version = "0.6.22"; version = "0.6.22";
edition = "2015";
sha256 = "0r00n2dgyixacl1sczqp18gxf0xh7x272hcdp62412lypba2gqyg"; sha256 = "0r00n2dgyixacl1sczqp18gxf0xh7x272hcdp62412lypba2gqyg";
}; };
@ -43,6 +51,7 @@ with depot.third_party.rust-crates;
version = "1.4.3"; version = "1.4.3";
features = [ "std" ]; features = [ "std" ];
dependencies = [ regex-syntax ]; dependencies = [ regex-syntax ];
edition = "2015";
sha256 = "0w0b4bh0ng20lf5y8raaxmxj46ikjqpgwy1iggzpby9lhv9vydkp"; sha256 = "0w0b4bh0ng20lf5y8raaxmxj46ikjqpgwy1iggzpby9lhv9vydkp";
}; };
@ -51,6 +60,7 @@ with depot.third_party.rust-crates;
crateName = "libloading"; crateName = "libloading";
version = "0.6.7"; version = "0.6.7";
dependencies = [ cfg-if ]; dependencies = [ cfg-if ];
edition = "2015";
sha256 = "111d8zsizswnxiqn43vcgnc2ym9spsx1i6pcfp35ca3yw2ixq95j"; sha256 = "111d8zsizswnxiqn43vcgnc2ym9spsx1i6pcfp35ca3yw2ixq95j";
}; };
@ -71,6 +81,7 @@ with depot.third_party.rust-crates;
pname = "libc"; pname = "libc";
crateName = "libc"; crateName = "libc";
version = "0.2.82"; version = "0.2.82";
edition = "2015";
sha256 = "02zgn6c0xwh331hky417lbr29kmvrw3ylxs8822syyhjfjqszvsx"; sha256 = "02zgn6c0xwh331hky417lbr29kmvrw3ylxs8822syyhjfjqszvsx";
}; };
@ -93,7 +104,6 @@ with depot.third_party.rust-crates;
pname = "inotify"; pname = "inotify";
crateName = "inotify"; crateName = "inotify";
version = "0.9.2"; version = "0.9.2";
edition = "2018";
dependencies = [ bitflags libc inotify-sys ]; dependencies = [ bitflags libc inotify-sys ];
sha256 = "0fcknyvknglwwk1pdzdlb4m0ry2dym1yx8r5prf2v00pxnjk0hv2"; sha256 = "0fcknyvknglwwk1pdzdlb4m0ry2dym1yx8r5prf2v00pxnjk0hv2";
}; };
@ -102,6 +112,7 @@ with depot.third_party.rust-crates;
pname = "httparse"; pname = "httparse";
version = "1.3.4"; version = "1.3.4";
crateName = "httparse"; crateName = "httparse";
edition = "2015";
sha256 = "0dggj4s0cq69bn63q9nqzzay5acmwl33nrbhjjsh5xys8sk2x4jw"; sha256 = "0dggj4s0cq69bn63q9nqzzay5acmwl33nrbhjjsh5xys8sk2x4jw";
}; };
@ -109,6 +120,7 @@ with depot.third_party.rust-crates;
pname = "version-check"; pname = "version-check";
version = "0.9.2"; version = "0.9.2";
crateName = "version-check"; crateName = "version-check";
edition = "2015";
sha256 = "1vwvc1mzwv8ana9jv8z933p2xzgj1533qwwl5zr8mi89azyhq21v"; sha256 = "1vwvc1mzwv8ana9jv8z933p2xzgj1533qwwl5zr8mi89azyhq21v";
}; };
@ -116,6 +128,7 @@ with depot.third_party.rust-crates;
pname = "memchr"; pname = "memchr";
version = "2.3.3"; version = "2.3.3";
crateName = "memchr"; crateName = "memchr";
edition = "2015";
sha256 = "1ivxvlswglk6wd46gadkbbsknr94gwryk6y21v64ja7x4icrpihw"; sha256 = "1ivxvlswglk6wd46gadkbbsknr94gwryk6y21v64ja7x4icrpihw";
}; };
nom = buildRustCrate { nom = buildRustCrate {
@ -132,7 +145,6 @@ with depot.third_party.rust-crates;
pname = "base64"; pname = "base64";
version = "0.13.0"; version = "0.13.0";
crateName = "base64"; crateName = "base64";
edition = "2018";
sha256 = "0i0jk5sgq37kc4c90d1g7dp7zvphbg0dbqc1ajnn0vffjxblgamg"; sha256 = "0i0jk5sgq37kc4c90d1g7dp7zvphbg0dbqc1ajnn0vffjxblgamg";
features = [ "alloc" "std" ]; features = [ "alloc" "std" ];
}; };
@ -148,6 +160,7 @@ with depot.third_party.rust-crates;
pname = "autocfg"; pname = "autocfg";
version = "1.0.1"; version = "1.0.1";
crateName = "autocfg"; crateName = "autocfg";
edition = "2015";
sha256 = "1lsjz23jdcchcqbsmlzd4iksg3hc8bdvy677jy0938i2gp24frw1"; sha256 = "1lsjz23jdcchcqbsmlzd4iksg3hc8bdvy677jy0938i2gp24frw1";
}; };
@ -155,6 +168,7 @@ with depot.third_party.rust-crates;
pname = "num-traits"; pname = "num-traits";
version = "0.2.14"; version = "0.2.14";
crateName = "num-traits"; crateName = "num-traits";
edition = "2015";
buildDependencies = [ autocfg ]; buildDependencies = [ autocfg ];
sha256 = "09ac9dcp6cr57vjzyiy213y7312jqcy84mkamp99zr40qd1gwnyk"; sha256 = "09ac9dcp6cr57vjzyiy213y7312jqcy84mkamp99zr40qd1gwnyk";
}; };
@ -163,6 +177,7 @@ with depot.third_party.rust-crates;
pname = "num-integer"; pname = "num-integer";
version = "0.1.44"; version = "0.1.44";
crateName = "num-integer"; crateName = "num-integer";
edition = "2015";
dependencies = [ num-traits ]; dependencies = [ num-traits ];
buildDependencies = [ autocfg ]; buildDependencies = [ autocfg ];
sha256 = "1gdbnfgnivp90h644wmqj4a20yfmdga2xxxacx53pjbcazvfvajc"; sha256 = "1gdbnfgnivp90h644wmqj4a20yfmdga2xxxacx53pjbcazvfvajc";
@ -172,6 +187,7 @@ with depot.third_party.rust-crates;
pname = "chrono"; pname = "chrono";
version = "0.4.19"; version = "0.4.19";
crateName = "chrono"; crateName = "chrono";
edition = "2015";
dependencies = [ num-traits num-integer ]; dependencies = [ num-traits num-integer ];
features = [ "alloc" "std" ]; features = [ "alloc" "std" ];
sha256 = "0cjf5dnfbk99607vz6n5r6bhwykcypq5psihvk845sxrhnzadsar"; sha256 = "0cjf5dnfbk99607vz6n5r6bhwykcypq5psihvk845sxrhnzadsar";
@ -196,7 +212,6 @@ with depot.third_party.rust-crates;
pname = "imap"; pname = "imap";
version = "2.4.0"; version = "2.4.0";
crateName = "imap"; crateName = "imap";
edition = "2018";
dependencies = [ dependencies = [
base64 base64
bufstream bufstream
@ -221,6 +236,7 @@ with depot.third_party.rust-crates;
pname = "serde"; pname = "serde";
crateName = "serde"; crateName = "serde";
version = "1.0.123"; version = "1.0.123";
edition = "2015";
sha256 = "05xl2s1vpf3p7fi2yc9qlzw88d5ap0z3qmhmd7axa6pp9pn1s5xc"; sha256 = "05xl2s1vpf3p7fi2yc9qlzw88d5ap0z3qmhmd7axa6pp9pn1s5xc";
features = [ "std" ]; features = [ "std" ];
}; };
@ -246,7 +262,6 @@ with depot.third_party.rust-crates;
sha256 = "0sgc8dycigq0nxr4j613m4q733alfb2i10s6nz80lsbbqgrka21q"; sha256 = "0sgc8dycigq0nxr4j613m4q733alfb2i10s6nz80lsbbqgrka21q";
dependencies = [ serde ryu itoa ]; dependencies = [ serde ryu itoa ];
features = [ "std" ]; features = [ "std" ];
edition = "2018";
}; };
log = buildRustCrate { log = buildRustCrate {
@ -257,17 +272,11 @@ with depot.third_party.rust-crates;
dependencies = [ cfg-if ]; dependencies = [ cfg-if ];
}; };
serde_derive = buildRustCrate {
pname = "serde";
crateName = "serde";
version = "1.0.123";
sha256 = "05xl2s1vpf3p7fi2yc9qlzw88d5ap0z3qmhmd7axa6pp9pn1s5xc";
};
mustache = buildRustCrate { mustache = buildRustCrate {
pname = "mustache"; pname = "mustache";
version = "0.9.0"; version = "0.9.0";
crateName = "mustache"; crateName = "mustache";
edition = "2015";
sha256 = "1zgl8l15i19lzp90icgwyi6zqdd31b9vm8w129f41d1zd0hs7ayq"; sha256 = "1zgl8l15i19lzp90icgwyi6zqdd31b9vm8w129f41d1zd0hs7ayq";
dependencies = [ log serde ]; dependencies = [ log serde ];
}; };