diff --git a/Cargo.lock b/Cargo.lock index 43103aa5571..6b623041f01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,7 +284,7 @@ dependencies = [ "acvm", "barretenberg_wrapper", "blake2", - "dirs", + "dirs 3.0.2", "downloader", "indicatif", "num-bigint", @@ -306,9 +306,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitflags" @@ -349,9 +349,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byteorder" @@ -367,9 +367,9 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" [[package]] name = "cfg-if" @@ -409,9 +409,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" dependencies = [ "cc", ] @@ -437,13 +437,13 @@ dependencies = [ [[package]] name = "console" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847" +checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" dependencies = [ "encode_unicode", + "lazy_static", "libc", - "once_cell", "terminal_size", "unicode-width", "winapi", @@ -501,26 +501,24 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", "memoffset", - "once_cell", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if 1.0.0", - "once_cell", ] [[package]] @@ -581,6 +579,15 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-sys" version = "0.3.7" @@ -743,9 +750,9 @@ checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -758,9 +765,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -768,15 +775,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -785,15 +792,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -802,21 +809,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -860,9 +867,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -884,9 +891,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -977,9 +984,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "abfba89e19b959ca163c7752ba59d737c1ceea53a5d31a149c805446fc958064" dependencies = [ "bytes", "futures-channel", @@ -1061,9 +1068,9 @@ checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "js-sys" @@ -1094,9 +1101,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.133" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "lock_api" @@ -1125,7 +1132,7 @@ dependencies = [ "acvm", "arkworks_backend", "blake2", - "dirs", + "dirs 3.0.2", "downloader", "indicatif", "num-bigint", @@ -1168,14 +1175,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1186,7 +1193,8 @@ dependencies = [ "aztec_backend", "cfg-if 1.0.0", "clap", - "dirs", + "dirs 3.0.2", + "dirs 4.0.0", "fm", "hex", "marlin_arkworks_backend", @@ -1203,9 +1211,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -1263,7 +1271,7 @@ name = "noirc_driver" version = "0.1.0" dependencies = [ "acvm", - "dirs", + "dirs 3.0.2", "fm", "noirc_abi", "noirc_errors", @@ -1271,7 +1279,6 @@ dependencies = [ "noirc_frontend", "pathdiff", "serde", - "std_lib", ] [[package]] @@ -1313,7 +1320,6 @@ dependencies = [ "pathdiff", "rustc-hash", "smol_str", - "std_lib", "thiserror", ] @@ -1365,9 +1371,9 @@ checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "opaque-debug" @@ -1409,9 +1415,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.76" +version = "0.9.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" dependencies = [ "autocfg", "cc", @@ -1465,9 +1471,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" dependencies = [ "thiserror", "ucd-trie", @@ -1496,9 +1502,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "ppv-lite86" @@ -1508,9 +1514,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro2" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -1745,14 +1751,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" @@ -1803,18 +1809,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" dependencies = [ "proc-macro2", "quote", @@ -1823,9 +1829,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "itoa", "ryu", @@ -1894,9 +1900,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smol_str" @@ -1930,13 +1936,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "std_lib" -version = "0.1.0" -dependencies = [ - "dirs", -] - [[package]] name = "strsim" version = "0.8.0" @@ -1951,9 +1950,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.101" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -2026,18 +2025,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -2061,9 +2060,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -2071,7 +2070,6 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "socket2", "winapi", @@ -2118,9 +2116,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -2130,9 +2128,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", @@ -2141,9 +2139,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] @@ -2174,9 +2172,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -2383,43 +2381,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.10.1" diff --git a/Cargo.toml b/Cargo.toml index eb9dc14cfac..0def7a46463 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ members = [ "crates/noirc_errors", "crates/noirc_driver", "crates/acir", - "crates/std_lib", "crates/nargo", "crates/fm", "crates/arena", diff --git a/crates/nargo/Cargo.toml b/crates/nargo/Cargo.toml index fd556ef7f5a..6a8542fe406 100644 --- a/crates/nargo/Cargo.toml +++ b/crates/nargo/Cargo.toml @@ -6,6 +6,9 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[build-dependencies] +dirs = "4" + [dependencies] dirs = "3.0.1" url = "2.2.0" diff --git a/crates/std_lib/build.rs b/crates/nargo/build.rs similarity index 84% rename from crates/std_lib/build.rs rename to crates/nargo/build.rs index 8371e61cb5e..fdd415d51b4 100644 --- a/crates/std_lib/build.rs +++ b/crates/nargo/build.rs @@ -42,10 +42,6 @@ pub fn copy, V: AsRef>(from: U, to: V) -> Result<(), std::i let entry = entry?; let path = entry.path(); - if is_rs_file(&path) { - continue; - } - if path.is_dir() { stack.push(path); } else { @@ -66,17 +62,8 @@ pub fn copy, V: AsRef>(from: U, to: V) -> Result<(), std::i Ok(()) } -// We use lib.rs to lean on Rusts build system, but we do not want it or any other rust files to be copied -fn is_rs_file(src: &Path) -> bool { - // assert_eq!("rs", path.extension().unwrap()); - match src.extension() { - Some(ext) => ext == "rs", - None => false, - } -} - fn main() { - let stdlib_src_dir = Path::new("src/"); + let stdlib_src_dir = Path::new("noir_stdlib/"); rerun_if_stdlib_changes(stdlib_src_dir); let target = dirs::config_dir().unwrap().join("noir-lang").join("std"); copy(stdlib_src_dir, &target).unwrap(); diff --git a/crates/nargo/noir_stdlib/Nargo.toml b/crates/nargo/noir_stdlib/Nargo.toml new file mode 100644 index 00000000000..29392dcc38a --- /dev/null +++ b/crates/nargo/noir_stdlib/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "std" +authors = [""] +compiler_version = "0.1" + +[dependencies] diff --git a/crates/std_lib/src/array.nr b/crates/nargo/noir_stdlib/src/array.nr similarity index 100% rename from crates/std_lib/src/array.nr rename to crates/nargo/noir_stdlib/src/array.nr diff --git a/crates/std_lib/src/ecdsa_secp256k1.nr b/crates/nargo/noir_stdlib/src/ecdsa_secp256k1.nr similarity index 100% rename from crates/std_lib/src/ecdsa_secp256k1.nr rename to crates/nargo/noir_stdlib/src/ecdsa_secp256k1.nr diff --git a/crates/std_lib/src/hash.nr b/crates/nargo/noir_stdlib/src/hash.nr similarity index 100% rename from crates/std_lib/src/hash.nr rename to crates/nargo/noir_stdlib/src/hash.nr diff --git a/crates/std_lib/src/lib.nr b/crates/nargo/noir_stdlib/src/lib.nr similarity index 100% rename from crates/std_lib/src/lib.nr rename to crates/nargo/noir_stdlib/src/lib.nr diff --git a/crates/std_lib/src/merkle.nr b/crates/nargo/noir_stdlib/src/merkle.nr similarity index 100% rename from crates/std_lib/src/merkle.nr rename to crates/nargo/noir_stdlib/src/merkle.nr diff --git a/crates/std_lib/src/scalar_mul.nr b/crates/nargo/noir_stdlib/src/scalar_mul.nr similarity index 100% rename from crates/std_lib/src/scalar_mul.nr rename to crates/nargo/noir_stdlib/src/scalar_mul.nr diff --git a/crates/std_lib/src/schnorr.nr b/crates/nargo/noir_stdlib/src/schnorr.nr similarity index 100% rename from crates/std_lib/src/schnorr.nr rename to crates/nargo/noir_stdlib/src/schnorr.nr diff --git a/crates/nargo/src/cli/build_cmd.rs b/crates/nargo/src/cli/build_cmd.rs index 0988aee2e7b..c7bd316b012 100644 --- a/crates/nargo/src/cli/build_cmd.rs +++ b/crates/nargo/src/cli/build_cmd.rs @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf}; use crate::{errors::CliError, resolver::Resolver}; -use super::{write_to_file, PROVER_INPUT_FILE, VERIFIER_INPUT_FILE}; +use super::{add_std_lib, write_to_file, PROVER_INPUT_FILE, VERIFIER_INPUT_FILE}; pub(crate) fn run(_args: ArgMatches) -> Result<(), CliError> { let package_dir = std::env::current_dir().unwrap(); @@ -14,6 +14,7 @@ pub(crate) fn run(_args: ArgMatches) -> Result<(), CliError> { // This is exposed so that we can run the examples and verify that they pass pub fn build_from_path>(p: P) -> Result<(), CliError> { let mut driver = Resolver::resolve_root_config(p.as_ref())?; + add_std_lib(&mut driver); driver.build(); // XXX: We can have a --overwrite flag to determine if you want to overwrite the Prover/Verifier.toml files if let Some(x) = driver.compute_abi() { @@ -41,3 +42,33 @@ pub fn build_from_path>(p: P) -> Result<(), CliError> { } Ok(()) } + +#[cfg(test)] +mod tests { + const TEST_DATA_DIR: &str = "tests/build_tests_data"; + + #[test] + fn pass() { + let mut pass_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); + pass_dir.push(&format!("{TEST_DATA_DIR}/pass")); + + let paths = std::fs::read_dir(pass_dir).unwrap(); + for path in paths.flatten() { + let path = path.path(); + assert!(super::build_from_path(path.clone()).is_ok(), "path: {}", path.display()); + } + } + + #[test] + #[ignore = "This test fails because the reporter exits the process with 1"] + fn fail() { + let mut fail_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); + fail_dir.push(&format!("{TEST_DATA_DIR}/fail")); + + let paths = std::fs::read_dir(fail_dir).unwrap(); + for path in paths.flatten() { + let path = path.path(); + assert!(super::build_from_path(path.clone()).is_err(), "path: {}", path.display()); + } + } +} diff --git a/crates/nargo/src/cli/compile_cmd.rs b/crates/nargo/src/cli/compile_cmd.rs index 2f7d5f71eb5..4d3c064707a 100644 --- a/crates/nargo/src/cli/compile_cmd.rs +++ b/crates/nargo/src/cli/compile_cmd.rs @@ -9,7 +9,7 @@ use std::path::Path; use crate::{errors::CliError, resolver::Resolver}; -use super::{create_named_dir, write_to_file, BUILD_DIR}; +use super::{add_std_lib, create_named_dir, write_to_file, BUILD_DIR}; pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> { let args = args.subcommand_matches("compile").unwrap(); @@ -61,8 +61,9 @@ pub fn compile_circuit>( program_dir: P, show_ssa: bool, ) -> Result { - let driver = Resolver::resolve_root_config(program_dir.as_ref())?; + let mut driver = Resolver::resolve_root_config(program_dir.as_ref())?; let backend = crate::backends::ConcreteBackend; + add_std_lib(&mut driver); let compiled_program = driver.into_compiled_program(backend.np_language(), show_ssa); Ok(compiled_program) diff --git a/crates/nargo/src/cli/contract_cmd.rs b/crates/nargo/src/cli/contract_cmd.rs index b228c3d8f22..5ac41642011 100644 --- a/crates/nargo/src/cli/contract_cmd.rs +++ b/crates/nargo/src/cli/contract_cmd.rs @@ -10,9 +10,10 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> { Some(path) => std::path::PathBuf::from(path), None => std::env::current_dir().unwrap(), }; - let driver = Resolver::resolve_root_config(&package_dir)?; + let mut driver = Resolver::resolve_root_config(&package_dir)?; let backend = crate::backends::ConcreteBackend; + super::add_std_lib(&mut driver); let compiled_program = driver.into_compiled_program(backend.np_language(), false); let smart_contract_string = backend.eth_contract_from_cs(compiled_program.circuit); diff --git a/crates/nargo/src/cli/gates_cmd.rs b/crates/nargo/src/cli/gates_cmd.rs index a8d9c35f479..4492630ab0e 100644 --- a/crates/nargo/src/cli/gates_cmd.rs +++ b/crates/nargo/src/cli/gates_cmd.rs @@ -22,9 +22,10 @@ pub fn count_gates_with_path>( program_dir: P, show_ssa: bool, ) -> Result<(), CliError> { - let driver = Resolver::resolve_root_config(program_dir.as_ref())?; + let mut driver = Resolver::resolve_root_config(program_dir.as_ref())?; let backend = crate::backends::ConcreteBackend; + super::add_std_lib(&mut driver); let compiled_program = driver.into_compiled_program(backend.np_language(), show_ssa); let gates = compiled_program.circuit.gates; diff --git a/crates/nargo/src/cli/mod.rs b/crates/nargo/src/cli/mod.rs index fac54baf13e..e5188b77b8f 100644 --- a/crates/nargo/src/cli/mod.rs +++ b/crates/nargo/src/cli/mod.rs @@ -1,5 +1,7 @@ pub use build_cmd::build_from_path; use clap::{App, Arg}; +use noirc_driver::Driver; +use noirc_frontend::graph::{CrateName, CrateType}; use std::{ fs::File, io::Write, @@ -139,3 +141,59 @@ pub fn prove_and_verify(proof_name: &str, prg_dir: &Path, show_ssa: bool) -> boo verify_cmd::verify_with_path(prg_dir, &proof_path, show_ssa).unwrap() } + +fn add_std_lib(driver: &mut Driver) { + let path_to_std_lib_file = path_to_stdlib().join("lib.nr"); + let std_crate = driver.create_non_local_crate(path_to_std_lib_file, CrateType::Library); + let std_crate_name = "std"; + driver.propagate_dep(std_crate, &CrateName::new(std_crate_name).unwrap()); +} + +fn path_to_stdlib() -> PathBuf { + dirs::config_dir().unwrap().join("noir-lang").join("std/src") +} + +// FIXME: I not sure that this is the right place for this tests. +#[cfg(test)] +mod tests { + use noirc_driver::Driver; + use noirc_frontend::graph::CrateType; + + use std::path::{PathBuf, Path}; + + const TEST_DATA_DIR: &str = "tests/compile_tests_data"; + + /// Compiles a file and returns true if compilation was successful + /// + /// This is used for tests. + pub fn file_compiles>(root_file: P) -> bool { + let mut driver = Driver::new(); + driver.create_local_crate(&root_file, CrateType::Binary); + super::add_std_lib(&mut driver); + driver.file_compiles() + } + + #[test] + fn compilation_pass() { + let mut pass_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + pass_dir.push(&format!("{TEST_DATA_DIR}/pass")); + + let paths = std::fs::read_dir(pass_dir).unwrap(); + for path in paths.flatten() { + let path = path.path(); + assert!(file_compiles(&path), "path: {}", path.display()); + } + } + + #[test] + fn compilation_fail() { + let mut fail_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + fail_dir.push(&format!("{TEST_DATA_DIR}/fail")); + + let paths = std::fs::read_dir(fail_dir).unwrap(); + for path in paths.flatten() { + let path = path.path(); + assert!(!file_compiles(&path), "path: {}", path.display()); + } + } +} diff --git a/crates/nargo/src/cli/verify_cmd.rs b/crates/nargo/src/cli/verify_cmd.rs index 656cce56df4..30160b46345 100644 --- a/crates/nargo/src/cli/verify_cmd.rs +++ b/crates/nargo/src/cli/verify_cmd.rs @@ -66,9 +66,10 @@ pub fn verify_with_path>( proof_path: P, show_ssa: bool, ) -> Result { - let driver = Resolver::resolve_root_config(program_dir.as_ref())?; + let mut driver = Resolver::resolve_root_config(program_dir.as_ref())?; let backend = crate::backends::ConcreteBackend; + super::add_std_lib(&mut driver); let compiled_program = driver.into_compiled_program(backend.np_language(), show_ssa); let public_abi = compiled_program.abi.clone().unwrap().public_abi(); diff --git a/crates/nargo/tests/build_tests_data/fail/basic/Nargo.toml b/crates/nargo/tests/build_tests_data/fail/basic/Nargo.toml new file mode 100644 index 00000000000..5082c6e12ec --- /dev/null +++ b/crates/nargo/tests/build_tests_data/fail/basic/Nargo.toml @@ -0,0 +1,5 @@ +[package] +authors = [""] +compiler_version = "0.1" + +[dependencies] diff --git a/crates/noirc_driver/tests/fail/basic.nr b/crates/nargo/tests/build_tests_data/fail/basic/src/main.nr similarity index 100% rename from crates/noirc_driver/tests/fail/basic.nr rename to crates/nargo/tests/build_tests_data/fail/basic/src/main.nr diff --git a/crates/nargo/tests/build_tests_data/fail/dup_func/Nargo.toml b/crates/nargo/tests/build_tests_data/fail/dup_func/Nargo.toml new file mode 100644 index 00000000000..5082c6e12ec --- /dev/null +++ b/crates/nargo/tests/build_tests_data/fail/dup_func/Nargo.toml @@ -0,0 +1,5 @@ +[package] +authors = [""] +compiler_version = "0.1" + +[dependencies] diff --git a/crates/noirc_driver/tests/fail/dup_func.nr b/crates/nargo/tests/build_tests_data/fail/dup_func/src/main.nr similarity index 100% rename from crates/noirc_driver/tests/fail/dup_func.nr rename to crates/nargo/tests/build_tests_data/fail/dup_func/src/main.nr diff --git a/crates/nargo/tests/build_tests_data/pass/basic/Nargo.toml b/crates/nargo/tests/build_tests_data/pass/basic/Nargo.toml new file mode 100644 index 00000000000..5082c6e12ec --- /dev/null +++ b/crates/nargo/tests/build_tests_data/pass/basic/Nargo.toml @@ -0,0 +1,5 @@ +[package] +authors = [""] +compiler_version = "0.1" + +[dependencies] diff --git a/crates/nargo/tests/build_tests_data/pass/basic/Prover.toml b/crates/nargo/tests/build_tests_data/pass/basic/Prover.toml new file mode 100644 index 00000000000..e0a68175d07 --- /dev/null +++ b/crates/nargo/tests/build_tests_data/pass/basic/Prover.toml @@ -0,0 +1,2 @@ +x = "" +y = "" diff --git a/crates/nargo/tests/build_tests_data/pass/basic/Verifier.toml b/crates/nargo/tests/build_tests_data/pass/basic/Verifier.toml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/crates/noirc_driver/tests/pass/basic.nr b/crates/nargo/tests/build_tests_data/pass/basic/src/main.nr similarity index 100% rename from crates/noirc_driver/tests/pass/basic.nr rename to crates/nargo/tests/build_tests_data/pass/basic/src/main.nr diff --git a/crates/nargo/tests/build_tests_data/pass/import/Nargo.toml b/crates/nargo/tests/build_tests_data/pass/import/Nargo.toml new file mode 100644 index 00000000000..5082c6e12ec --- /dev/null +++ b/crates/nargo/tests/build_tests_data/pass/import/Nargo.toml @@ -0,0 +1,5 @@ +[package] +authors = [""] +compiler_version = "0.1" + +[dependencies] diff --git a/crates/nargo/tests/build_tests_data/pass/import/Prover.toml b/crates/nargo/tests/build_tests_data/pass/import/Prover.toml new file mode 100644 index 00000000000..e0a68175d07 --- /dev/null +++ b/crates/nargo/tests/build_tests_data/pass/import/Prover.toml @@ -0,0 +1,2 @@ +x = "" +y = "" diff --git a/crates/nargo/tests/build_tests_data/pass/import/Verifier.toml b/crates/nargo/tests/build_tests_data/pass/import/Verifier.toml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/crates/noirc_driver/tests/pass/import.nr b/crates/nargo/tests/build_tests_data/pass/import/src/import.nr similarity index 100% rename from crates/noirc_driver/tests/pass/import.nr rename to crates/nargo/tests/build_tests_data/pass/import/src/import.nr diff --git a/crates/noirc_driver/tests/pass/basic_import.nr b/crates/nargo/tests/build_tests_data/pass/import/src/main.nr similarity index 100% rename from crates/noirc_driver/tests/pass/basic_import.nr rename to crates/nargo/tests/build_tests_data/pass/import/src/main.nr diff --git a/crates/nargo/tests/compile_tests_data/fail/basic.nr b/crates/nargo/tests/compile_tests_data/fail/basic.nr new file mode 100644 index 00000000000..ee99663da46 --- /dev/null +++ b/crates/nargo/tests/compile_tests_data/fail/basic.nr @@ -0,0 +1,7 @@ + +// This should not compile as the keyword +// is `constrain` and not `constrai` + +fn main(x : Field, y : Field) { + constrai x != y; +} \ No newline at end of file diff --git a/crates/nargo/tests/compile_tests_data/fail/dup_func.nr b/crates/nargo/tests/compile_tests_data/fail/dup_func.nr new file mode 100644 index 00000000000..09337e51c93 --- /dev/null +++ b/crates/nargo/tests/compile_tests_data/fail/dup_func.nr @@ -0,0 +1,8 @@ +// Duplicate functions should not compile +fn hello(x : Field) -> Field { + x +} + +fn hello(x : Field) -> Field { + x +} \ No newline at end of file diff --git a/crates/nargo/tests/compile_tests_data/pass/basic.nr b/crates/nargo/tests/compile_tests_data/pass/basic.nr new file mode 100644 index 00000000000..6a678f93fe7 --- /dev/null +++ b/crates/nargo/tests/compile_tests_data/pass/basic.nr @@ -0,0 +1,4 @@ + +fn main(x : Field, y : Field) { + constrain x != y; +} \ No newline at end of file diff --git a/crates/nargo/tests/compile_tests_data/pass/basic_import.nr b/crates/nargo/tests/compile_tests_data/pass/basic_import.nr new file mode 100644 index 00000000000..212d0f13590 --- /dev/null +++ b/crates/nargo/tests/compile_tests_data/pass/basic_import.nr @@ -0,0 +1,11 @@ +mod import; +use dep::std; + +use crate::import::hello; + +fn main(x : Field, y : Field) { + let _k = std::hash::pedersen([x]); + let _l = hello(x); + + constrain x != import::hello(y); +} diff --git a/crates/nargo/tests/compile_tests_data/pass/import.nr b/crates/nargo/tests/compile_tests_data/pass/import.nr new file mode 100644 index 00000000000..f557b362183 --- /dev/null +++ b/crates/nargo/tests/compile_tests_data/pass/import.nr @@ -0,0 +1,4 @@ + +fn hello(x : Field) -> Field { + x +} \ No newline at end of file diff --git a/crates/noirc_driver/Cargo.toml b/crates/noirc_driver/Cargo.toml index 475d99cb46d..24970d82dd8 100644 --- a/crates/noirc_driver/Cargo.toml +++ b/crates/noirc_driver/Cargo.toml @@ -12,7 +12,6 @@ noirc_frontend = { path = "../noirc_frontend" } noirc_evaluator = { path = "../noirc_evaluator" } noirc_abi = { path = "../noirc_abi" } acvm = { git = "https://github.com/noir-lang/noir", rev = "cc5ee63072e09779bebd7e7dd054ae16be307d7f" } -std_lib = { path = "../std_lib" } fm = { path = "../fm" } serde = { version = "1.0.136", features = ["derive"] } diff --git a/crates/noirc_driver/src/lib.rs b/crates/noirc_driver/src/lib.rs index 6195b4708da..a0fca724961 100644 --- a/crates/noirc_driver/src/lib.rs +++ b/crates/noirc_driver/src/lib.rs @@ -37,12 +37,9 @@ impl Driver { /// Compiles a file and returns true if compilation was successful /// /// This is used for tests. - pub fn file_compiles>(root_file: P) -> bool { - let mut driver = Driver::new(); - driver.create_local_crate(root_file, CrateType::Binary); - driver.add_std_lib(); + pub fn file_compiles(&mut self) -> bool { let mut errs = vec![]; - CrateDefMap::collect_defs(LOCAL_CRATE, &mut driver.context, &mut errs); + CrateDefMap::collect_defs(LOCAL_CRATE, &mut self.context, &mut errs); for errors in &errs { dbg!(errors); } @@ -104,10 +101,26 @@ impl Driver { .expect("cyclic dependency triggered"); } - /// Adds the standard library to the dep graph - /// and statically analyses the local crate + /// Propagates a given dependency to every other crate. + pub fn propagate_dep(&mut self, dep_to_propagate: CrateId, dep_to_propagate_name: &CrateName) { + let crate_ids: Vec<_> = self + .context + .crate_graph + .iter_keys() + .filter(|crate_id| *crate_id != dep_to_propagate) + .collect(); + + for crate_id in crate_ids { + self.context + .crate_graph + .add_dep(crate_id, dep_to_propagate_name.clone(), dep_to_propagate) + .expect("ice: cyclic error triggered with std library"); + } + } + + // NOTE: Maybe build could be skipped given that now it is a pass through method. + /// Statically analyses the local crate pub fn build(&mut self) { - self.add_std_lib(); self.analyse_crate() } @@ -180,38 +193,6 @@ impl Driver { CompiledProgram { circuit, abi: Some(abi) } } - - #[cfg(not(feature = "std"))] - pub fn add_std_lib(&mut self) { - // TODO: Currently, we do not load the standard library when the program - // TODO: is compiled using the wasm version of noir - } - - #[cfg(feature = "std")] - /// XXX: It is sub-optimal to add the std as a regular crate right now because - /// we have no way to determine whether a crate has been compiled already. - /// XXX: We Ideally need a way to check if we've already compiled a crate and not re-compile it - pub fn add_std_lib(&mut self) { - let path_to_std_lib_file = path_to_stdlib().join("lib.nr"); - - let std_crate_id = self.create_non_local_crate(path_to_std_lib_file, CrateType::Library); - - let name = CrateName::new("std").unwrap(); - - let crate_ids: Vec<_> = self - .context - .crate_graph - .iter_keys() - .filter(|crate_id| *crate_id != std_crate_id) - .collect(); - // Add std as a crate dependency to every other crate - for crate_id in crate_ids { - self.context - .crate_graph - .add_dep(crate_id, name.clone(), std_crate_id) - .expect("ice: cyclic error triggered with std library"); - } - } } impl Default for Driver { @@ -219,8 +200,3 @@ impl Default for Driver { Self::new() } } - -#[cfg(feature = "std")] -fn path_to_stdlib() -> PathBuf { - dirs::config_dir().unwrap().join("noir-lang").join("std") -} diff --git a/crates/noirc_driver/tests/tests.rs b/crates/noirc_driver/tests/tests.rs deleted file mode 100644 index 79dcd28ef46..00000000000 --- a/crates/noirc_driver/tests/tests.rs +++ /dev/null @@ -1,27 +0,0 @@ -use noirc_driver::Driver; -use std::path::PathBuf; - -#[test] -fn fail() { - let mut fail_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - fail_dir.push("tests/fail/"); - - let paths = std::fs::read_dir(fail_dir).unwrap(); - - for path in paths { - let path = path.unwrap().path(); - assert!(!Driver::file_compiles(&path), "path: {}", path.display()) - } -} -#[test] -fn pass() { - let mut pass_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - pass_dir.push("tests/pass/"); - - let paths = std::fs::read_dir(pass_dir).unwrap(); - - for path in paths { - let path = path.unwrap().path(); - assert!(Driver::file_compiles(&path), "path: {}", path.display()) - } -} diff --git a/crates/noirc_frontend/Cargo.toml b/crates/noirc_frontend/Cargo.toml index 57479e89808..184c1d27fe1 100644 --- a/crates/noirc_frontend/Cargo.toml +++ b/crates/noirc_frontend/Cargo.toml @@ -10,7 +10,6 @@ edition = "2021" acvm = { git = "https://github.com/noir-lang/noir" } noirc_abi = { path = "../noirc_abi" } noirc_errors = { path = "../noirc_errors" } -std_lib = { path = "../std_lib" } fm = { path = "../fm" } arena = { path = "../arena" } chumsky = { git = "https://github.com/jfecher/chumsky", rev = "ad9d312" } diff --git a/crates/std_lib/Cargo.toml b/crates/std_lib/Cargo.toml deleted file mode 100644 index 5e3fb2d0b58..00000000000 --- a/crates/std_lib/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "std_lib" -version = "0.1.0" -authors = ["Kevaundray Wedderburn "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[build-dependencies] -dirs = "3.0" \ No newline at end of file diff --git a/crates/std_lib/src/lib.rs b/crates/std_lib/src/lib.rs deleted file mode 100644 index b8a5116ce35..00000000000 --- a/crates/std_lib/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -// This lib.rs file is here so that we can leverage the Rust build system -// The contents of src except for Rust files will be copied to a config directory. -// When compiling a Project, the compiler will look for the standard library in this config directory