diff --git a/Cargo.lock b/Cargo.lock index e0a5f1d0..72a25cf9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,13 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "arrayref" version = "0.3.6" @@ -10,6 +18,41 @@ name = "arrayvec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blake3" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "blake3" version = "0.3.3" @@ -63,11 +106,68 @@ name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "clap" +version = "2.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crypto-mac" version = "0.7.0" @@ -85,6 +185,11 @@ dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fake-simd" version = "0.1.2" @@ -98,11 +203,61 @@ dependencies = [ "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hermit-abi" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "index-fixed" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "libc" version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "numtoa" version = "0.1.0" @@ -124,6 +279,29 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pkgar" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "blake3 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", + "plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ppv-lite86" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc-macro2" version = "1.0.13" @@ -140,12 +318,72 @@ dependencies = [ "proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_cookbook" version = "0.1.0" dependencies = [ "blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -165,6 +403,11 @@ dependencies = [ "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "serde" version = "1.0.110" @@ -194,6 +437,19 @@ dependencies = [ "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sodalite" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "index-fixed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "subtle" version = "1.0.0" @@ -220,6 +476,14 @@ dependencies = [ "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "time" version = "0.1.43" @@ -242,11 +506,26 @@ name = "typenum" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.3.8" @@ -267,8 +546,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum blake3 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "667d945f23cefed0b5f973af35c4bc3319caa6776fbda270e4897d8504afa8e4" "checksum blake3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "68df31bdf2bbb567e5adf8f21ac125dc0e897b1381e7b841f181521f06fc3134" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" @@ -276,29 +560,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" "checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +"checksum index-fixed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63adf4f50cae82ddb03b088a55172f5044e73c8f02d029e69780717f764bbfa" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4403eb718d70c03ee279e51737782902c68cca01e870a33b6a2f9dfb50b9cd83" +"checksum pkgar 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74003f2ac9baa8600352a677bd8763088cc35498a4364abe9ae5898832015bb9" +"checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +"checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" "checksum proc-macro2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "53f5ffe53a6b28e37c9c1ce74893477864d64f74778a93a4beb43c8fa167f639" "checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" "checksum serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" "checksum serde_derive 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)" = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" "checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +"checksum sodalite 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67643084c740297bac275b1d97901ec27ca5984be4e8f75d86a33498e0e3e61c" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "1425de3c33b0941002740a420b1a906a350b88d08b82b2c8a01035a3f9447bac" "checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" "checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" "checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 5b297bc9..34ce71a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ path = "src/lib.rs" [dependencies] blake3 = "0.3.3" pbr = "1.0.2" +pkgar = "0.1.6" serde = { version = "1.0", features = ["derive"] } sha2 = "0.8.1" termion = "1.5.5" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index e0ab5a4f..e9ed47e8 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -1,5 +1,5 @@ use cookbook::blake3::blake3_progress; -use cookbook::recipe::{Recipe, SourceRecipe, BuildRecipe}; +use cookbook::recipe::{Recipe, SourceRecipe, BuildKind, BuildRecipe, PackageRecipe}; use cookbook::sha256::sha256_progress; use std::{ env, @@ -276,6 +276,32 @@ fn fetch(recipe_dir: &Path, source: &SourceRecipe) -> Result { } fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + let sysroot_dir = recipe_dir.join("sysroot"); + if ! sysroot_dir.is_dir() { + // Create sysroot.tmp + let sysroot_dir_tmp = recipe_dir.join("sysroot.tmp"); + create_dir_clean(&sysroot_dir_tmp)?; + + for dependency in build.dependencies.iter() { + let public_path = "build/public.key"; + //TODO: sanitize name + let archive_path = format!("recipes/{}/stage.pkgar", dependency); + pkgar::bin::extract( + public_path, + &archive_path, + sysroot_dir_tmp.to_str().unwrap() + ).map_err(|err| format!( + "failed to install '{}' in '{}': {:?}", + archive_path, + sysroot_dir_tmp.display(), + err + ))?; + } + + // Move sysroot.tmp to sysroot atomically + rename(&sysroot_dir_tmp, &sysroot_dir)?; + } + let stage_dir = recipe_dir.join("stage"); if ! stage_dir.is_dir() { // Create stage.tmp @@ -291,8 +317,8 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + match &build.kind { + BuildKind::Cargo => { let mut command = Command::new("redoxer"); command.arg("install"); //TODO: --debug if desired @@ -301,7 +327,7 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result { + BuildKind::Configure => { //TODO: Add more configurability, convert script to Rust let mut command = Command::new("redoxer"); command.arg("env"); @@ -309,9 +335,11 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Result { + BuildKind::Custom { script } => { let mut command = Command::new("redoxer"); command.arg("env"); command.arg("bash").arg("-ex"); //TODO: remove unwraps command.env("COOKBOOK_STAGE", &stage_dir_tmp.canonicalize().unwrap()); command.env("COOKBOOK_SOURCE", &source_dir.canonicalize().unwrap()); + command.env("COOKBOOK_SYSROOT", &sysroot_dir.canonicalize().unwrap()); command.current_dir(&build_dir); run_command_stdin(command, script.as_bytes())?; }, @@ -352,38 +381,34 @@ fn build(recipe_dir: &Path, source_dir: &Path, build: &BuildRecipe) -> Result Result<(), String> { - //TODO: sanitize recipe name? - let recipe_dir = Path::new("recipes").join(recipe_name); - if ! recipe_dir.is_dir() { - return Err(format!( - "failed to find recipe directory '{}'", - recipe_dir.display() - )); +fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Result { + //TODO: metadata like dependencies, name, and version + + let secret_path = "build/secret.key"; + let public_path = "build/public.key"; + if ! Path::new(secret_path).is_file() || ! Path::new(public_path).is_file() { + pkgar::bin::keygen(secret_path, public_path).map_err(|err| format!( + "failed to generate pkgar keys: {:?}", + err + ))?; } - let recipe_file = recipe_dir.join("recipe.toml"); - if ! recipe_file.is_file() { - return Err(format!( - "failed to find recipe file '{}'", - recipe_file.display() - )); + let package_file = recipe_dir.join("stage.pkgar"); + if ! package_file.is_file() { + pkgar::bin::create( + secret_path, + package_file.to_str().unwrap(), + stage_dir.to_str().unwrap() + ).map_err(|err| format!( + "failed to create pkgar archive: {:?}", + err + ))?; } - let recipe_toml = fs::read_to_string(&recipe_file).map_err(|err| format!( - "failed to read recipe file '{}': {}\n{:#?}", - recipe_file.display(), - err, - err - ))?; - - let recipe: Recipe = toml::from_str(&recipe_toml).map_err(|err| format!( - "failed to parse recipe file '{}': {}\n{:#?}", - recipe_file.display(), - err, - err - ))?; + Ok(package_file) +} +fn cook(recipe_dir: &Path, recipe: &Recipe) -> Result<(), String> { let source_dir = fetch(&recipe_dir, &recipe.source).map_err(|err| format!( "failed to fetch: {}", err @@ -394,41 +419,151 @@ fn cook(recipe_name: &str) -> Result<(), String> { err ))?; + let package_file = package(&recipe_dir, &stage_dir, &recipe.package).map_err(|err| format!( + "failed to package: {}", + err + ))?; + Ok(()) } +pub struct CookRecipe { + name: String, + dir: PathBuf, + recipe: Recipe, +} + +impl CookRecipe { + pub fn new(name: String) -> Result { + //TODO: sanitize recipe name? + let dir = Path::new("recipes").join(&name); + if ! dir.is_dir() { + return Err(format!( + "failed to find recipe directory '{}'", + dir.display() + )); + } + + let file = dir.join("recipe.toml"); + if ! file.is_file() { + return Err(format!( + "failed to find recipe file '{}'", + file.display() + )); + } + + let toml = fs::read_to_string(&file).map_err(|err| format!( + "failed to read recipe file '{}': {}\n{:#?}", + file.display(), + err, + err + ))?; + + let recipe: Recipe = toml::from_str(&toml).map_err(|err| format!( + "failed to parse recipe file '{}': {}\n{:#?}", + file.display(), + err, + err + ))?; + + Ok(Self { + name, + dir, + recipe + }) + } + + //TODO: make this more efficient, smarter, and not return duplicates + pub fn new_recursive(names: &[String], recursion: usize) -> Result, String> { + if recursion == 0 { + return Err(format!( + "recursion limit while processing build dependencies: {:#?}", + names + )); + } + + let mut recipes = Vec::new(); + for name in names { + let recipe = Self::new(name.clone())?; + + let dependencies = Self::new_recursive( + &recipe.recipe.build.dependencies, + recursion - 1 + ).map_err(|err| format!( + "{}: failed on loading build dependencies:\n{}", + name, + err + ))?; + + for dependency in dependencies { + recipes.push(dependency); + } + + recipes.push(recipe); + } + + Ok(recipes) + } +} + fn main() { let mut matching = true; + let mut dry_run = false; let mut quiet = false; let mut recipe_names = Vec::new(); for arg in env::args().skip(1) { match arg.as_str() { "--" if matching => matching = false, + "-d" | "--dry-run" if matching => dry_run = true, "-q" | "--quiet" if matching => quiet = true, _ => recipe_names.push(arg), } } - for recipe_name in recipe_names.iter() { + let recipes = match CookRecipe::new_recursive(&recipe_names, 16) { + Ok(ok) => ok, + Err(err) => { + eprintln!( + "{}{}cook - error:{}{} {}", + style::Bold, + color::Fg(color::AnsiValue(196)), + color::Fg(color::Reset), + style::Reset, + err, + ); + process::exit(1); + } + }; + + for recipe in recipes { if ! quiet { eprintln!( "{}{}cook - {}{}{}", style::Bold, color::Fg(color::AnsiValue(215)), - recipe_name, + recipe.name, color::Fg(color::Reset), style::Reset, ); } - match cook(recipe_name) { + let res = if dry_run { + if ! quiet { + eprintln!("DRY RUN: {:#?}", recipe.recipe); + } + Ok(()) + } else { + cook(&recipe.dir, &recipe.recipe) + }; + + match res { Ok(()) => { if ! quiet { eprintln!( "{}{}cook - {} - successful{}{}", style::Bold, color::Fg(color::AnsiValue(46)), - recipe_name, + recipe.name, color::Fg(color::Reset), style::Reset, ); @@ -439,7 +574,7 @@ fn main() { "{}{}cook - {} - error:{}{} {}", style::Bold, color::Fg(color::AnsiValue(196)), - recipe_name, + recipe.name, color::Fg(color::Reset), style::Reset, err, diff --git a/src/recipe.rs b/src/recipe.rs index 0fee27d3..7385076b 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -35,7 +35,7 @@ pub enum SourceRecipe { /// Specifies how to build a recipe #[derive(Debug, Deserialize, PartialEq, Serialize)] #[serde(tag = "template")] -pub enum BuildRecipe { +pub enum BuildKind { /// Will build and install using cargo #[serde(rename = "cargo")] Cargo, @@ -49,6 +49,20 @@ pub enum BuildRecipe { }, } +#[derive(Debug, Deserialize, PartialEq, Serialize)] +pub struct BuildRecipe { + #[serde(flatten)] + pub kind: BuildKind, + #[serde(default)] + pub dependencies: Vec, +} + +#[derive(Debug, Default, Deserialize, PartialEq, Serialize)] +pub struct PackageRecipe { + #[serde(default)] + pub dependencies: Vec, +} + /// Everything required to build a Redox package #[derive(Debug, Deserialize, PartialEq, Serialize)] pub struct Recipe { @@ -56,6 +70,9 @@ pub struct Recipe { pub source: SourceRecipe, /// Specifies how to build this recipe pub build: BuildRecipe, + /// Specifies how to package this recipe + #[serde(default)] + pub package: PackageRecipe, } @@ -63,7 +80,7 @@ pub struct Recipe { mod tests { #[test] fn git_cargo_recipe() { - use crate::recipe::{Recipe, SourceRecipe, BuildRecipe}; + use crate::recipe::{Recipe, SourceRecipe, BuildKind, BuildRecipe, PackageRecipe}; let recipe: Recipe = toml::from_str(r#" [source] @@ -82,14 +99,19 @@ mod tests { branch: Some("master".to_string()), rev: Some("06344744d3d55a5ac9a62a6059cb363d40699bbc".to_string()), }, - patches: Vec::new(), - build: BuildRecipe::Cargo, + build: BuildRecipe { + kind: BuildKind::Cargo, + dependencies: Vec::new(), + }, + package: PackageRecipe { + dependencies: Vec::new(), + }, }); } #[test] fn tar_custom_recipe() { - use crate::recipe::{Recipe, SourceRecipe, BuildRecipe}; + use crate::recipe::{Recipe, SourceRecipe, BuildKind, BuildRecipe, PackageRecipe}; let recipe: Recipe = toml::from_str(r#" [source] @@ -104,11 +126,18 @@ mod tests { assert_eq!(recipe, Recipe { source: SourceRecipe::Tar { tar: "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz".to_string(), + blake3: None, sha256: Some("4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08".to_string()), + patches: Vec::new(), }, - patches: Vec::new(), - build: BuildRecipe::Custom { - script: "make".to_string() + build: BuildRecipe { + kind: BuildKind::Custom { + script: "make".to_string() + }, + dependencies: Vec::new(), + }, + package: PackageRecipe { + dependencies: Vec::new(), }, }); }