diff --git a/Cargo.nix b/Cargo.nix new file mode 100644 index 0000000..facad84 --- /dev/null +++ b/Cargo.nix @@ -0,0 +1,2717 @@ + +# This file was @generated by crate2nix 0.9.0-alpha.1 with the command: +# "generate" +# See https://github.com/kolloch/crate2nix for more info. + +{ nixpkgs ? +, pkgs ? import nixpkgs { config = {}; } +, lib ? pkgs.lib +, stdenv ? pkgs.stdenv +, buildRustCrate ? pkgs.buildRustCrate + # This is used as the `crateOverrides` argument for `buildRustCrate`. +, defaultCrateOverrides ? pkgs.defaultCrateOverrides + # The features to enable for the root_crate or the workspace_members. +, rootFeatures ? [ "default" ] + # If true, throw errors instead of issueing deprecation warnings. +, strictDeprecation ? false + # Used for conditional compilation based on CPU feature detection. +, targetFeatures ? [] + # Whether to perform release builds: longer compile times, faster binaries. +, release ? true + # Additional crate2nix configuration if it exists. +, crateConfig + ? if builtins.pathExists ./crate-config.nix + then pkgs.callPackage ./crate-config.nix {} + else {} +}: + +rec { + # + # "public" attributes that we attempt to keep stable with new versions of crate2nix. + # + + rootCrate = rec { + packageId = "colmena"; + + # Use this attribute to refer to the derivation building your root crate package. + # You can override the features with rootCrate.build.override { features = [ "default" "feature1" ... ]; }. + build = internal.buildRustCrateWithFeatures { + inherit packageId; + }; + + # Debug support which might change between releases. + # File a bug if you depend on any for non-debug work! + debug = internal.debugCrate { inherit packageId; }; + }; + # Refer your crate build derivation by name here. + # You can override the features with + # workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }. + workspaceMembers = { + "colmena" = rec { + packageId = "colmena"; + build = internal.buildRustCrateWithFeatures { + packageId = "colmena"; + }; + + # Debug support which might change between releases. + # File a bug if you depend on any for non-debug work! + debug = internal.debugCrate { inherit packageId; }; + }; + }; + + # A derivation that joins the outputs of all workspace members together. + allWorkspaceMembers = pkgs.symlinkJoin { + name = "all-workspace-members"; + paths = + let members = builtins.attrValues workspaceMembers; + in builtins.map (m: m.build) members; + }; + + # + # "internal" ("private") attributes that may change in every new version of crate2nix. + # + + internal = rec { + # Build and dependency information for crates. + # Many of the fields are passed one-to-one to buildRustCrate. + # + # Noteworthy: + # * `dependencies`/`buildDependencies`: similar to the corresponding fields for buildRustCrate. + # but with additional information which is used during dependency/feature resolution. + # * `resolvedDependencies`: the selected default features reported by cargo - only included for debugging. + # * `devDependencies` as of now not used by `buildRustCrate` but used to + # inject test dependencies into the build + + crates = { + "ansi_term" = rec { + crateName = "ansi_term"; + version = "0.11.0"; + edition = "2015"; + sha256 = "16wpvrghvd0353584i1idnsgm0r3vchg8fyrm0x8ayv1rgvbljgf"; + authors = [ + "ogham@bsago.me" + "Ryan Scheel (Havvy) " + "Josh Triplett " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: (target."os" == "windows"); + features = [ "errhandlingapi" "consoleapi" "processenv" ]; + } + ]; + + }; + "async-trait" = rec { + crateName = "async-trait"; + version = "0.1.42"; + edition = "2018"; + sha256 = "0gd13pqgw5m6l4bqwjkickq13c4v0jxzxs5i4dwmldrlgvklafld"; + procMacro = true; + authors = [ + "David Tolnay " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" "visit-mut" ]; + } + ]; + + }; + "atty" = rec { + crateName = "atty"; + version = "0.2.14"; + edition = "2015"; + sha256 = "1s7yslcs6a28c5vz7jwj63lkfgyx8mx99fdirlhi9lbhhzhrpcyr"; + authors = [ + "softprops " + ]; + dependencies = [ + { + name = "hermit-abi"; + packageId = "hermit-abi"; + target = { target, features }: (target."os" == "hermit"); + } + { + name = "libc"; + packageId = "libc"; + usesDefaultFeatures = false; + target = { target, features }: target."unix"; + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "consoleapi" "processenv" "minwinbase" "minwindef" "winbase" ]; + } + ]; + + }; + "autocfg" = rec { + crateName = "autocfg"; + version = "1.0.1"; + edition = "2015"; + sha256 = "0jj6i9zn4gjl03kjvziqdji6rwx8ykz8zk2ngpc331z2g3fk3c6d"; + authors = [ + "Josh Stone " + ]; + + }; + "bitflags" = rec { + crateName = "bitflags"; + version = "1.2.1"; + edition = "2015"; + sha256 = "14qnd5nq8p2almk79m4m8ydqhd413yaxsyjp5xd19g3mikzf47fg"; + authors = [ + "The Rust Project Developers" + ]; + features = { + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "bytes" = rec { + crateName = "bytes"; + version = "0.6.0"; + edition = "2018"; + sha256 = "05ivrcbgl4f7z2zzm9hbsi8cy66spi70xlm6fp16zsq4ylsvrp70"; + authors = [ + "Carl Lerche " + "Sean McArthur " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "cfg-if 0.1.10" = rec { + crateName = "cfg-if"; + version = "0.1.10"; + edition = "2018"; + sha256 = "08h80ihs74jcyp24cd75wwabygbbdgl05k6p5dmq8akbr78vv1a7"; + authors = [ + "Alex Crichton " + ]; + features = { + "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; + }; + }; + "cfg-if 1.0.0" = rec { + crateName = "cfg-if"; + version = "1.0.0"; + edition = "2018"; + sha256 = "1za0vb97n4brpzpv8lsbnzmq5r8f2b0cpqqr0sy8h5bn751xxwds"; + authors = [ + "Alex Crichton " + ]; + features = { + "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; + }; + }; + "clap" = rec { + crateName = "clap"; + version = "2.33.3"; + edition = "2015"; + sha256 = "00i065a58987k1sbzqmlz721rw521zcg08jmsh40gi3khp3qmr9p"; + authors = [ + "Kevin K. " + ]; + dependencies = [ + { + name = "ansi_term"; + packageId = "ansi_term"; + optional = true; + target = { target, features }: (!target."windows"); + } + { + name = "atty"; + packageId = "atty"; + optional = true; + } + { + name = "bitflags"; + packageId = "bitflags"; + } + { + name = "strsim"; + packageId = "strsim"; + optional = true; + } + { + name = "textwrap"; + packageId = "textwrap"; + } + { + name = "unicode-width"; + packageId = "unicode-width"; + } + { + name = "vec_map"; + packageId = "vec_map"; + optional = true; + } + ]; + features = { + "color" = [ "ansi_term" "atty" ]; + "default" = [ "suggestions" "color" "vec_map" ]; + "doc" = [ "yaml" ]; + "lints" = [ "clippy" ]; + "suggestions" = [ "strsim" ]; + "wrap_help" = [ "term_size" "textwrap/term_size" ]; + "yaml" = [ "yaml-rust" ]; + }; + resolvedDefaultFeatures = [ "ansi_term" "atty" "color" "default" "strsim" "suggestions" "vec_map" ]; + }; + "colmena" = rec { + crateName = "colmena"; + version = "0.1.0"; + edition = "2018"; + crateBin = [ + { name = "colmena"; path = "src/main.rs"; } + ]; + src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; + authors = [ + "Zhaofeng Li " + ]; + dependencies = [ + { + name = "async-trait"; + packageId = "async-trait"; + } + { + name = "clap"; + packageId = "clap"; + } + { + name = "console"; + packageId = "console"; + } + { + name = "futures"; + packageId = "futures"; + } + { + name = "glob"; + packageId = "glob"; + } + { + name = "indicatif"; + packageId = "indicatif"; + } + { + name = "log"; + packageId = "log"; + } + { + name = "serde"; + packageId = "serde"; + features = [ "derive" ]; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "snafu"; + packageId = "snafu"; + } + { + name = "tempfile"; + packageId = "tempfile"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "full" ]; + } + ]; + + }; + "console" = rec { + crateName = "console"; + version = "0.13.0"; + edition = "2018"; + sha256 = "022ai0jbbawngrx396qppwgzk4pk3v2fdwckzamvz6h154jsn2m5"; + authors = [ + "Armin Ronacher " + ]; + dependencies = [ + { + name = "encode_unicode"; + packageId = "encode_unicode"; + target = { target, features }: target."windows"; + } + { + name = "lazy_static"; + packageId = "lazy_static"; + } + { + name = "libc"; + packageId = "libc"; + } + { + name = "regex"; + packageId = "regex"; + optional = true; + usesDefaultFeatures = false; + features = [ "std" ]; + } + { + name = "terminal_size"; + packageId = "terminal_size"; + } + { + name = "unicode-width"; + packageId = "unicode-width"; + optional = true; + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "winbase" "winuser" "consoleapi" "processenv" "wincon" ]; + } + { + name = "winapi-util"; + packageId = "winapi-util"; + optional = true; + target = { target, features }: target."windows"; + } + ]; + features = { + "ansi-parsing" = [ "regex" ]; + "default" = [ "unicode-width" "ansi-parsing" "windows-console-colors" ]; + "windows-console-colors" = [ "ansi-parsing" "winapi-util" ]; + }; + resolvedDefaultFeatures = [ "ansi-parsing" "default" "regex" "unicode-width" "winapi-util" "windows-console-colors" ]; + }; + "doc-comment" = rec { + crateName = "doc-comment"; + version = "0.3.3"; + edition = "2015"; + sha256 = "043sprsf3wl926zmck1bm7gw0jq50mb76lkpk49vasfr6ax1p97y"; + libName = "doc_comment"; + authors = [ + "Guillaume Gomez " + ]; + features = { + }; + }; + "encode_unicode" = rec { + crateName = "encode_unicode"; + version = "0.3.6"; + edition = "2015"; + sha256 = "07w3vzrhxh9lpjgsg2y5bwzfar2aq35mdznvcp3zjl0ssj7d4mx3"; + authors = [ + "Torbjørn Birch Moltu " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "futures" = rec { + crateName = "futures"; + version = "0.3.8"; + edition = "2018"; + sha256 = "1l434mh7p5na5c3c7lih575hszqc515r9idk62fm5rhz1820qfwv"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "futures-channel"; + packageId = "futures-channel"; + usesDefaultFeatures = false; + features = [ "sink" ]; + } + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-executor"; + packageId = "futures-executor"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "futures-io"; + packageId = "futures-io"; + usesDefaultFeatures = false; + } + { + name = "futures-sink"; + packageId = "futures-sink"; + usesDefaultFeatures = false; + } + { + name = "futures-task"; + packageId = "futures-task"; + usesDefaultFeatures = false; + } + { + name = "futures-util"; + packageId = "futures-util"; + usesDefaultFeatures = false; + features = [ "sink" ]; + } + ]; + features = { + "alloc" = [ "futures-core/alloc" "futures-task/alloc" "futures-sink/alloc" "futures-channel/alloc" "futures-util/alloc" ]; + "async-await" = [ "futures-util/async-await" "futures-util/async-await-macro" ]; + "bilock" = [ "futures-util/bilock" ]; + "cfg-target-has-atomic" = [ "futures-core/cfg-target-has-atomic" "futures-task/cfg-target-has-atomic" "futures-channel/cfg-target-has-atomic" "futures-util/cfg-target-has-atomic" ]; + "compat" = [ "std" "futures-util/compat" ]; + "default" = [ "std" "async-await" "executor" ]; + "executor" = [ "std" "futures-executor/std" ]; + "io-compat" = [ "compat" "futures-util/io-compat" ]; + "read-initializer" = [ "futures-io/read-initializer" "futures-util/read-initializer" ]; + "std" = [ "alloc" "futures-core/std" "futures-task/std" "futures-io/std" "futures-sink/std" "futures-util/std" "futures-util/io" "futures-util/channel" ]; + "thread-pool" = [ "executor" "futures-executor/thread-pool" ]; + "unstable" = [ "futures-core/unstable" "futures-task/unstable" "futures-channel/unstable" "futures-io/unstable" "futures-util/unstable" ]; + "write-all-vectored" = [ "futures-util/write-all-vectored" ]; + }; + resolvedDefaultFeatures = [ "alloc" "async-await" "default" "executor" "futures-executor" "std" ]; + }; + "futures-channel" = rec { + crateName = "futures-channel"; + version = "0.3.8"; + edition = "2018"; + sha256 = "0r7y228kkhwx9jj3ny5ppmw2gvw0capm6ig8dzppgqd4g9l0jwab"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-sink"; + packageId = "futures-sink"; + optional = true; + usesDefaultFeatures = false; + } + ]; + features = { + "alloc" = [ "futures-core/alloc" ]; + "cfg-target-has-atomic" = [ "futures-core/cfg-target-has-atomic" ]; + "default" = [ "std" ]; + "sink" = [ "futures-sink" ]; + "std" = [ "alloc" "futures-core/std" ]; + "unstable" = [ "futures-core/unstable" ]; + }; + resolvedDefaultFeatures = [ "alloc" "futures-sink" "sink" "std" ]; + }; + "futures-core" = rec { + crateName = "futures-core"; + version = "0.3.8"; + edition = "2018"; + sha256 = "0j0pixxv8dmqas1h5cgy92z4r9lpmnlis8ls22v17yrgnwqy2z44"; + authors = [ + "Alex Crichton " + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "std" ]; + }; + "futures-executor" = rec { + crateName = "futures-executor"; + version = "0.3.8"; + edition = "2018"; + sha256 = "0r8ayj6g08d1i0hj2v6g5zr3hzlkxpqlkpf1awq0105qd0mjpajc"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-task"; + packageId = "futures-task"; + usesDefaultFeatures = false; + } + { + name = "futures-util"; + packageId = "futures-util"; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "std" ]; + "std" = [ "futures-core/std" "futures-task/std" "futures-util/std" ]; + "thread-pool" = [ "std" "num_cpus" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "futures-io" = rec { + crateName = "futures-io"; + version = "0.3.8"; + edition = "2018"; + sha256 = "1frh7d0n96lczy22al3bkgwpq0p1agbgax5kqh9vv8da33738631"; + authors = [ + "Alex Crichton " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "futures-macro" = rec { + crateName = "futures-macro"; + version = "0.3.8"; + edition = "2018"; + sha256 = "0mjmb46zapb59iilsbljpj7l0hq6w19df0f03p3br5qz5xlqlh3p"; + procMacro = true; + authors = [ + "Taylor Cramer " + "Taiki Endo " + ]; + dependencies = [ + { + name = "proc-macro-hack"; + packageId = "proc-macro-hack"; + } + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" ]; + } + ]; + + }; + "futures-sink" = rec { + crateName = "futures-sink"; + version = "0.3.8"; + edition = "2018"; + sha256 = "0gfb1z97q861ki6lqsvpgfn3hnm9w3vkrf82dc00xrff95d1jy7q"; + authors = [ + "Alex Crichton " + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" ]; + }; + resolvedDefaultFeatures = [ "alloc" "std" ]; + }; + "futures-task" = rec { + crateName = "futures-task"; + version = "0.3.8"; + edition = "2018"; + sha256 = "03ad39v8scy353src2f9dkkvcs24n736iavi8xn45cj8pyslwmbw"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "once_cell"; + packageId = "once_cell"; + optional = true; + usesDefaultFeatures = false; + features = [ "std" ]; + } + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" "once_cell" ]; + }; + resolvedDefaultFeatures = [ "alloc" "once_cell" "std" ]; + }; + "futures-util" = rec { + crateName = "futures-util"; + version = "0.3.8"; + edition = "2018"; + sha256 = "1lnbhpyrypn9giw6122af0pffxfijfz3zm7phrwzp75rlzscy16k"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "futures-channel"; + packageId = "futures-channel"; + optional = true; + usesDefaultFeatures = false; + features = [ "std" ]; + } + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-io"; + packageId = "futures-io"; + optional = true; + usesDefaultFeatures = false; + features = [ "std" ]; + } + { + name = "futures-macro"; + packageId = "futures-macro"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "futures-sink"; + packageId = "futures-sink"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "futures-task"; + packageId = "futures-task"; + usesDefaultFeatures = false; + } + { + name = "memchr"; + packageId = "memchr"; + optional = true; + } + { + name = "pin-project"; + packageId = "pin-project"; + } + { + name = "pin-utils"; + packageId = "pin-utils"; + } + { + name = "proc-macro-hack"; + packageId = "proc-macro-hack"; + optional = true; + } + { + name = "proc-macro-nested"; + packageId = "proc-macro-nested"; + optional = true; + } + { + name = "slab"; + packageId = "slab"; + optional = true; + } + ]; + features = { + "alloc" = [ "futures-core/alloc" "futures-task/alloc" ]; + "async-await-macro" = [ "async-await" "futures-macro" "proc-macro-hack" "proc-macro-nested" ]; + "cfg-target-has-atomic" = [ "futures-core/cfg-target-has-atomic" "futures-task/cfg-target-has-atomic" ]; + "channel" = [ "std" "futures-channel" ]; + "compat" = [ "std" "futures_01" ]; + "default" = [ "std" "async-await" "async-await-macro" ]; + "io" = [ "std" "futures-io" "memchr" ]; + "io-compat" = [ "io" "compat" "tokio-io" ]; + "read-initializer" = [ "io" "futures-io/read-initializer" "futures-io/unstable" ]; + "sink" = [ "futures-sink" ]; + "std" = [ "alloc" "futures-core/std" "futures-task/std" "slab" ]; + "unstable" = [ "futures-core/unstable" "futures-task/unstable" ]; + "write-all-vectored" = [ "io" ]; + }; + resolvedDefaultFeatures = [ "alloc" "async-await" "async-await-macro" "channel" "futures-channel" "futures-io" "futures-macro" "futures-sink" "io" "memchr" "proc-macro-hack" "proc-macro-nested" "sink" "slab" "std" ]; + }; + "getrandom" = rec { + crateName = "getrandom"; + version = "0.1.15"; + edition = "2018"; + sha256 = "1rj7psnlrnmsgyj6x2ag4c6367laq4g8kfd6pzamac99xk07nn7w"; + authors = [ + "The Rand Project Developers" + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 0.1.10"; + } + { + name = "libc"; + packageId = "libc"; + usesDefaultFeatures = false; + target = { target, features }: target."unix"; + } + { + name = "wasi"; + packageId = "wasi"; + target = { target, features }: (target."os" == "wasi"); + } + ]; + features = { + "rustc-dep-of-std" = [ "compiler_builtins" "core" ]; + "test-in-browser" = [ "wasm-bindgen" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "glob" = rec { + crateName = "glob"; + version = "0.3.0"; + edition = "2015"; + sha256 = "0x25wfr7vg3mzxc9x05dcphvd3nwlcmbnxrvwcvrrdwplcrrk4cv"; + authors = [ + "The Rust Project Developers" + ]; + + }; + "hermit-abi" = rec { + crateName = "hermit-abi"; + version = "0.1.17"; + edition = "2018"; + sha256 = "1s1ss7xypnbpjglmj5k39svzsmni1rqp57a91qi5pyv0yxjmbjjs"; + authors = [ + "Stefan Lankes" + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + usesDefaultFeatures = false; + } + ]; + features = { + "rustc-dep-of-std" = [ "core" "compiler_builtins/rustc-dep-of-std" "libc/rustc-dep-of-std" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "indicatif" = rec { + crateName = "indicatif"; + version = "0.15.0"; + edition = "2018"; + sha256 = "1r4n50mclyi4c7b9c9mlma1rhchjamw71r3z8vgqcmp24mhvbakv"; + authors = [ + "Armin Ronacher " + ]; + dependencies = [ + { + name = "console"; + packageId = "console"; + } + { + name = "lazy_static"; + packageId = "lazy_static"; + } + { + name = "number_prefix"; + packageId = "number_prefix"; + } + { + name = "regex"; + packageId = "regex"; + usesDefaultFeatures = false; + features = [ "std" ]; + } + ]; + features = { + "improved_unicode" = [ "unicode-segmentation" "unicode-width" "console/unicode-width" ]; + "with_rayon" = [ "rayon" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "instant" = rec { + crateName = "instant"; + version = "0.1.9"; + edition = "2018"; + sha256 = "1v659qqm55misvjijfbl1p7azjp4yynjbwldan8836ynpgp4w4k1"; + authors = [ + "sebcrozet " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 1.0.0"; + } + ]; + features = { + "now" = [ "time" ]; + "wasm-bindgen" = [ "js-sys" "wasm-bindgen_rs" "web-sys" ]; + }; + }; + "itoa" = rec { + crateName = "itoa"; + version = "0.4.6"; + edition = "2015"; + sha256 = "1rnpb7rr8df76gnlk07b9086cn7fc0dxxy1ghh00q6nip7bklvyw"; + authors = [ + "David Tolnay " + ]; + features = { + "default" = [ "std" ]; + }; + }; + "lazy_static" = rec { + crateName = "lazy_static"; + version = "1.4.0"; + edition = "2015"; + sha256 = "0in6ikhw8mgl33wjv6q6xfrb5b9jr16q8ygjy803fay4zcisvaz2"; + authors = [ + "Marvin Löbel " + ]; + features = { + "spin_no_std" = [ "spin" ]; + }; + }; + "libc" = rec { + crateName = "libc"; + version = "0.2.81"; + edition = "2015"; + sha256 = "1jsk82v5snd286ba92lir5snrxl18qm3kjkagz8c97hn0q9q50hl"; + authors = [ + "The Rust Project Developers" + ]; + features = { + "default" = [ "std" ]; + "rustc-dep-of-std" = [ "align" "rustc-std-workspace-core" ]; + "use_std" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "align" "default" "std" ]; + }; + "lock_api" = rec { + crateName = "lock_api"; + version = "0.4.2"; + edition = "2018"; + sha256 = "04hkhfq308agxg9wwmzh7ncfiyyyhn0d49n07abppzdj6p8zz5nx"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "scopeguard"; + packageId = "scopeguard"; + usesDefaultFeatures = false; + } + ]; + features = { + }; + }; + "log" = rec { + crateName = "log"; + version = "0.4.11"; + edition = "2015"; + sha256 = "12xzqaflpiljn5cmxsbnbv9sjaj13ykhwsvll0gysbx4blbyvasg"; + authors = [ + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 0.1.10"; + } + ]; + features = { + "kv_unstable_sval" = [ "kv_unstable" "sval/fmt" ]; + }; + }; + "memchr" = rec { + crateName = "memchr"; + version = "2.3.4"; + edition = "2015"; + sha256 = "098m9clfs495illlw00hv2gg67mhm7jflld3msyclvi5m9xc9q8f"; + authors = [ + "Andrew Gallant " + "bluss" + ]; + features = { + "default" = [ "std" ]; + "use_std" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "mio" = rec { + crateName = "mio"; + version = "0.7.6"; + edition = "2018"; + sha256 = "12qsvmsmpijnghgci5i0liskvwxrbg2dz6hc09kgvwaf0s3whfzk"; + authors = [ + "Carl Lerche " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + target = { target, features }: target."unix"; + } + { + name = "log"; + packageId = "log"; + } + { + name = "miow"; + packageId = "miow"; + target = { target, features }: target."windows"; + } + { + name = "ntapi"; + packageId = "ntapi"; + target = { target, features }: target."windows"; + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "winsock2" "mswsock" ]; + } + ]; + features = { + "os-ext" = [ "os-poll" ]; + "os-util" = [ "os-ext" ]; + "pipe" = [ "os-ext" ]; + "tcp" = [ "net" ]; + "udp" = [ "net" ]; + "uds" = [ "net" ]; + }; + resolvedDefaultFeatures = [ "default" "net" "os-ext" "os-poll" "os-util" "tcp" "udp" "uds" ]; + }; + "miow" = rec { + crateName = "miow"; + version = "0.3.6"; + edition = "2018"; + sha256 = "15sqdhh29dqgw5xh59clwv6scbsbvdkbmdc16hbfvyq7b2sw2css"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "socket2"; + packageId = "socket2"; + } + { + name = "winapi"; + packageId = "winapi"; + features = [ "std" "fileapi" "handleapi" "ioapiset" "minwindef" "namedpipeapi" "ntdef" "synchapi" "winerror" "winsock2" "ws2def" "ws2ipdef" ]; + } + ]; + + }; + "ntapi" = rec { + crateName = "ntapi"; + version = "0.3.6"; + edition = "2018"; + sha256 = "0i5daj9sr8wyi5jkpwpybln2jqpn59z0mqfc0dpdidipwh1bjsrz"; + authors = [ + "MSxDOS " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi"; + features = [ "cfg" "evntrace" "in6addr" "inaddr" "minwinbase" "ntsecapi" "windef" "winioctl" ]; + } + ]; + features = { + "default" = [ "user" ]; + "impl-default" = [ "winapi/impl-default" ]; + }; + resolvedDefaultFeatures = [ "default" "user" ]; + }; + "num_cpus" = rec { + crateName = "num_cpus"; + version = "1.13.0"; + edition = "2015"; + sha256 = "1cv6yxhz2zbnwn8pn1yn8grg7zsnd523947fby41a737aqvryj85"; + authors = [ + "Sean McArthur " + ]; + dependencies = [ + { + name = "hermit-abi"; + packageId = "hermit-abi"; + target = { target, features }: (((target."arch" == "x86_64") || (target."arch" == "aarch64")) && (target."os" == "hermit")); + } + { + name = "libc"; + packageId = "libc"; + } + ]; + + }; + "number_prefix" = rec { + crateName = "number_prefix"; + version = "0.3.0"; + edition = "2015"; + sha256 = "0slm4mqmpgs6hvz22ycny9lvyvl9ivs80a1lncslp7lszz02zc0p"; + authors = [ + "Benjamin Sago " + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "once_cell" = rec { + crateName = "once_cell"; + version = "1.5.2"; + edition = "2018"; + sha256 = "183zs1dbmsv24mkafjypf9qwjrx46an58vb004a162l113sl3g8k"; + authors = [ + "Aleksey Kladov " + ]; + features = { + "default" = [ "std" ]; + "std" = [ "alloc" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "std" ]; + }; + "parking_lot" = rec { + crateName = "parking_lot"; + version = "0.11.1"; + edition = "2018"; + sha256 = "1sqmgaia8zfd5fbnqw2w13ijh7crk3lf9vw4cb52vwlx0an48xvd"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "instant"; + packageId = "instant"; + } + { + name = "lock_api"; + packageId = "lock_api"; + } + { + name = "parking_lot_core"; + packageId = "parking_lot_core"; + } + ]; + features = { + "deadlock_detection" = [ "parking_lot_core/deadlock_detection" ]; + "nightly" = [ "parking_lot_core/nightly" "lock_api/nightly" ]; + "owning_ref" = [ "lock_api/owning_ref" ]; + "serde" = [ "lock_api/serde" ]; + "stdweb" = [ "instant/stdweb" ]; + "wasm-bindgen" = [ "instant/wasm-bindgen" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "parking_lot_core" = rec { + crateName = "parking_lot_core"; + version = "0.8.1"; + edition = "2018"; + sha256 = "1l6fhxks1xc8vbcwlz2119canmaql5hfhny51552hibl8awdkinp"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 1.0.0"; + } + { + name = "instant"; + packageId = "instant"; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: target."unix"; + } + { + name = "redox_syscall"; + packageId = "redox_syscall"; + target = { target, features }: (target."os" == "redox"); + } + { + name = "smallvec"; + packageId = "smallvec"; + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "winnt" "ntstatus" "minwindef" "winerror" "winbase" "errhandlingapi" "handleapi" ]; + } + ]; + features = { + "deadlock_detection" = [ "petgraph" "thread-id" "backtrace" ]; + }; + }; + "pin-project" = rec { + crateName = "pin-project"; + version = "1.0.2"; + edition = "2018"; + sha256 = "19qw2nm2kk38v9j16nsm8j3fkh0g8pjq0k4cplx7i2f4q8vj5k4w"; + authors = [ + "Taiki Endo " + ]; + dependencies = [ + { + name = "pin-project-internal"; + packageId = "pin-project-internal"; + usesDefaultFeatures = false; + } + ]; + + }; + "pin-project-internal" = rec { + crateName = "pin-project-internal"; + version = "1.0.2"; + edition = "2018"; + sha256 = "0pwy3m32scf3ypjb9ai151lmaa27vyj06lc64i28l0r31fzx5s7q"; + procMacro = true; + authors = [ + "Taiki Endo " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" "visit-mut" ]; + } + ]; + + }; + "pin-project-lite" = rec { + crateName = "pin-project-lite"; + version = "0.2.0"; + edition = "2018"; + sha256 = "070klqy200alrhxb79fxarrrrn0vbwg95dmqw9062vhqxibky1kb"; + authors = [ + "Taiki Endo " + ]; + + }; + "pin-utils" = rec { + crateName = "pin-utils"; + version = "0.1.0"; + edition = "2018"; + sha256 = "117ir7vslsl2z1a7qzhws4pd01cg2d3338c47swjyvqv2n60v1wb"; + authors = [ + "Josef Brandl " + ]; + + }; + "ppv-lite86" = rec { + crateName = "ppv-lite86"; + version = "0.2.10"; + edition = "2018"; + sha256 = "0ms8198kclg4h96ggbziixxmsdl847s648kmbx11zlmjsqjccx5c"; + authors = [ + "The CryptoCorrosion Contributors" + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "simd" "std" ]; + }; + "proc-macro-hack" = rec { + crateName = "proc-macro-hack"; + version = "0.5.19"; + edition = "2018"; + sha256 = "1rg0kzsj7lj00qj602d3h77spwfz48vixn1wbjp7a4yrq65w9w6v"; + procMacro = true; + authors = [ + "David Tolnay " + ]; + + }; + "proc-macro-nested" = rec { + crateName = "proc-macro-nested"; + version = "0.1.6"; + edition = "2015"; + sha256 = "0nnwm9bvp1fmr8nqjp8ynrkj97yzpsdh3062li8b0f4hzgd818gb"; + authors = [ + "David Tolnay " + ]; + + }; + "proc-macro2" = rec { + crateName = "proc-macro2"; + version = "1.0.24"; + edition = "2018"; + sha256 = "0wcabxzrddcjmryndw8fpyxcq6rw63m701vx86xxf03y3bp081qy"; + authors = [ + "Alex Crichton " + "David Tolnay " + ]; + dependencies = [ + { + name = "unicode-xid"; + packageId = "unicode-xid"; + } + ]; + features = { + "default" = [ "proc-macro" ]; + }; + resolvedDefaultFeatures = [ "default" "proc-macro" ]; + }; + "quote" = rec { + crateName = "quote"; + version = "1.0.7"; + edition = "2018"; + sha256 = "0drzd6pq7whq7qhdvvs8wn6pbb0hhc12pz8wv80fb05ixhbksmma"; + authors = [ + "David Tolnay " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "proc-macro" ]; + "proc-macro" = [ "proc-macro2/proc-macro" ]; + }; + resolvedDefaultFeatures = [ "default" "proc-macro" ]; + }; + "rand" = rec { + crateName = "rand"; + version = "0.7.3"; + edition = "2018"; + sha256 = "00sdaimkbz491qgi6qxkv582yivl32m2jd401kzbn94vsiwicsva"; + authors = [ + "The Rand Project Developers" + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "getrandom"; + packageId = "getrandom"; + rename = "getrandom_package"; + optional = true; + } + { + name = "libc"; + packageId = "libc"; + optional = true; + usesDefaultFeatures = false; + target = { target, features }: target."unix"; + } + { + name = "rand_chacha"; + packageId = "rand_chacha"; + usesDefaultFeatures = false; + target = { target, features }: (!(target."os" == "emscripten")); + } + { + name = "rand_core"; + packageId = "rand_core"; + } + { + name = "rand_hc"; + packageId = "rand_hc"; + target = { target, features }: (target."os" == "emscripten"); + } + ]; + devDependencies = [ + { + name = "rand_hc"; + packageId = "rand_hc"; + } + ]; + features = { + "alloc" = [ "rand_core/alloc" ]; + "default" = [ "std" ]; + "getrandom" = [ "getrandom_package" "rand_core/getrandom" ]; + "nightly" = [ "simd_support" ]; + "simd_support" = [ "packed_simd" ]; + "small_rng" = [ "rand_pcg" ]; + "std" = [ "rand_core/std" "rand_chacha/std" "alloc" "getrandom" "libc" ]; + "stdweb" = [ "getrandom_package/stdweb" ]; + "wasm-bindgen" = [ "getrandom_package/wasm-bindgen" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "getrandom" "getrandom_package" "libc" "std" ]; + }; + "rand_chacha" = rec { + crateName = "rand_chacha"; + version = "0.2.2"; + edition = "2018"; + sha256 = "00il36fkdbsmpr99p9ksmmp6dn1md7rmnwmz0rr77jbrca2yvj7l"; + authors = [ + "The Rand Project Developers" + "The Rust Project Developers" + "The CryptoCorrosion Contributors" + ]; + dependencies = [ + { + name = "ppv-lite86"; + packageId = "ppv-lite86"; + usesDefaultFeatures = false; + features = [ "simd" ]; + } + { + name = "rand_core"; + packageId = "rand_core"; + } + ]; + features = { + "default" = [ "std" "simd" ]; + "std" = [ "ppv-lite86/std" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "rand_core" = rec { + crateName = "rand_core"; + version = "0.5.1"; + edition = "2018"; + sha256 = "06bdvx08v3rkz451cm7z59xwwqn1rkfh6v9ay77b14f8dwlybgch"; + authors = [ + "The Rand Project Developers" + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "getrandom"; + packageId = "getrandom"; + optional = true; + } + ]; + features = { + "serde1" = [ "serde" ]; + "std" = [ "alloc" "getrandom" "getrandom/std" ]; + }; + resolvedDefaultFeatures = [ "alloc" "getrandom" "std" ]; + }; + "rand_hc" = rec { + crateName = "rand_hc"; + version = "0.2.0"; + edition = "2018"; + sha256 = "0g31sqwpmsirdlwr0svnacr4dbqyz339im4ssl9738cjgfpjjcfa"; + authors = [ + "The Rand Project Developers" + ]; + dependencies = [ + { + name = "rand_core"; + packageId = "rand_core"; + } + ]; + + }; + "redox_syscall" = rec { + crateName = "redox_syscall"; + version = "0.1.57"; + edition = "2015"; + sha256 = "1kh59fpwy33w9nwd5iyc283yglq8pf2s41hnhvl48iax9mz0zk21"; + libName = "syscall"; + authors = [ + "Jeremy Soller " + ]; + + }; + "regex" = rec { + crateName = "regex"; + version = "1.4.2"; + edition = "2015"; + sha256 = "172bw2yryv65whn3n5vkww4kgk0bq08lx0zbln8xwia7xl9jrkrq"; + authors = [ + "The Rust Project Developers" + ]; + dependencies = [ + { + name = "regex-syntax"; + packageId = "regex-syntax"; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "std" "perf" "unicode" "regex-syntax/default" ]; + "perf" = [ "perf-cache" "perf-dfa" "perf-inline" "perf-literal" ]; + "perf-cache" = [ "thread_local" ]; + "perf-literal" = [ "aho-corasick" "memchr" ]; + "unicode" = [ "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" "regex-syntax/unicode" ]; + "unicode-age" = [ "regex-syntax/unicode-age" ]; + "unicode-bool" = [ "regex-syntax/unicode-bool" ]; + "unicode-case" = [ "regex-syntax/unicode-case" ]; + "unicode-gencat" = [ "regex-syntax/unicode-gencat" ]; + "unicode-perl" = [ "regex-syntax/unicode-perl" ]; + "unicode-script" = [ "regex-syntax/unicode-script" ]; + "unicode-segment" = [ "regex-syntax/unicode-segment" ]; + "unstable" = [ "pattern" ]; + "use_std" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; + "regex-syntax" = rec { + crateName = "regex-syntax"; + version = "0.6.21"; + edition = "2015"; + sha256 = "12d176jkgw9749g07zjxz0n78nyvb2nqx3j4sp5aqyphvji1n61v"; + authors = [ + "The Rust Project Developers" + ]; + features = { + "default" = [ "unicode" ]; + "unicode" = [ "unicode-age" "unicode-bool" "unicode-case" "unicode-gencat" "unicode-perl" "unicode-script" "unicode-segment" ]; + }; + }; + "remove_dir_all" = rec { + crateName = "remove_dir_all"; + version = "0.5.3"; + edition = "2015"; + sha256 = "1rzqbsgkmr053bxxl04vmvsd1njyz0nxvly97aip6aa2cmb15k9s"; + authors = [ + "Aaronepower " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "std" "errhandlingapi" "winerror" "fileapi" "winbase" ]; + } + ]; + + }; + "ryu" = rec { + crateName = "ryu"; + version = "1.0.5"; + edition = "2018"; + sha256 = "0vpqv1dj7fksa6hm3zpk5rbsjs0ifbfy7xwzsyyil0rx37a03lvi"; + authors = [ + "David Tolnay " + ]; + features = { + }; + }; + "scopeguard" = rec { + crateName = "scopeguard"; + version = "1.1.0"; + edition = "2015"; + sha256 = "1kbqm85v43rq92vx7hfiay6pmcga03vrjbbfwqpyj3pwsg3b16nj"; + authors = [ + "bluss" + ]; + features = { + "default" = [ "use_std" ]; + }; + }; + "serde" = rec { + crateName = "serde"; + version = "1.0.118"; + edition = "2015"; + sha256 = "0028kv3dh3ix5g7jfws22zb9hcqq4cnpwn2lnlpam1wxhmil5ih6"; + authors = [ + "Erick Tryzelaar " + "David Tolnay " + ]; + dependencies = [ + { + name = "serde_derive"; + packageId = "serde_derive"; + optional = true; + } + ]; + devDependencies = [ + { + name = "serde_derive"; + packageId = "serde_derive"; + } + ]; + features = { + "default" = [ "std" ]; + "derive" = [ "serde_derive" ]; + }; + resolvedDefaultFeatures = [ "default" "derive" "serde_derive" "std" ]; + }; + "serde_derive" = rec { + crateName = "serde_derive"; + version = "1.0.118"; + edition = "2015"; + sha256 = "1pvj4v8k107ichsnm7jgm9kxyi2lf971x52bmxhm5mcwd4k3akf8"; + procMacro = true; + authors = [ + "Erick Tryzelaar " + "David Tolnay " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "visit" ]; + } + ]; + features = { + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "serde_json" = rec { + crateName = "serde_json"; + version = "1.0.60"; + edition = "2018"; + sha256 = "0yapc7xxk8dx12691yj0l13008rgvknmc6krvk8jwj7y4x6yh00m"; + authors = [ + "Erick Tryzelaar " + "David Tolnay " + ]; + dependencies = [ + { + name = "itoa"; + packageId = "itoa"; + usesDefaultFeatures = false; + } + { + name = "ryu"; + packageId = "ryu"; + } + { + name = "serde"; + packageId = "serde"; + usesDefaultFeatures = false; + } + ]; + features = { + "alloc" = [ "serde/alloc" ]; + "default" = [ "std" ]; + "preserve_order" = [ "indexmap" ]; + "std" = [ "serde/std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "signal-hook-registry" = rec { + crateName = "signal-hook-registry"; + version = "1.2.2"; + edition = "2015"; + sha256 = "1ar0dd9q1w952knhs0fx7qfh4iq5jvcvwkw1xg5fmmandh6flcnf"; + authors = [ + "Michal 'vorner' Vaner " + "Masaki Hara " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + } + ]; + + }; + "slab" = rec { + crateName = "slab"; + version = "0.4.2"; + edition = "2015"; + sha256 = "1y59xsa27jk84sxzswjk60xcjf8b4fm5960jwpznrrcmasyva4f1"; + authors = [ + "Carl Lerche " + ]; + + }; + "smallvec" = rec { + crateName = "smallvec"; + version = "1.5.1"; + edition = "2018"; + sha256 = "0xcxvc2lh2fj02d91v4dx1l4q14m5rb4yac788bhwxvxdl2lylmf"; + authors = [ + "The Servo Project Developers" + ]; + features = { + }; + }; + "snafu" = rec { + crateName = "snafu"; + version = "0.6.10"; + edition = "2018"; + sha256 = "19wwqxwb85pl040qk5xylj0vlznib3xzy9hcv2q0h8qv4qy2vcga"; + authors = [ + "Jake Goulding " + ]; + dependencies = [ + { + name = "doc-comment"; + packageId = "doc-comment"; + usesDefaultFeatures = false; + } + { + name = "snafu-derive"; + packageId = "snafu-derive"; + } + ]; + features = { + "backtraces" = [ "std" "backtrace" ]; + "backtraces-impl-backtrace-crate" = [ "backtraces" ]; + "default" = [ "std" "guide" ]; + "futures" = [ "futures-core-crate" "pin-project" ]; + "futures-01" = [ "futures-01-crate" ]; + "internal-dev-dependencies" = [ "futures-crate" ]; + "unstable-backtraces-impl-std" = [ "backtraces" "snafu-derive/unstable-backtraces-impl-std" ]; + }; + resolvedDefaultFeatures = [ "default" "guide" "std" ]; + }; + "snafu-derive" = rec { + crateName = "snafu-derive"; + version = "0.6.10"; + edition = "2018"; + sha256 = "0nri7ma06g5kimpcdcm8359a55nmps5f3kcngy0j6bin7jhfy20m"; + procMacro = true; + authors = [ + "Jake Goulding " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" ]; + } + ]; + features = { + }; + }; + "socket2" = rec { + crateName = "socket2"; + version = "0.3.17"; + edition = "2018"; + sha256 = "00k98q2ab98j9ffmmsh0wlwck2apy83a7v5bfy122apfpmx98a9c"; + authors = [ + "Alex Crichton " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 1.0.0"; + target = { target, features }: (target."unix" || (target."os" == "redox")); + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: (target."unix" || (target."os" == "redox")); + features = [ "align" ]; + } + { + name = "redox_syscall"; + packageId = "redox_syscall"; + target = { target, features }: (target."os" == "redox"); + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "handleapi" "ws2def" "ws2ipdef" "ws2tcpip" "minwindef" ]; + } + ]; + features = { + }; + }; + "strsim" = rec { + crateName = "strsim"; + version = "0.8.0"; + edition = "2015"; + sha256 = "0sjsm7hrvjdifz661pjxq5w4hf190hx53fra8dfvamacvff139cf"; + authors = [ + "Danny Guo " + ]; + + }; + "syn" = rec { + crateName = "syn"; + version = "1.0.54"; + edition = "2018"; + sha256 = "0i3z22zvzzsmrsbhi0ivpmv71fgxkcywjnf3alid8srxlrbzjals"; + authors = [ + "David Tolnay " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + usesDefaultFeatures = false; + } + { + name = "quote"; + packageId = "quote"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "unicode-xid"; + packageId = "unicode-xid"; + } + ]; + features = { + "default" = [ "derive" "parsing" "printing" "clone-impls" "proc-macro" ]; + "printing" = [ "quote" ]; + "proc-macro" = [ "proc-macro2/proc-macro" "quote/proc-macro" ]; + "test" = [ "syn-test-suite/all-features" ]; + }; + resolvedDefaultFeatures = [ "clone-impls" "default" "derive" "full" "parsing" "printing" "proc-macro" "quote" "visit" "visit-mut" ]; + }; + "tempfile" = rec { + crateName = "tempfile"; + version = "3.1.0"; + edition = "2018"; + sha256 = "1a9cfdqw70n7bcnkx05aih9xdba8lqazmqlkjpkmn2la6gcj8vks"; + authors = [ + "Steven Allen " + "The Rust Project Developers" + "Ashley Mannix " + "Jason White " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if 0.1.10"; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: target."unix"; + } + { + name = "rand"; + packageId = "rand"; + } + { + name = "redox_syscall"; + packageId = "redox_syscall"; + target = { target, features }: (target."os" == "redox"); + } + { + name = "remove_dir_all"; + packageId = "remove_dir_all"; + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "fileapi" "handleapi" "winbase" ]; + } + ]; + + }; + "terminal_size" = rec { + crateName = "terminal_size"; + version = "0.1.15"; + edition = "2018"; + sha256 = "1qfb07d040wh3m4yfnbxknda7i5fr56ypnwdwdgmzb1zpn1x3ljb"; + authors = [ + "Andrew Chin " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + target = { target, features }: (!target."windows"); + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "handleapi" "processenv" "winbase" "wincon" "winnt" ]; + } + ]; + + }; + "textwrap" = rec { + crateName = "textwrap"; + version = "0.11.0"; + edition = "2015"; + sha256 = "0q5hky03ik3y50s9sz25r438bc4nwhqc6dqwynv4wylc807n29nk"; + authors = [ + "Martin Geisler " + ]; + dependencies = [ + { + name = "unicode-width"; + packageId = "unicode-width"; + } + ]; + + }; + "tokio" = rec { + crateName = "tokio"; + version = "0.3.6"; + edition = "2018"; + sha256 = "0z78l7kn4y2qvghsp9dyqgvr1kjvv63pjq3d8nzi31q74lfa42vj"; + authors = [ + "Tokio Contributors " + ]; + dependencies = [ + { + name = "bytes"; + packageId = "bytes"; + optional = true; + } + { + name = "futures-core"; + packageId = "futures-core"; + optional = true; + } + { + name = "libc"; + packageId = "libc"; + optional = true; + target = { target, features }: target."unix"; + } + { + name = "memchr"; + packageId = "memchr"; + optional = true; + } + { + name = "mio"; + packageId = "mio"; + optional = true; + } + { + name = "num_cpus"; + packageId = "num_cpus"; + optional = true; + } + { + name = "once_cell"; + packageId = "once_cell"; + optional = true; + } + { + name = "parking_lot"; + packageId = "parking_lot"; + optional = true; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + } + { + name = "signal-hook-registry"; + packageId = "signal-hook-registry"; + optional = true; + target = { target, features }: target."unix"; + } + { + name = "slab"; + packageId = "slab"; + optional = true; + } + { + name = "tokio-macros"; + packageId = "tokio-macros"; + optional = true; + } + { + name = "winapi"; + packageId = "winapi"; + optional = true; + usesDefaultFeatures = false; + target = { target, features }: target."windows"; + } + ]; + buildDependencies = [ + { + name = "autocfg"; + packageId = "autocfg"; + } + ]; + devDependencies = [ + { + name = "libc"; + packageId = "libc"; + target = {target, features}: target."unix"; + } + ]; + features = { + "full" = [ "fs" "io-util" "io-std" "macros" "net" "parking_lot" "process" "rt" "rt-multi-thread" "signal" "stream" "sync" "time" ]; + "io-util" = [ "memchr" "bytes" ]; + "macros" = [ "tokio-macros" ]; + "net" = [ "libc" "mio/os-poll" "mio/os-util" "mio/tcp" "mio/udp" "mio/uds" ]; + "process" = [ "bytes" "once_cell" "libc" "mio/os-poll" "mio/os-util" "mio/uds" "signal-hook-registry" "winapi/threadpoollegacyapiset" ]; + "rt" = [ "slab" ]; + "rt-multi-thread" = [ "num_cpus" "rt" ]; + "signal" = [ "once_cell" "libc" "mio/os-poll" "mio/uds" "mio/os-util" "signal-hook-registry" "winapi/consoleapi" ]; + "stream" = [ "futures-core" ]; + }; + resolvedDefaultFeatures = [ "bytes" "default" "fs" "full" "futures-core" "io-std" "io-util" "libc" "macros" "memchr" "mio" "net" "num_cpus" "once_cell" "parking_lot" "process" "rt" "rt-multi-thread" "signal" "signal-hook-registry" "slab" "stream" "sync" "time" "tokio-macros" "winapi" ]; + }; + "tokio-macros" = rec { + crateName = "tokio-macros"; + version = "0.3.1"; + edition = "2018"; + sha256 = "0iaw1k9qcn3fjgl4qcqwl8if8jjdkldam4cn0j8qybfwnpdhzlr1"; + procMacro = true; + authors = [ + "Tokio Contributors " + ]; + dependencies = [ + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn"; + features = [ "full" ]; + } + ]; + + }; + "unicode-width" = rec { + crateName = "unicode-width"; + version = "0.1.8"; + edition = "2015"; + sha256 = "1qxizyi6xbcqyi4z79p523ywvmgsfcgfqb3zv3c8i6x1jcc5jdwk"; + authors = [ + "kwantam " + "Manish Goregaokar " + ]; + features = { + "rustc-dep-of-std" = [ "std" "core" "compiler_builtins" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "unicode-xid" = rec { + crateName = "unicode-xid"; + version = "0.2.1"; + edition = "2015"; + sha256 = "0r6mknipyy9vpz8mwmxvkx65ff2ha1n2pxqjj6f46lcn8yrhpzpp"; + authors = [ + "erick.tryzelaar " + "kwantam " + ]; + features = { + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "vec_map" = rec { + crateName = "vec_map"; + version = "0.8.2"; + edition = "2015"; + sha256 = "1481w9g1dw9rxp3l6snkdqihzyrd2f8vispzqmwjwsdyhw8xzggi"; + authors = [ + "Alex Crichton " + "Jorge Aparicio " + "Alexis Beingessner " + "Brian Anderson <>" + "tbu- <>" + "Manish Goregaokar <>" + "Aaron Turon " + "Adolfo Ochagavía <>" + "Niko Matsakis <>" + "Steven Fackler <>" + "Chase Southwood " + "Eduard Burtescu <>" + "Florian Wilkens <>" + "Félix Raimundo <>" + "Tibor Benke <>" + "Markus Siemens " + "Josh Branchaud " + "Huon Wilson " + "Corey Farwell " + "Aaron Liblong <>" + "Nick Cameron " + "Patrick Walton " + "Felix S Klock II <>" + "Andrew Paseltiner " + "Sean McArthur " + "Vadim Petrochenkov <>" + ]; + features = { + "eders" = [ "serde" ]; + }; + }; + "wasi" = rec { + crateName = "wasi"; + version = "0.9.0+wasi-snapshot-preview1"; + edition = "2018"; + sha256 = "06g5v3vrdapfzvfq662cij7v8a1flwr2my45nnncdv2galrdzkfc"; + authors = [ + "The Cranelift Project Developers" + ]; + features = { + "default" = [ "std" ]; + "rustc-dep-of-std" = [ "compiler_builtins" "core" "rustc-std-workspace-alloc" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "winapi" = rec { + crateName = "winapi"; + version = "0.3.9"; + edition = "2015"; + sha256 = "06gl025x418lchw1wxj64ycr7gha83m44cjr5sarhynd9xkrm0sw"; + authors = [ + "Peter Atashian " + ]; + dependencies = [ + { + name = "winapi-i686-pc-windows-gnu"; + packageId = "winapi-i686-pc-windows-gnu"; + target = { target, features }: (stdenv.hostPlatform.config == "i686-pc-windows-gnu"); + } + { + name = "winapi-x86_64-pc-windows-gnu"; + packageId = "winapi-x86_64-pc-windows-gnu"; + target = { target, features }: (stdenv.hostPlatform.config == "x86_64-pc-windows-gnu"); + } + ]; + features = { + "debug" = [ "impl-debug" ]; + }; + resolvedDefaultFeatures = [ "cfg" "consoleapi" "errhandlingapi" "evntrace" "fileapi" "handleapi" "in6addr" "inaddr" "ioapiset" "minwinbase" "minwindef" "mswsock" "namedpipeapi" "ntdef" "ntsecapi" "ntstatus" "processenv" "std" "synchapi" "threadpoollegacyapiset" "winbase" "wincon" "windef" "winerror" "winioctl" "winnt" "winsock2" "winuser" "ws2def" "ws2ipdef" "ws2tcpip" ]; + }; + "winapi-i686-pc-windows-gnu" = rec { + crateName = "winapi-i686-pc-windows-gnu"; + version = "0.4.0"; + edition = "2015"; + sha256 = "1dmpa6mvcvzz16zg6d5vrfy4bxgg541wxrcip7cnshi06v38ffxc"; + authors = [ + "Peter Atashian " + ]; + + }; + "winapi-util" = rec { + crateName = "winapi-util"; + version = "0.1.5"; + edition = "2018"; + sha256 = "0y71bp7f6d536czj40dhqk0d55wfbbwqfp2ymqf1an5ibgl6rv3h"; + authors = [ + "Andrew Gallant " + ]; + dependencies = [ + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: target."windows"; + features = [ "std" "consoleapi" "errhandlingapi" "fileapi" "minwindef" "processenv" "winbase" "wincon" "winerror" "winnt" ]; + } + ]; + + }; + "winapi-x86_64-pc-windows-gnu" = rec { + crateName = "winapi-x86_64-pc-windows-gnu"; + version = "0.4.0"; + edition = "2015"; + sha256 = "0gqq64czqb64kskjryj8isp62m2sgvx25yyj3kpc2myh85w24bki"; + authors = [ + "Peter Atashian " + ]; + + }; + }; + + # +# crate2nix/default.nix (excerpt start) +# + + /* Target (platform) data for conditional dependencies. + This corresponds roughly to what buildRustCrate is setting. + */ + defaultTarget = { + unix = true; + windows = false; + fuchsia = true; + test = false; + + # This doesn't appear to be officially documented anywhere yet. + # See https://github.com/rust-lang-nursery/rust-forge/issues/101. + os = + if stdenv.hostPlatform.isDarwin + then "macos" + else stdenv.hostPlatform.parsed.kernel.name; + arch = stdenv.hostPlatform.parsed.cpu.name; + family = "unix"; + env = "gnu"; + endian = + if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" + then "little" else "big"; + pointer_width = toString stdenv.hostPlatform.parsed.cpu.bits; + vendor = stdenv.hostPlatform.parsed.vendor.name; + debug_assertions = false; + }; + + /* Filters common temp files and build files. */ + # TODO(pkolloch): Substitute with gitignore filter + sourceFilter = name: type: + let + baseName = builtins.baseNameOf (builtins.toString name); + in + ! ( + # Filter out git + baseName == ".gitignore" + || (type == "directory" && baseName == ".git") + + # Filter out build results + || ( + type == "directory" && ( + baseName == "target" + || baseName == "_site" + || baseName == ".sass-cache" + || baseName == ".jekyll-metadata" + || baseName == "build-artifacts" + ) + ) + + # Filter out nix-build result symlinks + || ( + type == "symlink" && lib.hasPrefix "result" baseName + ) + + # Filter out IDE config + || ( + type == "directory" && ( + baseName == ".idea" || baseName == ".vscode" + ) + ) || lib.hasSuffix ".iml" baseName + + # Filter out nix build files + || baseName == "Cargo.nix" + + # Filter out editor backup / swap files. + || lib.hasSuffix "~" baseName + || builtins.match "^\\.sw[a-z]$$" baseName != null + || builtins.match "^\\..*\\.sw[a-z]$$" baseName != null + || lib.hasSuffix ".tmp" baseName + || lib.hasSuffix ".bak" baseName + || baseName == "tests.nix" + ); + + /* Returns a crate which depends on successful test execution + of crate given as the second argument. + + testCrateFlags: list of flags to pass to the test exectuable + testInputs: list of packages that should be available during test execution + */ + crateWithTest = { crate, testCrate, testCrateFlags, testInputs }: + assert builtins.typeOf testCrateFlags == "list"; + assert builtins.typeOf testInputs == "list"; + let + # override the `crate` so that it will build and execute tests instead of + # building the actual lib and bin targets We just have to pass `--test` + # to rustc and it will do the right thing. We execute the tests and copy + # their log and the test executables to $out for later inspection. + test = + let + drv = testCrate.override + ( + _: { + buildTests = true; + } + ); + in + pkgs.runCommand "run-tests-${testCrate.name}" + { + inherit testCrateFlags; + buildInputs = testInputs; + } '' + set -ex + + export RUST_BACKTRACE=1 + + # recreate a file hierarchy as when running tests with cargo + + # the source for test data + ${pkgs.xorg.lndir}/bin/lndir ${crate.src} + + # build outputs + testRoot=target/debug + mkdir -p $testRoot + + # executables of the crate + # we copy to prevent std::env::current_exe() to resolve to a store location + for i in ${crate}/bin/*; do + cp "$i" "$testRoot" + done + chmod +w -R . + + # test harness executables are suffixed with a hash, like cargo does + # this allows to prevent name collision with the main + # executables of the crate + hash=$(basename $out) + for file in ${drv}/tests/*; do + f=$testRoot/$(basename $file)-$hash + cp $file $f + $f $testCrateFlags 2>&1 | tee -a $out + done + ''; + in + pkgs.runCommand "${crate.name}-linked" + { + inherit (crate) outputs crateName; + passthru = (crate.passthru or { }) // { + inherit test; + }; + } '' + echo tested by ${test} + ${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs} + ''; + + /* A restricted overridable version of builtRustCratesWithFeatures. */ + buildRustCrateWithFeatures = + { packageId + , features ? rootFeatures + , crateOverrides ? defaultCrateOverrides + , buildRustCrateFunc ? null + , runTests ? false + , testCrateFlags ? [ ] + , testInputs ? [ ] + }: + lib.makeOverridable + ( + { features + , crateOverrides + , runTests + , testCrateFlags + , testInputs + }: + let + buildRustCrateFuncOverriden = + if buildRustCrateFunc != null + then buildRustCrateFunc + else + ( + if crateOverrides == pkgs.defaultCrateOverrides + then buildRustCrate + else + buildRustCrate.override { + defaultCrateOverrides = crateOverrides; + } + ); + builtRustCrates = builtRustCratesWithFeatures { + inherit packageId features; + buildRustCrateFunc = buildRustCrateFuncOverriden; + runTests = false; + }; + builtTestRustCrates = builtRustCratesWithFeatures { + inherit packageId features; + buildRustCrateFunc = buildRustCrateFuncOverriden; + runTests = true; + }; + drv = builtRustCrates.${packageId}; + testDrv = builtTestRustCrates.${packageId}; + derivation = + if runTests then + crateWithTest + { + crate = drv; + testCrate = testDrv; + inherit testCrateFlags testInputs; + } + else drv; + in + derivation + ) + { inherit features crateOverrides runTests testCrateFlags testInputs; }; + + /* Returns an attr set with packageId mapped to the result of buildRustCrateFunc + for the corresponding crate. + */ + builtRustCratesWithFeatures = + { packageId + , features + , crateConfigs ? crates + , buildRustCrateFunc + , runTests + , target ? defaultTarget + } @ args: + assert (builtins.isAttrs crateConfigs); + assert (builtins.isString packageId); + assert (builtins.isList features); + assert (builtins.isAttrs target); + assert (builtins.isBool runTests); + let + rootPackageId = packageId; + mergedFeatures = mergePackageFeatures + ( + args // { + inherit rootPackageId; + target = target // { test = runTests; }; + } + ); + buildByPackageId = packageId: buildByPackageIdImpl packageId; + + # Memoize built packages so that reappearing packages are only built once. + builtByPackageId = + lib.mapAttrs (packageId: value: buildByPackageId packageId) crateConfigs; + buildByPackageIdImpl = packageId: + let + features = mergedFeatures."${packageId}" or [ ]; + crateConfig' = crateConfigs."${packageId}"; + crateConfig = + builtins.removeAttrs crateConfig' [ "resolvedDefaultFeatures" "devDependencies" ]; + devDependencies = + lib.optionals + (runTests && packageId == rootPackageId) + (crateConfig'.devDependencies or [ ]); + dependencies = + dependencyDerivations { + inherit builtByPackageId features target; + dependencies = + (crateConfig.dependencies or [ ]) + ++ devDependencies; + }; + buildDependencies = + dependencyDerivations { + inherit builtByPackageId features target; + dependencies = crateConfig.buildDependencies or [ ]; + }; + filterEnabledDependenciesForThis = dependencies: filterEnabledDependencies { + inherit dependencies features target; + }; + dependenciesWithRenames = + lib.filter (d: d ? "rename") + ( + filterEnabledDependenciesForThis + ( + (crateConfig.buildDependencies or [ ]) + ++ (crateConfig.dependencies or [ ]) + ++ devDependencies + ) + ); + # Crate renames have the form: + # + # { + # crate_name = [ + # { version = "1.2.3"; rename = "crate_name01"; } + # ]; + # # ... + # } + crateRenames = + let + grouped = + lib.groupBy + (dependency: dependency.name) + dependenciesWithRenames; + versionAndRename = dep: + let + package = builtByPackageId."${dep.packageId}"; + in + { inherit (dep) rename; version = package.version; }; + in + lib.mapAttrs (name: choices: builtins.map versionAndRename choices) grouped; + in + buildRustCrateFunc + ( + crateConfig // { + src = crateConfig.src or ( + pkgs.fetchurl rec { + name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; + # https://www.pietroalbini.org/blog/downloading-crates-io/ + # Not rate-limited, CDN URL. + url = "https://static.crates.io/crates/${crateConfig.crateName}/${crateConfig.crateName}-${crateConfig.version}.crate"; + sha256 = + assert (lib.assertMsg (crateConfig ? sha256) "Missing sha256 for ${name}"); + crateConfig.sha256; + } + ); + extraRustcOpts = lib.lists.optional (targetFeatures != [ ]) "-C target-feature=${stdenv.lib.concatMapStringsSep "," (x: "+${x}") targetFeatures}"; + inherit features dependencies buildDependencies crateRenames release; + } + ); + in + builtByPackageId; + + /* Returns the actual derivations for the given dependencies. */ + dependencyDerivations = + { builtByPackageId + , features + , dependencies + , target + }: + assert (builtins.isAttrs builtByPackageId); + assert (builtins.isList features); + assert (builtins.isList dependencies); + assert (builtins.isAttrs target); + let + enabledDependencies = filterEnabledDependencies { + inherit dependencies features target; + }; + depDerivation = dependency: builtByPackageId.${dependency.packageId}; + in + map depDerivation enabledDependencies; + + /* Returns a sanitized version of val with all values substituted that cannot + be serialized as JSON. + */ + sanitizeForJson = val: + if builtins.isAttrs val + then lib.mapAttrs (n: v: sanitizeForJson v) val + else if builtins.isList val + then builtins.map sanitizeForJson val + else if builtins.isFunction val + then "function" + else val; + + /* Returns various tools to debug a crate. */ + debugCrate = { packageId, target ? defaultTarget }: + assert (builtins.isString packageId); + let + debug = rec { + # The built tree as passed to buildRustCrate. + buildTree = buildRustCrateWithFeatures { + buildRustCrateFunc = lib.id; + inherit packageId; + }; + sanitizedBuildTree = sanitizeForJson buildTree; + dependencyTree = sanitizeForJson + ( + buildRustCrateWithFeatures { + buildRustCrateFunc = crate: { + "01_crateName" = crate.crateName or false; + "02_features" = crate.features or [ ]; + "03_dependencies" = crate.dependencies or [ ]; + }; + inherit packageId; + } + ); + mergedPackageFeatures = mergePackageFeatures { + features = rootFeatures; + inherit packageId target; + }; + diffedDefaultPackageFeatures = diffDefaultPackageFeatures { + inherit packageId target; + }; + }; + in + { internal = debug; }; + + /* Returns differences between cargo default features and crate2nix default + features. + + This is useful for verifying the feature resolution in crate2nix. + */ + diffDefaultPackageFeatures = + { crateConfigs ? crates + , packageId + , target + }: + assert (builtins.isAttrs crateConfigs); + let + prefixValues = prefix: lib.mapAttrs (n: v: { "${prefix}" = v; }); + mergedFeatures = + prefixValues + "crate2nix" + (mergePackageFeatures { inherit crateConfigs packageId target; features = [ "default" ]; }); + configs = prefixValues "cargo" crateConfigs; + combined = lib.foldAttrs (a: b: a // b) { } [ mergedFeatures configs ]; + onlyInCargo = + builtins.attrNames + (lib.filterAttrs (n: v: !(v ? "crate2nix") && (v ? "cargo")) combined); + onlyInCrate2Nix = + builtins.attrNames + (lib.filterAttrs (n: v: (v ? "crate2nix") && !(v ? "cargo")) combined); + differentFeatures = lib.filterAttrs + ( + n: v: + (v ? "crate2nix") + && (v ? "cargo") + && (v.crate2nix.features or [ ]) != (v."cargo".resolved_default_features or [ ]) + ) + combined; + in + builtins.toJSON { + inherit onlyInCargo onlyInCrate2Nix differentFeatures; + }; + + /* Returns an attrset mapping packageId to the list of enabled features. + + If multiple paths to a dependency enable different features, the + corresponding feature sets are merged. Features in rust are additive. + */ + mergePackageFeatures = + { crateConfigs ? crates + , packageId + , rootPackageId ? packageId + , features ? rootFeatures + , dependencyPath ? [ crates.${packageId}.crateName ] + , featuresByPackageId ? { } + , target + # Adds devDependencies to the crate with rootPackageId. + , runTests ? false + , ... + } @ args: + assert (builtins.isAttrs crateConfigs); + assert (builtins.isString packageId); + assert (builtins.isString rootPackageId); + assert (builtins.isList features); + assert (builtins.isList dependencyPath); + assert (builtins.isAttrs featuresByPackageId); + assert (builtins.isAttrs target); + assert (builtins.isBool runTests); + let + crateConfig = crateConfigs."${packageId}" or (builtins.throw "Package not found: ${packageId}"); + expandedFeatures = expandFeatures (crateConfig.features or { }) features; + depWithResolvedFeatures = dependency: + let + packageId = dependency.packageId; + features = dependencyFeatures expandedFeatures dependency; + in + { inherit packageId features; }; + resolveDependencies = cache: path: dependencies: + assert (builtins.isAttrs cache); + assert (builtins.isList dependencies); + let + enabledDependencies = filterEnabledDependencies { + inherit dependencies target; + features = expandedFeatures; + }; + directDependencies = map depWithResolvedFeatures enabledDependencies; + foldOverCache = op: lib.foldl op cache directDependencies; + in + foldOverCache + ( + cache: { packageId, features }: + let + cacheFeatures = cache.${packageId} or [ ]; + combinedFeatures = sortedUnique (cacheFeatures ++ features); + in + if cache ? ${packageId} && cache.${packageId} == combinedFeatures + then cache + else + mergePackageFeatures { + features = combinedFeatures; + featuresByPackageId = cache; + inherit crateConfigs packageId target runTests rootPackageId; + } + ); + cacheWithSelf = + let + cacheFeatures = featuresByPackageId.${packageId} or [ ]; + combinedFeatures = sortedUnique (cacheFeatures ++ expandedFeatures); + in + featuresByPackageId // { + "${packageId}" = combinedFeatures; + }; + cacheWithDependencies = + resolveDependencies cacheWithSelf "dep" + ( + crateConfig.dependencies or [ ] + ++ lib.optionals + (runTests && packageId == rootPackageId) + (crateConfig.devDependencies or [ ]) + ); + cacheWithAll = + resolveDependencies + cacheWithDependencies "build" + (crateConfig.buildDependencies or [ ]); + in + cacheWithAll; + + /* Returns the enabled dependencies given the enabled features. */ + filterEnabledDependencies = { dependencies, features, target }: + assert (builtins.isList dependencies); + assert (builtins.isList features); + assert (builtins.isAttrs target); + + lib.filter + ( + dep: + let + targetFunc = dep.target or (features: true); + in + targetFunc { inherit features target; } + && ( + !(dep.optional or false) + || builtins.any (doesFeatureEnableDependency dep) features + ) + ) + dependencies; + + /* Returns whether the given feature should enable the given dependency. */ + doesFeatureEnableDependency = { name, rename ? null, ... }: feature: + let + prefix = "${name}/"; + len = builtins.stringLength prefix; + startsWithPrefix = builtins.substring 0 len feature == prefix; + in + (rename == null && feature == name) + || (rename != null && rename == feature) + || startsWithPrefix; + + /* Returns the expanded features for the given inputFeatures by applying the + rules in featureMap. + + featureMap is an attribute set which maps feature names to lists of further + feature names to enable in case this feature is selected. + */ + expandFeatures = featureMap: inputFeatures: + assert (builtins.isAttrs featureMap); + assert (builtins.isList inputFeatures); + let + expandFeature = feature: + assert (builtins.isString feature); + [ feature ] ++ (expandFeatures featureMap (featureMap."${feature}" or [ ])); + outFeatures = lib.concatMap expandFeature inputFeatures; + in + sortedUnique outFeatures; + + /* + Returns the actual features for the given dependency. + + features: The features of the crate that refers this dependency. + */ + dependencyFeatures = features: dependency: + assert (builtins.isList features); + assert (builtins.isAttrs dependency); + let + defaultOrNil = + if dependency.usesDefaultFeatures or true + then [ "default" ] + else [ ]; + explicitFeatures = dependency.features or [ ]; + additionalDependencyFeatures = + let + dependencyPrefix = (dependency.rename or dependency.name) + "/"; + dependencyFeatures = + builtins.filter (f: lib.hasPrefix dependencyPrefix f) features; + in + builtins.map (lib.removePrefix dependencyPrefix) dependencyFeatures; + in + defaultOrNil ++ explicitFeatures ++ additionalDependencyFeatures; + + /* Sorts and removes duplicates from a list of strings. */ + sortedUnique = features: + assert (builtins.isList features); + assert (builtins.all builtins.isString features); + let + outFeaturesSet = lib.foldl (set: feature: set // { "${feature}" = 1; }) { } features; + outFeaturesUnique = builtins.attrNames outFeaturesSet; + in + builtins.sort (a: b: a < b) outFeaturesUnique; + + deprecationWarning = message: value: + if strictDeprecation + then builtins.throw "strictDeprecation enabled, aborting: ${message}" + else builtins.trace message value; + + # + # crate2nix/default.nix (excerpt end) + # + + }; +} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..f930ad2 --- /dev/null +++ b/default.nix @@ -0,0 +1,5 @@ +{ + pkgs ? import ./pkgs.nix, +}: let + cargo = pkgs.callPackage ./Cargo.nix {}; +in cargo.rootCrate.build diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 0000000..f2d8a9f --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,50 @@ +{ + "crate2nix": { + "branch": "master", + "description": "nix build file generator for rust crates", + "homepage": "", + "owner": "kolloch", + "repo": "crate2nix", + "rev": "0c81027889259c6a45221a157f9c4a56e7235c85", + "sha256": "0wp1i83ralnz0v6a95122d0hfzwlg1281lvv3mzrxcxl8mka8z3n", + "type": "tarball", + "url": "https://github.com/kolloch/crate2nix/archive/0c81027889259c6a45221a157f9c4a56e7235c85.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "niv": { + "branch": "master", + "description": "Easy dependency management for Nix projects", + "homepage": "https://github.com/nmattia/niv", + "owner": "nmattia", + "repo": "niv", + "rev": "ba57d5a29b4e0f2085917010380ef3ddc3cf380f", + "sha256": "1kpsvc53x821cmjg1khvp1nz7906gczq8mp83664cr15h94sh8i4", + "type": "tarball", + "url": "https://github.com/nmattia/niv/archive/ba57d5a29b4e0f2085917010380ef3ddc3cf380f.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs": { + "branch": "nixos-20.09", + "description": "Nix Packages collection", + "homepage": "", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b94726217f7cdc02ddf277b65553762d520da196", + "sha256": "1v3v7f2apmsdwv1w6hvsxr8whggjbiaxy00k47pxdzyigxv3s400", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/b94726217f7cdc02ddf277b65553762d520da196.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nixpkgs-mozilla": { + "branch": "master", + "description": "mozilla related nixpkgs (extends nixos/nixpkgs repo)", + "homepage": null, + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "rev": "8c007b60731c07dd7a052cce508de3bb1ae849b4", + "sha256": "1zybp62zz0h077zm2zmqs2wcg3whg6jqaah9hcl1gv4x8af4zhs6", + "type": "tarball", + "url": "https://github.com/mozilla/nixpkgs-mozilla/archive/8c007b60731c07dd7a052cce508de3bb1ae849b4.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 0000000..b796fff --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,171 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + + fetch_tarball = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + + fetch_git = name: spec: + let + ref = + if spec ? ref then spec.ref else + if spec ? branch then "refs/heads/${spec.branch}" else + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + in + builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + + fetch_local = spec: spec.path; + + fetch_builtin-tarball = name: throw + ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; + + fetch_builtin-url = name: throw + ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; + + # + # Various helpers + # + + # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 + sanitizeName = name: + ( + concatMapStrings (s: if builtins.isList s then "-" else s) + ( + builtins.split "[^[:alnum:]+._?=-]+" + ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) + ) + ); + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: system: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs name spec + else if spec.type == "tarball" then fetch_tarball pkgs name spec + else if spec.type == "git" then fetch_git name spec + else if spec.type == "local" then fetch_local spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball name + else if spec.type == "builtin-url" then fetch_builtin-url name + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # If the environment variable NIV_OVERRIDE_${name} is set, then use + # the path directly as opposed to the fetched source. + replace = name: drv: + let + saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; + in + if ersatz == "" then drv else ersatz; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatMapStrings = f: list: concatStrings (map f list); + concatStrings = builtins.concatStringsSep ""; + + # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 + optionalAttrs = cond: as: if cond then as else {}; + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs ( + name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null + , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , system ? builtins.currentSystem + , pkgs ? mkPkgs sources system + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; + +in +mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/pkgs.nix b/pkgs.nix new file mode 100644 index 0000000..26bb456 --- /dev/null +++ b/pkgs.nix @@ -0,0 +1,22 @@ +{ + sources ? import ./nix/sources.nix, + rustNightly ? "2020-11-10", +}: let + pkgs = import sources.nixpkgs { + overlays = [ + (import sources.nixpkgs-mozilla) + (self: super: let + rustChannel = super.rustChannelOf { + channel = "nightly"; + date = rustNightly; + }; + in rec { + rustc = rustChannel.rust.override { + extensions = [ "rust-src" ]; + }; + inherit (rustChannel) cargo rust-fmt rust-std clippy; + crate2nix = super.callPackage sources.crate2nix {}; + }) + ]; + }; +in pkgs diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..c3260a2 --- /dev/null +++ b/shell.nix @@ -0,0 +1,8 @@ +let + pkgs = import ./pkgs.nix {}; +in pkgs.mkShell { + buildInputs = with pkgs; [ + #rust + crate2nix + ]; +} diff --git a/test-shell.nix b/test-shell.nix new file mode 100644 index 0000000..812d748 --- /dev/null +++ b/test-shell.nix @@ -0,0 +1,7 @@ +let + pkgs = import ./pkgs.nix {}; +in pkgs.mkShell { + buildInputs = with pkgs; [ + (import ./Cargo.nix {}).rootCrate.build + ]; +}