From 7d2280f7f04eee3e157aa42b0995a461c7655af4 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Wed, 20 Sep 2023 16:05:00 -0700 Subject: [PATCH 01/17] feat: Add noir_lsp_wasm as a WASI implementation of the LSP --- Cargo.lock | 24 +++++ Cargo.toml | 4 + flake.nix | 20 +++- tooling/lsp_wasm/Cargo.toml | 17 ++++ tooling/lsp_wasm/src/backend.rs | 35 +++++++ tooling/lsp_wasm/src/main.rs | 27 +++++ tooling/lsp_wasm/src/stdio.rs | 175 ++++++++++++++++++++++++++++++++ 7 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 tooling/lsp_wasm/Cargo.toml create mode 100644 tooling/lsp_wasm/src/backend.rs create mode 100644 tooling/lsp_wasm/src/main.rs create mode 100644 tooling/lsp_wasm/src/stdio.rs diff --git a/Cargo.lock b/Cargo.lock index 3464172b513..ce0b8ecb24e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1497,6 +1497,7 @@ checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", + "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -1519,6 +1520,17 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.28" @@ -2297,6 +2309,18 @@ dependencies = [ "tower", ] +[[package]] +name = "noir_lsp_wasm" +version = "0.12.0" +dependencies = [ + "acvm", + "async-lsp", + "futures", + "noir_lsp", + "rustix 0.37.23", + "tower", +] + [[package]] name = "noir_wasm" version = "0.12.0" diff --git a/Cargo.toml b/Cargo.toml index d7df1363921..577f6aee5eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ members = [ "tooling/backend_interface", "tooling/bb_abstraction_leaks", "tooling/lsp", + "tooling/lsp_wasm", "tooling/nargo", "tooling/nargo_cli", "tooling/nargo_toml", @@ -43,6 +44,7 @@ nargo = { path = "tooling/nargo" } nargo_cli = { path = "tooling/nargo_cli" } nargo_toml = { path = "tooling/nargo_toml" } noir_lsp = { path = "tooling/lsp" } +noir_lsp_wasm = { path = "tooling/lsp_wasm" } noirc_abi = { path = "tooling/noirc_abi" } bb_abstraction_leaks = { path = "tooling/bb_abstraction_leaks" } noirc_driver = { path = "compiler/noirc_driver" } @@ -73,3 +75,5 @@ wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] } wasm-bindgen-test = "0.3.33" base64 = "0.21.2" fxhash = "0.2.1" +futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } +rustix = { version = "0.37.1", default-features = false, features = [ "std", "fs" ] } diff --git a/flake.nix b/flake.nix index d4d1f4c54fa..62f248233c8 100644 --- a/flake.nix +++ b/flake.nix @@ -125,6 +125,9 @@ noirc-abi-wasm-cargo-artifacts = craneLib.buildDepsOnly (wasmConfig // { pname = "noirc_abi_wasm"; }); + noir-lsp-wasm-cargo-artifacts = craneLib.buildDepsOnly (wasmConfig // { + pname = "noir_lsp_wasm"; + }); nargo = craneLib.buildPackage (nativeConfig // { pname = "nargo"; @@ -179,6 +182,19 @@ doCheck = false; }); + noir_lsp_wasm = craneLib.buildPackage (wasmConfig // rec { + pname = "noir_lsp_wasm"; + + inherit GIT_COMMIT GIT_DIRTY; + + cargoArtifacts = noir-lsp-wasm-cargo-artifacts; + + cargoExtraArgs = "--package ${pname} --target wasm32-wasi"; + + # We don't want to run tests because they don't work in the Nix sandbox + doCheck = false; + }); + wasm-bindgen-cli = pkgs.callPackage ./wasm-bindgen-cli.nix { rustPlatform = pkgs.makeRustPlatform { rustc = rustToolchain; @@ -211,17 +227,19 @@ # Nix flakes cannot build more than one derivation in one command (see https://github.com/NixOS/nix/issues/5591) # so we use `symlinkJoin` to build everything as the "all" package. - all = pkgs.symlinkJoin { name = "all"; paths = [ nargo noir_wasm noirc_abi_wasm ]; }; + all = pkgs.symlinkJoin { name = "all"; paths = [ nargo noir_wasm noirc_abi_wasm noir_lsp_wasm ]; }; # We also export individual packages to enable `nix build .#nargo -L`, etc. inherit nargo; inherit noir_wasm; inherit noirc_abi_wasm; + inherit noir_lsp_wasm; # We expose the `*-cargo-artifacts` derivations so we can cache our cargo dependencies in CI inherit native-cargo-artifacts; inherit noir-wasm-cargo-artifacts; inherit noirc-abi-wasm-cargo-artifacts; + inherit noir-lsp-wasm-cargo-artifacts; }; # Setup the environment to match the environment settings, the inputs from our checks derivations, diff --git a/tooling/lsp_wasm/Cargo.toml b/tooling/lsp_wasm/Cargo.toml new file mode 100644 index 00000000000..b75b99f513e --- /dev/null +++ b/tooling/lsp_wasm/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "noir_lsp_wasm" +description = "Language server for Noir compiled to WASI" +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +acvm.workspace = true +noir_lsp.workspace = true +tower.workspace = true +futures.workspace = true +rustix.workspace = true +async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait"] } diff --git a/tooling/lsp_wasm/src/backend.rs b/tooling/lsp_wasm/src/backend.rs new file mode 100644 index 00000000000..523b8658fd6 --- /dev/null +++ b/tooling/lsp_wasm/src/backend.rs @@ -0,0 +1,35 @@ +use acvm::BlackBoxFunctionSolver; + +pub struct MockBackend; + +impl BlackBoxFunctionSolver for MockBackend { + fn schnorr_verify( + &self, + _public_key_x: &acvm::FieldElement, + _public_key_y: &acvm::FieldElement, + _signature: &[u8], + _message: &[u8], + ) -> Result { + unimplemented!( + "schnorr_verify blackbox function is not currently supported in the Wasm LSP" + ) + } + + fn pedersen( + &self, + _inputs: &[acvm::FieldElement], + _domain_separator: u32, + ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { + unimplemented!("pedersen blackbox function is not currently supported in the Wasm LSP") + } + + fn fixed_base_scalar_mul( + &self, + _low: &acvm::FieldElement, + _high: &acvm::FieldElement, + ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { + unimplemented!( + "fixed_base_scalar_mul blackbox function is not currently supported in the Wasm LSP" + ) + } +} diff --git a/tooling/lsp_wasm/src/main.rs b/tooling/lsp_wasm/src/main.rs new file mode 100644 index 00000000000..4f381695617 --- /dev/null +++ b/tooling/lsp_wasm/src/main.rs @@ -0,0 +1,27 @@ +use async_lsp::{concurrency::ConcurrencyLayer, panic::CatchUnwindLayer, server::LifecycleLayer}; +use noir_lsp::NargoLspService; +use tower::ServiceBuilder; + +mod backend; +mod stdio; + +fn main() { + // let blackbox_solver = acvm::blackbox_solver::BarretenbergSolver::initialize().await; + let blackbox_solver = backend::MockBackend; + let (server, _) = async_lsp::MainLoop::new_server(|client| { + let router = NargoLspService::new(&client, blackbox_solver); + + ServiceBuilder::new() + .layer(LifecycleLayer::default()) + .layer(CatchUnwindLayer::default()) + .layer(ConcurrencyLayer::default()) + .service(router) + }); + + let stdin = stdio::PipeStdin::lock().expect("stdin to lock"); + let stdout = stdio::PipeStdout::lock().expect("stdout to lock"); + + futures::executor::block_on(async { + server.run_buffered(stdin, stdout).await.expect("server should start"); + }) +} diff --git a/tooling/lsp_wasm/src/stdio.rs b/tooling/lsp_wasm/src/stdio.rs new file mode 100644 index 00000000000..4c117005898 --- /dev/null +++ b/tooling/lsp_wasm/src/stdio.rs @@ -0,0 +1,175 @@ +use futures::{AsyncRead, AsyncWrite}; +use std::io::{self, IoSlice, IoSliceMut, Read, StdinLock, StdoutLock, Write}; +use std::os::fd::{AsFd, AsRawFd, BorrowedFd, RawFd}; +use std::{ + pin::Pin, + task::{Context, Poll}, +}; + +// WASI-compatible stdin/stdout that implements AsyncRead and AsyncWrite +// Based on the PipeStdin and PipeStdout in async_lsp +// TODO: Upstream to async_lsp +#[derive(Debug)] +pub struct PipeStdin { + inner: StdinLock<'static>, +} + +impl PipeStdin { + pub fn lock() -> io::Result { + let inner = io::stdin().lock(); + Ok(Self { inner }) + } +} + +impl AsFd for PipeStdin { + fn as_fd(&self) -> BorrowedFd<'_> { + self.inner.as_fd() + } +} + +impl AsRawFd for PipeStdin { + fn as_raw_fd(&self) -> RawFd { + self.inner.as_raw_fd() + } +} + +impl Read for &'_ PipeStdin { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + rustix::io::read(self, buf).map_err(Into::into) + } + + fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result { + rustix::io::readv(self, bufs).map_err(Into::into) + } +} + +impl Read for PipeStdin { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + <&PipeStdin>::read(&mut &*self, buf) + } + + fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result { + <&PipeStdin>::read_vectored(&mut &*self, bufs) + } +} + +#[derive(Debug)] +pub struct PipeStdout { + inner: StdoutLock<'static>, +} + +impl PipeStdout { + pub fn lock() -> io::Result { + let inner = io::stdout().lock(); + Ok(Self { inner }) + } +} + +impl AsFd for PipeStdout { + fn as_fd(&self) -> BorrowedFd<'_> { + self.inner.as_fd() + } +} + +impl AsRawFd for PipeStdout { + fn as_raw_fd(&self) -> RawFd { + self.inner.as_raw_fd() + } +} + +impl Write for &'_ PipeStdout { + fn write(&mut self, buf: &[u8]) -> io::Result { + rustix::io::write(self, buf).map_err(Into::into) + } + + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } + + fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { + rustix::io::writev(self, bufs).map_err(Into::into) + } +} + +impl Write for PipeStdout { + fn write(&mut self, buf: &[u8]) -> io::Result { + <&PipeStdout>::write(&mut &*self, buf) + } + + fn flush(&mut self) -> io::Result<()> { + <&PipeStdout>::flush(&mut &*self) + } + + fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { + <&PipeStdout>::write_vectored(&mut &*self, bufs) + } +} + +impl AsyncRead for PipeStdin { + fn poll_read( + mut self: Pin<&mut Self>, + _cx: &mut Context<'_>, + buf: &mut [u8], + ) -> Poll> { + loop { + match (*self).read(buf) { + Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} + res => return Poll::Ready(res), + } + } + } + + fn poll_read_vectored( + mut self: Pin<&mut Self>, + _cx: &mut Context<'_>, + bufs: &mut [IoSliceMut<'_>], + ) -> Poll> { + loop { + match (*self).read_vectored(bufs) { + Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} + res => return Poll::Ready(res), + } + } + } +} + +impl AsyncWrite for PipeStdout { + fn poll_write( + mut self: Pin<&mut Self>, + _cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + loop { + match (*self).write(buf) { + Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} + res => return Poll::Ready(res), + } + } + } + + fn poll_write_vectored( + mut self: Pin<&mut Self>, + _cx: &mut Context<'_>, + bufs: &[IoSlice<'_>], + ) -> Poll> { + loop { + match (*self).write_vectored(bufs) { + Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} + res => return Poll::Ready(res), + } + } + } + + fn poll_flush(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + loop { + match (*self).flush() { + Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} + res => return Poll::Ready(res), + } + } + } + + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.poll_flush(cx) + } +} From 58369279957f51f6f43151d9ef5478f034053ca6 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Thu, 21 Sep 2023 11:11:31 -0700 Subject: [PATCH 02/17] align rustix version with async-lsp --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 577f6aee5eb..2664235ce89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,4 +76,4 @@ wasm-bindgen-test = "0.3.33" base64 = "0.21.2" fxhash = "0.2.1" futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } -rustix = { version = "0.37.1", default-features = false, features = [ "std", "fs" ] } +rustix = { version = "0.38", default-features = false, features = [ "std", "fs" ] } From 73fd403f83acb47123ec7b218ddcec12bc9bfc92 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Thu, 21 Sep 2023 11:11:54 -0700 Subject: [PATCH 03/17] upgrade rust toolchain to build WASI correctly --- flake.nix | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 62f248233c8..c65e985ffae 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,7 @@ rustToolchain = fenix.packages.${system}.fromToolchainFile { file = ./rust-toolchain.toml; - sha256 = "sha256-Zk2rxv6vwKFkTTidgjPm6gDsseVmmljVt201H7zuDkk="; + sha256 = "sha256-riZUc+R9V35c/9e8KJUE+8pzpXyl0lRXt3ZkKlxoY0g="; }; craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 63f41db96a1..c0185fffbfb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.66.1" +channel = "1.67.0" components = [ "rust-src" ] targets = [ "wasm32-unknown-unknown", "wasm32-wasi", "aarch64-apple-darwin" ] profile = "default" From 733d8248209c971a519d179e7142405def89a43c Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Thu, 21 Sep 2023 11:13:39 -0700 Subject: [PATCH 04/17] regen lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index ce0b8ecb24e..0242c8ef7ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2317,7 +2317,7 @@ dependencies = [ "async-lsp", "futures", "noir_lsp", - "rustix 0.37.23", + "rustix 0.38.4", "tower", ] From 23f8f49987aa6bf084c78764907bf4a8e98a4476 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Thu, 21 Sep 2023 14:59:53 -0700 Subject: [PATCH 05/17] normalize the vscode-test-web scheme --- tooling/lsp/src/lib.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tooling/lsp/src/lib.rs b/tooling/lsp/src/lib.rs index ae174da1b33..2f84a969d81 100644 --- a/tooling/lsp/src/lib.rs +++ b/tooling/lsp/src/lib.rs @@ -160,7 +160,7 @@ fn on_initialize( state: &mut LspState, params: InitializeParams, ) -> impl Future> { - state.root_path = params.root_uri.and_then(|root_uri| root_uri.to_file_path().ok()); + state.root_path = params.root_uri.and_then(|root_uri| uri_to_file_path(&root_uri).ok()); async { let text_document_sync = @@ -355,7 +355,7 @@ fn on_code_lens_request( state: &mut LspState, params: CodeLensParams, ) -> impl Future> { - let file_path = match params.text_document.uri.to_file_path() { + let file_path = match uri_to_file_path(¶ms.text_document.uri) { Ok(file_path) => file_path, Err(()) => { return future::ready(Err(ResponseError::new( @@ -571,7 +571,7 @@ fn on_did_save_text_document( state: &mut LspState, params: DidSaveTextDocumentParams, ) -> ControlFlow> { - let file_path = match params.text_document.uri.to_file_path() { + let file_path = match uri_to_file_path(¶ms.text_document.uri) { Ok(file_path) => file_path, Err(()) => { return ControlFlow::Break(Err(ResponseError::new( @@ -709,6 +709,8 @@ fn get_package_tests_in_crate( package_tests.push(NargoTest { id: NargoTestId::new(crate_name.clone(), func_name.clone()), label: func_name, + // These `file://` URIs are currently normalized inside of the vscode extension + // TODO: Do proper normalization inside the LSP instead of at the extension uri: Url::from_file_path(file_path) .expect("Expected a valid file path that can be converted into a URI"), range, @@ -746,6 +748,15 @@ fn byte_span_to_range<'a, F: files::Files<'a> + ?Sized>( } } +// This smooths over `vscode-test-web://` or other schemes that may be sent from a browser client +fn uri_to_file_path(uri: &Url) -> Result { + if uri.scheme() == "vscode-test-web" { + Ok(PathBuf::from("/").join(uri.path())) + } else { + uri.to_file_path() + } +} + #[cfg(test)] mod lsp_tests { use lsp_types::TextDocumentSyncCapability; From 05b2af6e7e79044028530a2d615797b0ed51cf3d Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Thu, 21 Sep 2023 15:13:05 -0700 Subject: [PATCH 06/17] msrv to 1.67.0 --- .github/workflows/formatting.yml | 6 +++--- .github/workflows/publish.yml | 6 +++--- .github/workflows/test.yml | 2 +- .github/workflows/wasm.yml | 4 ++-- Cargo.toml | 2 +- README.md | 2 +- tooling/backend_interface/Cargo.toml | 2 +- tooling/nargo/build.rs | 4 ++-- tooling/nargo_cli/build.rs | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 07ae535a454..758547e2d7a 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 30 env: RUSTFLAGS: -Dwarnings - + strategy: fail-fast: false matrix: @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + uses: dtolnay/rust-toolchain@1.67.0 with: targets: ${{ matrix.target }} components: clippy, rustfmt @@ -53,7 +53,7 @@ jobs: name: eslint runs-on: ubuntu-latest timeout-minutes: 30 - + steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9d3ff9423ea..3687830bbdd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,7 +47,7 @@ jobs: echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-platform-version)" >> $GITHUB_ENV - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + uses: dtolnay/rust-toolchain@1.67.0 with: targets: ${{ matrix.target }} @@ -81,7 +81,7 @@ jobs: - name: Test built artifact if: matrix.target == 'x86_64-apple-darwin' run: | - cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/ + cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/ yarn workspace release-tests test - name: Upload binaries to release tag @@ -129,7 +129,7 @@ jobs: ref: ${{ inputs.tag || env.GITHUB_REF }} - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + uses: dtolnay/rust-toolchain@1.67.0 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5a94aaac4b..06b4ade6e9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v4 - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + uses: dtolnay/rust-toolchain@1.67.0 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 71972d5e5c5..6263fb6e915 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v4 - name: Setup toolchain - uses: dtolnay/rust-toolchain@1.66.0 + uses: dtolnay/rust-toolchain@1.67.0 - uses: Swatinem/rust-cache@v2 with: @@ -143,7 +143,7 @@ jobs: cp -r ./compiler/wasm/downloaded/nodejs ./compiler/wasm cp -r ./compiler/wasm/downloaded/web ./compiler/wasm yarn workspace @noir-lang/source-resolver build - + - name: Run node tests run: yarn workspace @noir-lang/noir_wasm test:node diff --git a/Cargo.toml b/Cargo.toml index 2664235ce89..aacd79eb903 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ version = "0.12.0" # x-release-please-end authors = ["The Noir Team "] edition = "2021" -rust-version = "1.66" +rust-version = "1.67" license = "MIT OR Apache-2.0" [workspace.dependencies] diff --git a/README.md b/README.md index 22ace1fd3b4..202d8f9904d 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Concretely the following items are on the road map: ## Minimum Rust version -This crate's minimum supported rustc version is 1.66.0. +This crate's minimum supported rustc version is 1.67.0. ## Working on this project diff --git a/tooling/backend_interface/Cargo.toml b/tooling/backend_interface/Cargo.toml index 127770c5722..981947e01e0 100644 --- a/tooling/backend_interface/Cargo.toml +++ b/tooling/backend_interface/Cargo.toml @@ -4,7 +4,7 @@ description = "The definition of the backend CLI interface which Nargo uses for version = "0.11.0" authors.workspace = true edition.workspace = true -rust-version = "1.66" +rust-version = "1.67" license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tooling/nargo/build.rs b/tooling/nargo/build.rs index cf52e8b2627..c9852cc9d80 100644 --- a/tooling/nargo/build.rs +++ b/tooling/nargo/build.rs @@ -2,8 +2,8 @@ use rustc_version::{version, Version}; fn check_rustc_version() { assert!( - version().unwrap() >= Version::parse("1.66.0").unwrap(), - "The minimal supported rustc version is 1.66.0." + version().unwrap() >= Version::parse("1.67.0").unwrap(), + "The minimal supported rustc version is 1.67.0." ); } diff --git a/tooling/nargo_cli/build.rs b/tooling/nargo_cli/build.rs index ff941e41f36..4ea108d6367 100644 --- a/tooling/nargo_cli/build.rs +++ b/tooling/nargo_cli/build.rs @@ -6,8 +6,8 @@ use std::{env, fs}; fn check_rustc_version() { assert!( - version().unwrap() >= Version::parse("1.66.0").unwrap(), - "The minimal supported rustc version is 1.66.0." + version().unwrap() >= Version::parse("1.67.0").unwrap(), + "The minimal supported rustc version is 1.67.0." ); } @@ -105,7 +105,7 @@ fn generate_compile_success_empty_tests(test_file: &mut File, test_data_dir: &Pa r#" #[test] fn compile_success_empty_{test_name}() {{ - + // We use a mocked backend for this test as we do not rely on the returned circuit size // but we must call a backend as part of querying the number of opcodes in the circuit. From abd0ec02e31473f696ae8f3dd7631ac8c162f693 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 29 Sep 2023 15:19:36 +0100 Subject: [PATCH 07/17] chore: clippy --- acvm-repo/acir/src/circuit/black_box_functions.rs | 2 +- compiler/fm/src/lib.rs | 2 +- .../src/brillig/brillig_gen/brillig_block_variables.rs | 3 +-- compiler/noirc_frontend/src/graph/mod.rs | 2 +- compiler/noirc_frontend/src/hir/resolution/resolver.rs | 10 +++++----- compiler/noirc_frontend/src/lexer/token.rs | 8 ++++---- compiler/noirc_frontend/src/parser/parser.rs | 5 ++--- compiler/wasm/src/compile.rs | 2 +- 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/acvm-repo/acir/src/circuit/black_box_functions.rs b/acvm-repo/acir/src/circuit/black_box_functions.rs index 17c990c7670..499d16dd2c5 100644 --- a/acvm-repo/acir/src/circuit/black_box_functions.rs +++ b/acvm-repo/acir/src/circuit/black_box_functions.rs @@ -107,7 +107,7 @@ mod tests { fn consistent_function_names() { for bb_func in BlackBoxFunc::iter() { let resolved_func = BlackBoxFunc::lookup(bb_func.name()).unwrap_or_else(|| { - panic!("BlackBoxFunc::lookup couldn't find black box function {}", bb_func) + panic!("BlackBoxFunc::lookup couldn't find black box function {bb_func}") }); assert_eq!( resolved_func, bb_func, diff --git a/compiler/fm/src/lib.rs b/compiler/fm/src/lib.rs index 1703db8d048..9375e8c39bd 100644 --- a/compiler/fm/src/lib.rs +++ b/compiler/fm/src/lib.rs @@ -277,7 +277,7 @@ mod tests { // - dir/lib.nr // - dir/sub_dir.nr // - dir/sub_dir/foo.nr - create_dummy_file(&dir, Path::new(&format!("{}.nr", sub_dir_name))); + create_dummy_file(&dir, Path::new(&format!("{sub_dir_name}.nr"))); // First check for the sub_dir.nr file and add it to the FileManager let sub_dir_file_id = fm.find_module(file_id, sub_dir_name).unwrap(); diff --git a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block_variables.rs b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block_variables.rs index cc65a84f1fa..adb357f07dd 100644 --- a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block_variables.rs +++ b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block_variables.rs @@ -95,8 +95,7 @@ impl BlockVariables { } else { assert!( self.available_variables.contains(&value_id), - "ICE: ValueId {:?} is not available", - value_id + "ICE: ValueId {value_id:?} is not available" ); *function_context diff --git a/compiler/noirc_frontend/src/graph/mod.rs b/compiler/noirc_frontend/src/graph/mod.rs index d8c539038df..3a40c87d8e7 100644 --- a/compiler/noirc_frontend/src/graph/mod.rs +++ b/compiler/noirc_frontend/src/graph/mod.rs @@ -312,7 +312,7 @@ mod tests { let mut vec_ids = Vec::with_capacity(n); for i in 0..n { let mut pth = PathBuf::new(); - pth.push(format!("{}", i)); + pth.push(format!("{i}")); pth.set_extension(FILE_EXTENSION); vec_ids.push(fm.add_file(pth.into(), String::new())); } diff --git a/compiler/noirc_frontend/src/hir/resolution/resolver.rs b/compiler/noirc_frontend/src/hir/resolution/resolver.rs index 3ddb3b9efa9..94ef9ec9d4e 100644 --- a/compiler/noirc_frontend/src/hir/resolution/resolver.rs +++ b/compiler/noirc_frontend/src/hir/resolution/resolver.rs @@ -1761,7 +1761,7 @@ mod test { let errors = resolve_src_code(src, vec!["main"]); // There should only be one error - assert!(errors.len() == 1, "Expected 1 error, got: {:?}", errors); + assert!(errors.len() == 1, "Expected 1 error, got: {errors:?}"); // It should be regarding the unused variable match &errors[0] { @@ -1831,7 +1831,7 @@ mod test { "#; let errors = resolve_src_code(src, vec!["main"]); - assert!(errors.len() == 3, "Expected 3 errors, got: {:?}", errors); + assert!(errors.len() == 3, "Expected 3 errors, got: {errors:?}"); // Errors are: // `a` is undeclared @@ -1907,7 +1907,7 @@ mod test { "#; let errors = resolve_src_code(src, vec!["main", "foo"]); if !errors.is_empty() { - println!("Unexpected errors: {:?}", errors); + println!("Unexpected errors: {errors:?}"); unreachable!("there should be no errors"); } } @@ -1979,7 +1979,7 @@ mod test { let errors = resolve_src_code(src, vec!["main", "foo"]); assert!(errors.is_empty()); if !errors.is_empty() { - println!("Unexpected errors: {:?}", errors); + println!("Unexpected errors: {errors:?}"); unreachable!("there should be no errors"); } @@ -2021,7 +2021,7 @@ mod test { "#; let errors = resolve_src_code(src, vec!["main", "println"]); - assert!(errors.len() == 2, "Expected 2 errors, got: {:?}", errors); + assert!(errors.len() == 2, "Expected 2 errors, got: {errors:?}"); for err in errors { match &err { diff --git a/compiler/noirc_frontend/src/lexer/token.rs b/compiler/noirc_frontend/src/lexer/token.rs index 6aabacd8940..44ef83d44a7 100644 --- a/compiler/noirc_frontend/src/lexer/token.rs +++ b/compiler/noirc_frontend/src/lexer/token.rs @@ -405,8 +405,8 @@ pub enum Attribute { impl fmt::Display for Attribute { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - Attribute::Function(attribute) => write!(f, "{}", attribute), - Attribute::Secondary(attribute) => write!(f, "{}", attribute), + Attribute::Function(attribute) => write!(f, "{attribute}"), + Attribute::Secondary(attribute) => write!(f, "{attribute}"), } } } @@ -527,7 +527,7 @@ impl FunctionAttribute { impl fmt::Display for FunctionAttribute { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - FunctionAttribute::Test(scope) => write!(f, "#[test{}]", scope), + FunctionAttribute::Test(scope) => write!(f, "#[test{scope}]"), FunctionAttribute::Foreign(ref k) => write!(f, "#[foreign({k})]"), FunctionAttribute::Builtin(ref k) => write!(f, "#[builtin({k})]"), FunctionAttribute::Oracle(ref k) => write!(f, "#[oracle({k})]"), @@ -730,7 +730,7 @@ mod keywords { for keyword in Keyword::iter() { let resolved_token = Keyword::lookup_keyword(&format!("{keyword}")).unwrap_or_else(|| { - panic!("Keyword::lookup_keyword couldn't find Keyword {}", keyword) + panic!("Keyword::lookup_keyword couldn't find Keyword {keyword}") }); assert_eq!( diff --git a/compiler/noirc_frontend/src/parser/parser.rs b/compiler/noirc_frontend/src/parser/parser.rs index 2d84bcdd4b4..2e8b70d9249 100644 --- a/compiler/noirc_frontend/src/parser/parser.rs +++ b/compiler/noirc_frontend/src/parser/parser.rs @@ -1631,7 +1631,7 @@ mod test { P: NoirParser, { vecmap(programs, move |program| { - let message = format!("Failed to parse:\n{}", program); + let message = format!("Failed to parse:\n{program}"); let (op_t, diagnostics) = parse_recover(&parser, program); diagnostics.iter().for_each(|diagnostic| { if diagnostic.is_error() { @@ -2356,8 +2356,7 @@ mod test { let num_errors = errors.len(); let shown_errors = show_errors(errors); eprintln!( - "\nExpected {} error(s) and got {}:\n\n{}\n\nFrom input: {}\nExpected AST: {}\nActual AST: {}\n", - expected_errors, num_errors, shown_errors, src, expected_result, actual); + "\nExpected {expected_errors} error(s) and got {num_errors}:\n\n{shown_errors}\n\nFrom input: {src}\nExpected AST: {expected_result}\nActual AST: {actual}\n"); } result }); diff --git a/compiler/wasm/src/compile.rs b/compiler/wasm/src/compile.rs index 99051a98407..3af07a2e6aa 100644 --- a/compiler/wasm/src/compile.rs +++ b/compiler/wasm/src/compile.rs @@ -80,7 +80,7 @@ fn add_noir_lib(context: &mut Context, library_name: &str) { context .crate_graph .add_dep(crate_id, library_name.parse().unwrap(), library_crate_id) - .unwrap_or_else(|_| panic!("ICE: Cyclic error triggered by {} library", library_name)); + .unwrap_or_else(|_| panic!("ICE: Cyclic error triggered by {library_name} library")); } } From 420e25ec9a1c603967fd55f0f16092a9b150bb41 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 29 Sep 2023 17:44:03 +0100 Subject: [PATCH 08/17] chore: move dependencies down into `noir_lsp_wasm` --- Cargo.toml | 2 -- tooling/lsp_wasm/Cargo.toml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6f3b59f56e8..fe7e32933df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,8 +84,6 @@ wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] } wasm-bindgen-test = "0.3.33" base64 = "0.21.2" fxhash = "0.2.1" -futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } -rustix = { version = "0.38", default-features = false, features = [ "std", "fs" ] } acir = { path = "acvm-repo/acir", default-features = false } acvm = { path = "acvm-repo/acvm" } acir_field = { path = "acvm-repo/acir_field", default-features = false } diff --git a/tooling/lsp_wasm/Cargo.toml b/tooling/lsp_wasm/Cargo.toml index b75b99f513e..de4b233bcb4 100644 --- a/tooling/lsp_wasm/Cargo.toml +++ b/tooling/lsp_wasm/Cargo.toml @@ -12,6 +12,6 @@ license.workspace = true acvm.workspace = true noir_lsp.workspace = true tower.workspace = true -futures.workspace = true -rustix.workspace = true +futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } +rustix = { version = "0.38", default-features = false, features = [ "std", "fs" ] } async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait"] } From 7d31a7a7f41bb4e34c72dfcfa0f74f2f6ea4413c Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 29 Sep 2023 19:38:27 +0100 Subject: [PATCH 09/17] chore: remove unused dependencies --- Cargo.lock | 11 ++++------- Cargo.toml | 1 - tooling/lsp/Cargo.toml | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index baf896afd3e..b680e58069e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72bd600f2652d2cccb0a33ab4f92d163ab3930844c8b0ad3713a5ae3285eeb4e" dependencies = [ "futures", - "lsp-types 0.94.0", + "lsp-types 0.94.1", "pin-project-lite", "rustix 0.38.4", "serde", @@ -2161,9 +2161,9 @@ dependencies = [ [[package]] name = "lsp-types" -version = "0.94.0" +version = "0.94.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b63735a13a1f9cd4f4835223d828ed9c2e35c8c5e61837774399f558b6a1237" +checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" dependencies = [ "bitflags 1.3.2", "serde", @@ -2343,11 +2343,10 @@ version = "0.15.0" dependencies = [ "acvm", "async-lsp", - "barretenberg_blackbox_solver", "codespan-lsp", "codespan-reporting", "fm", - "lsp-types 0.94.0", + "lsp-types 0.94.1", "nargo", "nargo_toml", "noirc_driver", @@ -2356,7 +2355,6 @@ dependencies = [ "serde", "serde_json", "tokio", - "toml", "tower", ] @@ -2368,7 +2366,6 @@ dependencies = [ "async-lsp", "futures", "noir_lsp", - "rustix 0.38.4", "tower", ] diff --git a/Cargo.toml b/Cargo.toml index fe7e32933df..c273c9628d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,6 @@ chumsky = { git = "https://github.com/jfecher/chumsky", rev = "ad9d312", default "std", ] } dirs = "4" -lsp-types = "0.94" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0" smol_str = "0.1.17" diff --git a/tooling/lsp/Cargo.toml b/tooling/lsp/Cargo.toml index f0fed1e0552..316636f8466 100644 --- a/tooling/lsp/Cargo.toml +++ b/tooling/lsp/Cargo.toml @@ -10,11 +10,9 @@ license.workspace = true [dependencies] acvm.workspace = true -barretenberg_blackbox_solver.workspace = true codespan-lsp.workspace = true codespan-reporting.workspace = true fm.workspace = true -lsp-types.workspace = true nargo.workspace = true nargo_toml.workspace = true noirc_driver.workspace = true @@ -22,8 +20,8 @@ noirc_errors.workspace = true noirc_frontend.workspace = true serde.workspace = true serde_json.workspace = true -toml.workspace = true tower.workspace = true +lsp-types = "0.94.1" async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait"] } [dev-dependencies] From 4901267d600efd718c5da3dfa6f504df5ec194d0 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 29 Sep 2023 19:38:56 +0100 Subject: [PATCH 10/17] chore: push stdio implementation upstream --- Cargo.lock | 3 +- Cargo.toml | 3 + tooling/lsp_wasm/Cargo.toml | 3 +- tooling/lsp_wasm/src/backend.rs | 2 +- tooling/lsp_wasm/src/main.rs | 7 +- tooling/lsp_wasm/src/stdio.rs | 175 -------------------------------- 6 files changed, 9 insertions(+), 184 deletions(-) delete mode 100644 tooling/lsp_wasm/src/stdio.rs diff --git a/Cargo.lock b/Cargo.lock index b680e58069e..46f6569911a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,8 +380,7 @@ dependencies = [ [[package]] name = "async-lsp" version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72bd600f2652d2cccb0a33ab4f92d163ab3930844c8b0ad3713a5ae3285eeb4e" +source = "git+https://github.com/TomAFrench/async-lsp?branch=tf/futures#57ea149b7438462cb641fc71bfa5363f3b38f24d" dependencies = [ "futures", "lsp-types 0.94.1", diff --git a/Cargo.toml b/Cargo.toml index c273c9628d2..3548367f629 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,3 +102,6 @@ num-traits = "0.2" # This is required to be able to run `cargo test` in acvm_js due to the `locals exceeds maximum` error. # See https://ritik-mishra.medium.com/resolving-the-wasm-pack-error-locals-exceed-maximum-ec3a9d96685b opt-level = 1 + +[patch.crates-io] +async-lsp = { git = "https://github.com/TomAFrench/async-lsp", branch = "tf/futures" } diff --git a/tooling/lsp_wasm/Cargo.toml b/tooling/lsp_wasm/Cargo.toml index de4b233bcb4..5ceac4bbfcd 100644 --- a/tooling/lsp_wasm/Cargo.toml +++ b/tooling/lsp_wasm/Cargo.toml @@ -13,5 +13,4 @@ acvm.workspace = true noir_lsp.workspace = true tower.workspace = true futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } -rustix = { version = "0.38", default-features = false, features = [ "std", "fs" ] } -async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait"] } +async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait", "stdio"] } diff --git a/tooling/lsp_wasm/src/backend.rs b/tooling/lsp_wasm/src/backend.rs index 523b8658fd6..9666aaefad6 100644 --- a/tooling/lsp_wasm/src/backend.rs +++ b/tooling/lsp_wasm/src/backend.rs @@ -1,6 +1,6 @@ use acvm::BlackBoxFunctionSolver; -pub struct MockBackend; +pub(crate) struct MockBackend; impl BlackBoxFunctionSolver for MockBackend { fn schnorr_verify( diff --git a/tooling/lsp_wasm/src/main.rs b/tooling/lsp_wasm/src/main.rs index 4f381695617..896b5ac50b0 100644 --- a/tooling/lsp_wasm/src/main.rs +++ b/tooling/lsp_wasm/src/main.rs @@ -3,7 +3,6 @@ use noir_lsp::NargoLspService; use tower::ServiceBuilder; mod backend; -mod stdio; fn main() { // let blackbox_solver = acvm::blackbox_solver::BarretenbergSolver::initialize().await; @@ -18,10 +17,10 @@ fn main() { .service(router) }); - let stdin = stdio::PipeStdin::lock().expect("stdin to lock"); - let stdout = stdio::PipeStdout::lock().expect("stdout to lock"); + let stdin = async_lsp::stdio::PipeStdin::lock().expect("stdin to lock"); + let stdout = async_lsp::stdio::PipeStdout::lock().expect("stdout to lock"); futures::executor::block_on(async { server.run_buffered(stdin, stdout).await.expect("server should start"); - }) + }); } diff --git a/tooling/lsp_wasm/src/stdio.rs b/tooling/lsp_wasm/src/stdio.rs deleted file mode 100644 index 4c117005898..00000000000 --- a/tooling/lsp_wasm/src/stdio.rs +++ /dev/null @@ -1,175 +0,0 @@ -use futures::{AsyncRead, AsyncWrite}; -use std::io::{self, IoSlice, IoSliceMut, Read, StdinLock, StdoutLock, Write}; -use std::os::fd::{AsFd, AsRawFd, BorrowedFd, RawFd}; -use std::{ - pin::Pin, - task::{Context, Poll}, -}; - -// WASI-compatible stdin/stdout that implements AsyncRead and AsyncWrite -// Based on the PipeStdin and PipeStdout in async_lsp -// TODO: Upstream to async_lsp -#[derive(Debug)] -pub struct PipeStdin { - inner: StdinLock<'static>, -} - -impl PipeStdin { - pub fn lock() -> io::Result { - let inner = io::stdin().lock(); - Ok(Self { inner }) - } -} - -impl AsFd for PipeStdin { - fn as_fd(&self) -> BorrowedFd<'_> { - self.inner.as_fd() - } -} - -impl AsRawFd for PipeStdin { - fn as_raw_fd(&self) -> RawFd { - self.inner.as_raw_fd() - } -} - -impl Read for &'_ PipeStdin { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - rustix::io::read(self, buf).map_err(Into::into) - } - - fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result { - rustix::io::readv(self, bufs).map_err(Into::into) - } -} - -impl Read for PipeStdin { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - <&PipeStdin>::read(&mut &*self, buf) - } - - fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result { - <&PipeStdin>::read_vectored(&mut &*self, bufs) - } -} - -#[derive(Debug)] -pub struct PipeStdout { - inner: StdoutLock<'static>, -} - -impl PipeStdout { - pub fn lock() -> io::Result { - let inner = io::stdout().lock(); - Ok(Self { inner }) - } -} - -impl AsFd for PipeStdout { - fn as_fd(&self) -> BorrowedFd<'_> { - self.inner.as_fd() - } -} - -impl AsRawFd for PipeStdout { - fn as_raw_fd(&self) -> RawFd { - self.inner.as_raw_fd() - } -} - -impl Write for &'_ PipeStdout { - fn write(&mut self, buf: &[u8]) -> io::Result { - rustix::io::write(self, buf).map_err(Into::into) - } - - fn flush(&mut self) -> io::Result<()> { - Ok(()) - } - - fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { - rustix::io::writev(self, bufs).map_err(Into::into) - } -} - -impl Write for PipeStdout { - fn write(&mut self, buf: &[u8]) -> io::Result { - <&PipeStdout>::write(&mut &*self, buf) - } - - fn flush(&mut self) -> io::Result<()> { - <&PipeStdout>::flush(&mut &*self) - } - - fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { - <&PipeStdout>::write_vectored(&mut &*self, bufs) - } -} - -impl AsyncRead for PipeStdin { - fn poll_read( - mut self: Pin<&mut Self>, - _cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { - loop { - match (*self).read(buf) { - Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} - res => return Poll::Ready(res), - } - } - } - - fn poll_read_vectored( - mut self: Pin<&mut Self>, - _cx: &mut Context<'_>, - bufs: &mut [IoSliceMut<'_>], - ) -> Poll> { - loop { - match (*self).read_vectored(bufs) { - Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} - res => return Poll::Ready(res), - } - } - } -} - -impl AsyncWrite for PipeStdout { - fn poll_write( - mut self: Pin<&mut Self>, - _cx: &mut Context<'_>, - buf: &[u8], - ) -> Poll> { - loop { - match (*self).write(buf) { - Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} - res => return Poll::Ready(res), - } - } - } - - fn poll_write_vectored( - mut self: Pin<&mut Self>, - _cx: &mut Context<'_>, - bufs: &[IoSlice<'_>], - ) -> Poll> { - loop { - match (*self).write_vectored(bufs) { - Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} - res => return Poll::Ready(res), - } - } - } - - fn poll_flush(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { - loop { - match (*self).flush() { - Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} - res => return Poll::Ready(res), - } - } - } - - fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - self.poll_flush(cx) - } -} From 10561d5162b393670f5504b37e504b30e3e60c05 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 31 Oct 2023 22:41:14 +0000 Subject: [PATCH 11/17] chore: fix `rust-version` field --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5131ca1eed6..3a4635617b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ version = "0.18.0" # x-release-please-end authors = ["The Noir Team "] edition = "2021" -rust-version = "1.67" +rust-version = "1.71.1" license = "MIT OR Apache-2.0" repository = "https://github.com/noir-lang/noir/" From b3de1bfc084864d8a74801fe96f2940373633d8b Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 31 Oct 2023 22:46:02 +0000 Subject: [PATCH 12/17] chore: fix merge --- tooling/lsp/src/solver.rs | 12 ++++++++---- tooling/lsp_wasm/src/backend.rs | 24 ++++++++++++++++-------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/tooling/lsp/src/solver.rs b/tooling/lsp/src/solver.rs index 090f71d63b4..4b37c204175 100644 --- a/tooling/lsp/src/solver.rs +++ b/tooling/lsp/src/solver.rs @@ -55,7 +55,7 @@ impl BlackBoxFunctionSolver for MockBackend { _signature: &[u8], _message: &[u8], ) -> Result { - unimplemented!() + Err(acvm::BlackBoxResolutionError::Unsupported(acvm::acir::BlackBoxFunc::SchnorrVerify)) } fn pedersen_commitment( @@ -63,7 +63,9 @@ impl BlackBoxFunctionSolver for MockBackend { _inputs: &[acvm::FieldElement], _domain_separator: u32, ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!() + Err(acvm::BlackBoxResolutionError::Unsupported( + acvm::acir::BlackBoxFunc::PedersenCommitment, + )) } fn fixed_base_scalar_mul( @@ -71,7 +73,9 @@ impl BlackBoxFunctionSolver for MockBackend { _low: &acvm::FieldElement, _high: &acvm::FieldElement, ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!() + Err(acvm::BlackBoxResolutionError::Unsupported( + acvm::acir::BlackBoxFunc::FixedBaseScalarMul, + )) } fn pedersen_hash( @@ -79,6 +83,6 @@ impl BlackBoxFunctionSolver for MockBackend { _inputs: &[acvm::FieldElement], _domain_separator: u32, ) -> Result { - unimplemented!() + Err(acvm::BlackBoxResolutionError::Unsupported(acvm::acir::BlackBoxFunc::PedersenHash)) } } diff --git a/tooling/lsp_wasm/src/backend.rs b/tooling/lsp_wasm/src/backend.rs index 9666aaefad6..25e2db1cfe2 100644 --- a/tooling/lsp_wasm/src/backend.rs +++ b/tooling/lsp_wasm/src/backend.rs @@ -10,17 +10,25 @@ impl BlackBoxFunctionSolver for MockBackend { _signature: &[u8], _message: &[u8], ) -> Result { - unimplemented!( - "schnorr_verify blackbox function is not currently supported in the Wasm LSP" - ) + Err(acvm::BlackBoxResolutionError::Unsupported(acvm::acir::BlackBoxFunc::SchnorrVerify)) } - fn pedersen( + fn pedersen_commitment( &self, _inputs: &[acvm::FieldElement], _domain_separator: u32, ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!("pedersen blackbox function is not currently supported in the Wasm LSP") + Err(acvm::BlackBoxResolutionError::Unsupported( + acvm::acir::BlackBoxFunc::PedersenCommitment, + )) + } + + fn pedersen_hash( + &self, + _inputs: &[acvm::FieldElement], + _domain_separator: u32, + ) -> Result { + Err(acvm::BlackBoxResolutionError::Unsupported(acvm::acir::BlackBoxFunc::PedersenHash)) } fn fixed_base_scalar_mul( @@ -28,8 +36,8 @@ impl BlackBoxFunctionSolver for MockBackend { _low: &acvm::FieldElement, _high: &acvm::FieldElement, ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!( - "fixed_base_scalar_mul blackbox function is not currently supported in the Wasm LSP" - ) + Err(acvm::BlackBoxResolutionError::Unsupported( + acvm::acir::BlackBoxFunc::FixedBaseScalarMul, + )) } } From 1a9a5b4bd3ae198a49445443cb1b5452902706d7 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 31 Oct 2023 22:48:01 +0000 Subject: [PATCH 13/17] chore: enforce consistent version on noir_lsp_wasm --- tooling/lsp_wasm/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/lsp_wasm/Cargo.toml b/tooling/lsp_wasm/Cargo.toml index 5ceac4bbfcd..743b13ada55 100644 --- a/tooling/lsp_wasm/Cargo.toml +++ b/tooling/lsp_wasm/Cargo.toml @@ -13,4 +13,4 @@ acvm.workspace = true noir_lsp.workspace = true tower.workspace = true futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } -async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait", "stdio"] } +async-lsp = { workspace = true, features = ["omni-trait", "stdio"] } From 43a15b730ff65fcc6c340c03d12497907c2cbf45 Mon Sep 17 00:00:00 2001 From: Tom French Date: Tue, 31 Oct 2023 23:24:01 +0000 Subject: [PATCH 14/17] chore: use upstream async-lsp --- Cargo.lock | 108 ++++++++++++++++++++++++++++++----- Cargo.toml | 2 +- tooling/lsp_wasm/Cargo.toml | 3 +- tooling/lsp_wasm/src/main.rs | 8 +++ 4 files changed, 106 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb154189431..257984f753b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,15 +388,45 @@ dependencies = [ "tempfile", ] +[[package]] +name = "async-io" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10da8f3146014722c89e7859e1d7bb97873125d7346d10ca642ffab794355828" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix 0.38.13", + "slab", + "tracing", + "waker-fn", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", +] + [[package]] name = "async-lsp" version = "0.0.5" -source = "git+https://github.com/TomAFrench/async-lsp?branch=tf/futures#57ea149b7438462cb641fc71bfa5363f3b38f24d" +source = "git+https://github.com/oxalica/async-lsp?rev=4568bd6c2039bb03d88eae2f4f8aa2a64d71fadb#4568bd6c2039bb03d88eae2f4f8aa2a64d71fadb" dependencies = [ + "async-io", "futures", "lsp-types 0.94.1", "pin-project-lite", - "rustix 0.38.4", + "rustix 0.38.13", "serde", "serde_json", "thiserror", @@ -528,9 +558,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitmaps" @@ -897,6 +927,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "concurrent-queue" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.15.7" @@ -1501,6 +1540,12 @@ dependencies = [ "str-buf", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "eyre" version = "0.6.8" @@ -1533,7 +1578,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" dependencies = [ "cfg-if", - "rustix 0.38.4", + "rustix 0.38.13", "windows-sys 0.48.0", ] @@ -1679,6 +1724,16 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.28" @@ -2189,7 +2244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.4", + "rustix 0.38.13", "windows-sys 0.48.0", ] @@ -2274,9 +2329,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" @@ -2581,6 +2636,7 @@ name = "noir_lsp_wasm" version = "0.18.0" dependencies = [ "acvm", + "async-io", "async-lsp", "futures", "noir_lsp", @@ -2818,6 +2874,12 @@ dependencies = [ "sha2", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2953,6 +3015,20 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "polling" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.13", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "pprof" version = "0.12.1" @@ -3503,14 +3579,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] @@ -4587,10 +4663,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54f8c3c56044fc359f905b72879576a15d49c46d085ed6266a98826716f14033" dependencies = [ - "rustix 0.38.4", + "rustix 0.38.13", "windows-sys 0.48.0", ] +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + [[package]] name = "walkdir" version = "2.3.3" diff --git a/Cargo.toml b/Cargo.toml index 3a4635617b1..7a260693201 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,4 +127,4 @@ num-traits = "0.2" opt-level = 1 [patch.crates-io] -async-lsp = { git = "https://github.com/TomAFrench/async-lsp", branch = "tf/futures" } +async-lsp = { git = "https://github.com/oxalica/async-lsp", rev = "4568bd6c2039bb03d88eae2f4f8aa2a64d71fadb" } diff --git a/tooling/lsp_wasm/Cargo.toml b/tooling/lsp_wasm/Cargo.toml index 743b13ada55..a9ece204d36 100644 --- a/tooling/lsp_wasm/Cargo.toml +++ b/tooling/lsp_wasm/Cargo.toml @@ -13,4 +13,5 @@ acvm.workspace = true noir_lsp.workspace = true tower.workspace = true futures = { version = "0.3.28", default-features = false, features = ["async-await", "std", "executor"] } -async-lsp = { workspace = true, features = ["omni-trait", "stdio"] } +async-lsp = { workspace = true, features = ["omni-trait", "stdio", "async-io"] } +async-io = "2" diff --git a/tooling/lsp_wasm/src/main.rs b/tooling/lsp_wasm/src/main.rs index 896b5ac50b0..ceaea4eab64 100644 --- a/tooling/lsp_wasm/src/main.rs +++ b/tooling/lsp_wasm/src/main.rs @@ -1,3 +1,8 @@ +#![forbid(unsafe_code)] +#![warn(unreachable_pub)] +#![warn(clippy::semicolon_if_nothing_returned)] +#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))] + use async_lsp::{concurrency::ConcurrencyLayer, panic::CatchUnwindLayer, server::LifecycleLayer}; use noir_lsp::NargoLspService; use tower::ServiceBuilder; @@ -20,6 +25,9 @@ fn main() { let stdin = async_lsp::stdio::PipeStdin::lock().expect("stdin to lock"); let stdout = async_lsp::stdio::PipeStdout::lock().expect("stdout to lock"); + let stdin = async_io::Async::new(stdin).expect("stdin to async-ify"); + let stdout = async_io::Async::new(stdout).expect("stdout to async-ify"); + futures::executor::block_on(async { server.run_buffered(stdin, stdout).await.expect("server should start"); }); From a1a4310412252615491e3ddb2da789f958c88fed Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 17 Nov 2023 20:35:53 +0000 Subject: [PATCH 15/17] chore: remove unused patch --- Cargo.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 97accd95f3e..7a10f282437 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -124,7 +124,4 @@ num-traits = "0.2" [profile.dev] # This is required to be able to run `cargo test` in acvm_js due to the `locals exceeds maximum` error. # See https://ritik-mishra.medium.com/resolving-the-wasm-pack-error-locals-exceed-maximum-ec3a9d96685b -opt-level = 1 - -[patch.crates-io] -async-lsp = { git = "https://github.com/oxalica/async-lsp", rev = "4568bd6c2039bb03d88eae2f4f8aa2a64d71fadb" } +opt-level = 1 \ No newline at end of file From 389b7a05230bc52b9a1e70fffe3a88710c2fde86 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Sun, 21 Apr 2024 00:35:40 +0000 Subject: [PATCH 16/17] chore: fix build --- tooling/lsp_wasm/src/backend.rs | 43 --------------------------------- tooling/lsp_wasm/src/main.rs | 3 +-- 2 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 tooling/lsp_wasm/src/backend.rs diff --git a/tooling/lsp_wasm/src/backend.rs b/tooling/lsp_wasm/src/backend.rs deleted file mode 100644 index 25e2db1cfe2..00000000000 --- a/tooling/lsp_wasm/src/backend.rs +++ /dev/null @@ -1,43 +0,0 @@ -use acvm::BlackBoxFunctionSolver; - -pub(crate) struct MockBackend; - -impl BlackBoxFunctionSolver for MockBackend { - fn schnorr_verify( - &self, - _public_key_x: &acvm::FieldElement, - _public_key_y: &acvm::FieldElement, - _signature: &[u8], - _message: &[u8], - ) -> Result { - Err(acvm::BlackBoxResolutionError::Unsupported(acvm::acir::BlackBoxFunc::SchnorrVerify)) - } - - fn pedersen_commitment( - &self, - _inputs: &[acvm::FieldElement], - _domain_separator: u32, - ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - Err(acvm::BlackBoxResolutionError::Unsupported( - acvm::acir::BlackBoxFunc::PedersenCommitment, - )) - } - - fn pedersen_hash( - &self, - _inputs: &[acvm::FieldElement], - _domain_separator: u32, - ) -> Result { - Err(acvm::BlackBoxResolutionError::Unsupported(acvm::acir::BlackBoxFunc::PedersenHash)) - } - - fn fixed_base_scalar_mul( - &self, - _low: &acvm::FieldElement, - _high: &acvm::FieldElement, - ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - Err(acvm::BlackBoxResolutionError::Unsupported( - acvm::acir::BlackBoxFunc::FixedBaseScalarMul, - )) - } -} diff --git a/tooling/lsp_wasm/src/main.rs b/tooling/lsp_wasm/src/main.rs index ceaea4eab64..cbddeedd40a 100644 --- a/tooling/lsp_wasm/src/main.rs +++ b/tooling/lsp_wasm/src/main.rs @@ -7,11 +7,10 @@ use async_lsp::{concurrency::ConcurrencyLayer, panic::CatchUnwindLayer, server:: use noir_lsp::NargoLspService; use tower::ServiceBuilder; -mod backend; fn main() { // let blackbox_solver = acvm::blackbox_solver::BarretenbergSolver::initialize().await; - let blackbox_solver = backend::MockBackend; + let blackbox_solver = acvm::blackbox_solver::StubbedBlackBoxSolver; let (server, _) = async_lsp::MainLoop::new_server(|client| { let router = NargoLspService::new(&client, blackbox_solver); From ee07c58a379c276d7f1398045382724daa6c79c7 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Sun, 21 Apr 2024 17:52:54 +0000 Subject: [PATCH 17/17] chore: fix CI --- Cargo.lock | 53 +++++++++++++++++++++++++++--------- tooling/lsp_wasm/src/main.rs | 1 - 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41ecf726dec..8d3f951dddb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -812,9 +812,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -4178,12 +4178,27 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "rkyv" version = "0.7.42" @@ -4283,12 +4298,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-webpki", "sct", ] @@ -4304,12 +4319,12 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -4450,8 +4465,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -4785,6 +4800,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.6.0" @@ -5430,6 +5451,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "1.7.2" diff --git a/tooling/lsp_wasm/src/main.rs b/tooling/lsp_wasm/src/main.rs index cbddeedd40a..07246dff63c 100644 --- a/tooling/lsp_wasm/src/main.rs +++ b/tooling/lsp_wasm/src/main.rs @@ -7,7 +7,6 @@ use async_lsp::{concurrency::ConcurrencyLayer, panic::CatchUnwindLayer, server:: use noir_lsp::NargoLspService; use tower::ServiceBuilder; - fn main() { // let blackbox_solver = acvm::blackbox_solver::BarretenbergSolver::initialize().await; let blackbox_solver = acvm::blackbox_solver::StubbedBlackBoxSolver;