diff --git a/Cargo.lock b/Cargo.lock index 63110e3..614076c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,413 +1,455 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "addr2line" -version = "0.13.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ - "gimli 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gimli", ] [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ - "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] name = "autocfg" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ - "addr2line 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "object 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", ] +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "cc" -version = "1.0.58" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" -version = "0.1.10" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "docopt" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f3f119846c823f9eafcf953a8f6ffb6ed69bf6240883261a7f13b634579a51f" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "regex", + "serde", + "strsim", ] [[package]] name = "failure" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" dependencies = [ - "backtrace 0.3.50 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace", + "failure_derive", ] [[package]] name = "failure_derive" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] -name = "getrandom" -version = "0.1.14" +name = "fastrand" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.74 (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)", + "instant", ] [[package]] name = "gimli" -version = "0.22.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "hashbrown" -version = "0.8.2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" + +[[package]] +name = "indexmap" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ - "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "hashbrown", ] [[package]] -name = "indexmap" -version = "1.5.1" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashbrown 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.74" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "llvm-sys" -version = "90.1.0" +version = "90.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe45e64c8db814191fedc1787c3fb8eb2e2c8af897727b3e21df2562c4a01c" dependencies = [ - "cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "lazy_static", + "libc", + "regex", + "semver 0.9.0", ] [[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "miniz_oxide" -version = "0.4.0" +name = "llvm-sys" +version = "100.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d0c7337299c4a91bd5d52a86d26cf47e0e84f3b9017874a0b5c667c3cb612" dependencies = [ - "adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "lazy_static", + "libc", + "regex", + "semver 0.9.0", ] [[package]] -name = "object" -version = "0.20.0" +name = "llvm-sys" +version = "130.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb6ea20e8a348f6db0b43a7f009fa7d981d22edf4cbe2e0c7b2247dbb25be61" +dependencies = [ + "cc", + "lazy_static", + "libc", + "regex", + "semver 0.11.0", +] [[package]] -name = "ppv-lite86" -version = "0.2.8" +name = "memchr" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "proc-macro2" -version = "1.0.19" +name = "miniz_oxide" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ - "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "adler", ] [[package]] -name = "quote" -version = "1.0.7" +name = "object" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ - "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] -name = "rand" -version = "0.7.3" +name = "pest" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4" dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.74 (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)", + "thiserror", + "ucd-trie", ] [[package]] -name = "rand_chacha" -version = "0.2.2" +name = "proc-macro2" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" 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)", + "unicode-ident", ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "quote" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "redox_syscall" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "regex" -version = "1.3.9" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ - "aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi", ] [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser 0.7.0", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver-parser 0.10.2", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] [[package]] name = "serde" -version = "1.0.115" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" dependencies = [ - "serde_derive 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.115" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" dependencies = [ - "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "strsim" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.38" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ - "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", + "unicode-xid", ] [[package]] name = "tempfile" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", ] [[package]] -name = "thread_local" -version = "1.0.1" +name = "thiserror" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] +[[package]] +name = "ucd-trie" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" + [[package]] name = "ullage" version = "0.1.0" dependencies = [ - "docopt 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)", - "llvm-sys 90.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt", + "failure", + "indexmap", + "libc", + "llvm-sys 100.2.3", + "llvm-sys 130.0.4", + "llvm-sys 90.2.1", + "serde", + "tempfile", ] [[package]] -name = "unicode-xid" -version = "0.2.1" +name = "unicode-ident" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +name = "unicode-xid" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum addr2line 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" -"checksum adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" -"checksum aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)" = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" -"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" -"checksum backtrace 0.3.50 (registry+https://github.com/rust-lang/crates.io-index)" = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" -"checksum cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -"checksum docopt 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969" -"checksum failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -"checksum failure_derive 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" -"checksum gimli 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" -"checksum hashbrown 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" -"checksum indexmap 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86b45e59b16c76b11bf9738fd5d38879d3bd28ad292d7b313608becb17ae2df9" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.74 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" -"checksum llvm-sys 90.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4a37c65d26686a37e9a32ef9a41a74333e6dee8b780cc9d29eb33cacdbb12f5" -"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" -"checksum miniz_oxide 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" -"checksum object 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" -"checksum ppv-lite86 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" -"checksum proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" -"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" -"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 redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)" = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" -"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" -"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" -"checksum remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)" = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" -"checksum serde_derive 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)" = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48" -"checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" -"checksum syn 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" -"checksum synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" -"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" -"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -"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" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 042ff0c..0141301 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,13 @@ keywords = [ "llvm", "parser", "compiler" ] categories = [ "parsing" ] edition = "2018" +[features] +default = [ "llvm-13" ] + [dependencies] -llvm-sys = "90" -# FIXME: Want to upgrade to LLVM 10, but Clang doesn't seem capable of linking -# the IL or Bitcode output from it. Do we need to wait for LLVM 11? Is -# It time to stop relying on `cc` for linking? -# llvm-sys = { version = "100", git = "https://gitlab.com/iwillspeak/llvm-sys.rs.git", branch = "macos-tbd-link" } +llvm-9 = { package = "llvm-sys", version = "90", optional = true } +llvm-10 = { package = "llvm-sys", version = "100", optional = true } +llvm-13 = { package = "llvm-sys", version = "130", optional = true } docopt = "1.1" serde = { version = "1.0", features = ["derive"] } tempfile = "3.1" diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index 639a809..e8e57a3 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -8,18 +8,28 @@ jobs: - job: macOS pool: vmImage: 'macOS-10.15' + strategy: + matrix: + LLVM9: + llvm_tag: 'llvm\@9' + features: 'llvm-9' + llvm_ver: '90' + LLVM10: + llvm_tag: 'llvm' + features: 'llvm-10' + llvm_ver: '100' steps: - - script: 'brew install llvm\@9' + - script: 'brew install $(llvm_tag)' displayName: Brew install LLVM - script: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh && sh rustup.sh -y" displayName: Rustup - script: | export PATH=/usr/local/bin:$PATH # Local bin (brew) source ~/.cargo/env - export LLVM_SYS_90_PREFIX=/usr/local/opt/llvm\@9 - export LLVM_CONFIG_PATH=${LLVM_SYS_90_PREFIX}/bin/llvm-config + export LLVM_SYS_$(llvm_ver)_PREFIX=/usr/local/opt/$(llvm_tag) + export LLVM_CONFIG_PATH=${LLVM_SYS_$(llvm_ver)_PREFIX}/bin/llvm-config cargo install just - ./build.sh test + ./build.sh features=$(features) test displayName: './build.sh test' - job: Linux pool: diff --git a/justfile b/justfile index 56ff39a..76b0c5d 100644 --- a/justfile +++ b/justfile @@ -1,8 +1,10 @@ +features := "llvm-13" + build: - cargo build --release + cargo build --release --no-default-features --features={{features}} test: build - cargo test + cargo test --no-default-features --features={{features}} python3 specs.py clean: @@ -30,6 +32,5 @@ bench opt_level="3": build except OSError: pass print("bench={0}, output={1}, opt={2}".format(bench, output, {{opt_level}})) - subprocess.call("target/release/ullage {0} -O{1} -o {2}" - .format(bench, {{opt_level}}, output)) - subprocess.call("time {0}".format(output)) \ No newline at end of file + subprocess.call(["target/release/ullage", bench, "-O{{opt_level}}", "-o", output]) + subprocess.call(["time", output]) \ No newline at end of file diff --git a/specs.py b/specs.py index 2f01d88..2bc881c 100644 --- a/specs.py +++ b/specs.py @@ -11,6 +11,7 @@ Expectations = collections.namedtuple('Expectations', ['expects', 'failure_expects', 'skip_run']) +LINKER_KIND = "Object" EXPECT_PATTERN = re.compile(r'#\s?=>\s?(.+)') EXPECT_ERR_PATTERN = re.compile(r'#\s?!>\s?(.+)') SKIP_PATTERN = re.compile(r'#\s?!!skip') @@ -123,7 +124,7 @@ def run_spec(path): expectations = parse_spec(path) out = "specbin/{}".format(os.path.basename(path).split('.')[0]) - compile_cmd = subprocess.Popen(["target/release/ullage", path, "-o", out], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + compile_cmd = subprocess.Popen(["target/release/ullage", path, "--link-kind", LINKER_KIND, "-o", out], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Give the compiler 5 seconds to run, and return an error on timeout timer = threading.Timer(5, compile_cmd.kill) @@ -140,7 +141,7 @@ def run_spec(path): run_cmd = subprocess.Popen(out, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = run_cmd.communicate() if run_cmd.returncode != 0: - raise ExitCodeMismatchError("Expected successfull exit code") + raise ExitCodeMismatchError("Expected successfull exit code", run_cmd.returncode, output) check_output(output[0].decode('utf-8'), expectations.expects) diff --git a/src/compile.rs b/src/compile.rs index a9f085d..66aae2b 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -5,17 +5,17 @@ use crate::diag::Diagnostic; use crate::low_loader::prelude::*; use crate::sem; use crate::syntax; +use linker::Linker; use std::path::Path; use std::process::Command; use tempfile::Builder; -use linker::Linker; pub use self::error::{CompError, CompResult}; pub use self::options::{CompilationOptions, OptimisationLevel}; pub mod error; -pub mod options; pub mod linker; +pub mod options; mod lower; mod lower_context; @@ -110,7 +110,10 @@ impl Compilation { let linker = self.options.linker.unwrap_or_else(Linker::default); // Create a tempdir to write the LLVM IR or bitcode to - let temp_file = Builder::new().prefix("ullage").suffix(linker.asset_ty.extension()).tempfile()?; + let temp_file = Builder::new() + .prefix("ullage") + .suffix(linker.asset_ty.extension()) + .tempfile()?; // check if we have optimiation enabled and run the // corresponding optimisations if we do. @@ -122,7 +125,7 @@ impl Compilation { if self.options.dump_ir { module.dump(); } - module.write_to_file(temp_file.path())?; + module.write_to_file(&target, temp_file.path(), linker.asset_ty.file_kind())?; // Shell out to Clang to link the final assembly let output = Command::new(linker.cmd.executable()) diff --git a/src/compile/linker.rs b/src/compile/linker.rs index 9cc9430..05c9889 100644 --- a/src/compile/linker.rs +++ b/src/compile/linker.rs @@ -6,6 +6,8 @@ use std::default::Default; +use crate::low_loader::prelude::OutputFileKind; + /// The information for performing a link pub struct Linker { /// The linker command. Currently only `clang` is supported. @@ -15,19 +17,21 @@ pub struct Linker { } /// The executable type to use for linking -#[derive(Debug,Copy,Clone)] +#[derive(Debug, Copy, Clone)] pub enum LinkerCommand { /// The Clang c compiler Clang, } /// The intermediate asset type to pass to the linker -#[derive(Debug,Copy,Clone)] +#[derive(Debug, Copy, Clone)] pub enum LinkerAssetType { /// LLVM IR text files LlvmIr, /// LLVM IR bticode files LlvmBc, + /// Native object + Object, } impl Linker { @@ -38,7 +42,10 @@ impl Linker { /// Create a linker from the given command pub fn from_command(cmd: LinkerCommand) -> Self { - Linker { cmd, asset_ty: cmd.default_asset_ty() } + Linker { + cmd, + asset_ty: cmd.default_asset_ty(), + } } } @@ -61,7 +68,7 @@ impl LinkerCommand { // make the linker buidl the command // rather than the compiler. match *self { - LinkerCommand::Clang => "clang" + LinkerCommand::Clang => "clang", } } } @@ -73,12 +80,21 @@ impl Default for LinkerCommand { } impl LinkerAssetType { - /// Get the file extension for the asset type pub fn extension(&self) -> &str { match *self { LinkerAssetType::LlvmIr => ".ll", LinkerAssetType::LlvmBc => ".bc", + LinkerAssetType::Object => ".o", + } + } + + /// Get the file kind for this asset type + pub(crate) fn file_kind(&self) -> OutputFileKind { + match *self { + LinkerAssetType::LlvmIr => OutputFileKind::LLVMIl, + LinkerAssetType::LlvmBc => OutputFileKind::Bitcode, + LinkerAssetType::Object => OutputFileKind::NativeObject, } } } diff --git a/src/compile/lower.rs b/src/compile/lower.rs index c4ee5a2..903f86b 100644 --- a/src/compile/lower.rs +++ b/src/compile/lower.rs @@ -167,9 +167,11 @@ pub fn lower_internal( Typ::Builtin(BuiltinType::String) => { build_string_concat(ctx, builder, lhs_val, rhs_val) } - _ => Err(CompError::from( - "invalid operand types for `Add`".to_string(), - ))?, + _ => { + return Err(CompError::from( + "invalid operand types for `Add`".to_string(), + )) + } }, InfixOp::Sub => builder.build_sub(lhs_val, rhs_val), InfixOp::Mul => builder.build_mul(lhs_val, rhs_val), diff --git a/src/compile/options.rs b/src/compile/options.rs index ddd365d..f172dbc 100644 --- a/src/compile/options.rs +++ b/src/compile/options.rs @@ -3,8 +3,8 @@ //! This module defines the options structure used to tweak //! compilation output. -use crate::low_loader::pass_manager as pm; use super::linker::Linker; +use crate::low_loader::pass_manager as pm; /// Compilation Options /// @@ -55,7 +55,10 @@ impl CompilationOptions { /// Set the linker command to use pub fn with_linker(self, linker: Linker) -> Self { - CompilationOptions { linker: Some(linker), ..self } + CompilationOptions { + linker: Some(linker), + ..self + } } } diff --git a/src/low_loader.rs b/src/low_loader.rs index 1ede0c5..60d15e0 100644 --- a/src/low_loader.rs +++ b/src/low_loader.rs @@ -22,7 +22,12 @@ #![deny(missing_docs)] -use llvm_sys; +#[cfg(feature = "llvm-10")] +use llvm_10 as llvm_sys; +#[cfg(feature = "llvm-13")] +use llvm_13 as llvm_sys; +#[cfg(feature = "llvm-9")] +use llvm_9 as llvm_sys; pub mod builder; pub mod context; @@ -42,7 +47,7 @@ pub mod prelude { pub use super::builder::Predicate; pub use super::context::Context; pub use super::function::{CallConvention, Function}; - pub use super::module::Module; + pub use super::module::{Module, OutputFileKind}; pub use super::targets::{Target, TargetLookupError}; pub use super::types::Type; pub use super::value::Value; diff --git a/src/low_loader/function.rs b/src/low_loader/function.rs index 26bd89b..69f3627 100644 --- a/src/low_loader/function.rs +++ b/src/low_loader/function.rs @@ -52,6 +52,10 @@ impl Function { /// /// Takes ownership of the given function and provides more /// stronlgy typed access to it. + /// + /// # Safety + /// + /// The value should be a function. This is not checked. pub unsafe fn from_raw(raw: LLVMValueRef) -> Self { Function { raw, diff --git a/src/low_loader/module.rs b/src/low_loader/module.rs index aac8ce6..f7a8c40 100644 --- a/src/low_loader/module.rs +++ b/src/low_loader/module.rs @@ -4,6 +4,7 @@ use super::function::Function; use super::llvm_sys::prelude::*; +use super::llvm_sys::target_machine; use super::llvm_sys::{analysis, bit_writer, core}; use super::pass_manager::{OptLevel, OptSize, PassManagerBuilder}; use super::targets::Target; @@ -22,6 +23,19 @@ pub struct Module { raw: LLVMModuleRef, } +/// The kind of output file to write +/// +/// Used when writing modules to disk. +#[derive(Debug, PartialEq)] +pub enum OutputFileKind { + /// LLVM IL files + LLVMIl, + /// LLVM Bitcode file + Bitcode, + /// Native executable object files + NativeObject, +} + impl Module { /// Module from Raw /// @@ -90,18 +104,49 @@ impl Module { /// Write the Module to the Given File as LLVM IR or Bitcode /// - /// If the path's extension is `.ll` then the file is written as - /// LLVM IR, otherwise the file is written as bitcode. - pub fn write_to_file(&self, path: &Path) -> Result<(), String> { - let is_il = path.extension().map(|e| e == "ll").unwrap_or(false); + /// The kind of file written depends on `kind`. + pub fn write_to_file( + &self, + target: &Target, + path: &Path, + kind: OutputFileKind, + ) -> Result<(), String> { let path = path.to_str().and_then(|s| CString::new(s).ok()).unwrap(); unsafe { let mut message = ptr::null_mut(); - let r = if is_il { - core::LLVMPrintModuleToFile(self.raw, path.as_ptr(), &mut message) - } else { - bit_writer::LLVMWriteBitcodeToFile(self.raw, path.as_ptr()) + let r = match kind { + OutputFileKind::LLVMIl => { + core::LLVMPrintModuleToFile(self.raw, path.as_ptr(), &mut message) + } + OutputFileKind::Bitcode => { + bit_writer::LLVMWriteBitcodeToFile(self.raw, path.as_ptr()) + } + OutputFileKind::NativeObject => { + let trip = CString::new(target.triple()).unwrap(); + // To emit code we need to do a few things: + // * Create an LLVM TargetMachine from our target. + // * Create a pass manager + // * Call targetMachine emit to file + let tm = target_machine::LLVMCreateTargetMachine( + target.as_llvm_target(), + trip.as_ptr(), + target_machine::LLVMGetHostCPUName(), + target_machine::LLVMGetHostCPUFeatures(), + target_machine::LLVMCodeGenOptLevel::LLVMCodeGenLevelDefault, + target_machine::LLVMRelocMode::LLVMRelocDefault, + target_machine::LLVMCodeModel::LLVMCodeModelSmall, + ); + let r = target_machine::LLVMTargetMachineEmitToFile( + tm, + self.as_raw(), + path.as_ptr() as *mut _, + target_machine::LLVMCodeGenFileType::LLVMObjectFile, + &mut message, + ); + target_machine::LLVMDisposeTargetMachine(tm); + r + } }; if r == 0 { Ok(()) diff --git a/src/low_loader/targets.rs b/src/low_loader/targets.rs index bafc459..fab3e8c 100644 --- a/src/low_loader/targets.rs +++ b/src/low_loader/targets.rs @@ -3,7 +3,6 @@ use super::llvm_sys::core::LLVMDisposeMessage; use super::llvm_sys::target_machine::*; use failure::Fail; -use libc; use std::ffi::{CStr, CString}; use std::{fmt, ptr}; @@ -73,6 +72,16 @@ impl Target { }) } + /// Get the underlying LLVM target reference from the target + /// + /// # Safety + /// + /// The lifetime of the returned reference is tied to the lifetime of + /// the `Target`. It should not be used outside that scope. + pub unsafe fn as_llvm_target(&self) -> LLVMTargetRef { + self.llvm_target + } + /// Get the Target name /// /// Retrieves the logical name for this target diff --git a/src/low_loader/types.rs b/src/low_loader/types.rs index 2a8221b..625cd5f 100644 --- a/src/low_loader/types.rs +++ b/src/low_loader/types.rs @@ -93,6 +93,8 @@ impl From for Type { LLVMMetadataTypeKind => Type::Metadata, LLVMX86_MMXTypeKind => Type::MMX, LLVMTokenTypeKind => Type::Token, + // Other types are not yet supported. + _ => unimplemented!(), } } } diff --git a/src/main.rs b/src/main.rs index cc83944..a50c3c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,6 @@ #![warn(missing_docs)] -use failure; - pub mod compile; pub mod diag; pub mod low_loader; @@ -40,6 +38,7 @@ Options: -O, --optimise= Set the compilation optimisation level. 0 = off, 1 = low, 2 = medium, 3 = high, s = size. -o, --output= Write the output to . + --link-kind= Set the link type to perform. --target= Set the compilation target triple. --link-mode= Set the type of intermediate assets to produce for linking. Use `llvmIr`, or `llvmBc`. @@ -159,7 +158,7 @@ impl From for linker::Linker { match mode { LinkMode::LlvmIr => linker::LinkerAssetType::LlvmIr, LinkMode::LlvmBc => linker::LinkerAssetType::LlvmBc, - } + }, ) } } @@ -239,6 +238,7 @@ fn main() { let linker = linker::Linker::from(link_mode); options = options.with_linker(linker); } + let comp = match Compilation::new(tree, options) { Ok(c) => c, Err(e) => handle_comp_err(&e),