diff --git a/rust-toolchain.toml b/rust-toolchain.toml index be0ef543..1deb8306 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,6 +2,6 @@ # This specifies the version of Rust we use to build. # Individual crates in the workspace may support a lower version, as indicated by `rust-version` field in each crate's `Cargo.toml`. # The version specified below, should be at least as high as the maximum `rust-version` within the workspace. -channel = "1.80" +channel = "stable" components = ["rustfmt", "clippy", "rust-analyzer"] targets = ["wasm32-unknown-unknown"] diff --git a/workspaces/src/cargo/mod.rs b/workspaces/src/cargo/mod.rs index 9f6f5010..325e1ebd 100644 --- a/workspaces/src/cargo/mod.rs +++ b/workspaces/src/cargo/mod.rs @@ -1,7 +1,5 @@ use crate::error::ErrorKind; -use cargo_near::commands::build_command::{BuildCommand, BuildContext, CliBuildCommand}; - /// Builds the cargo project located at `project_path` and returns the generated wasm file contents. /// /// NOTE: This function does not check whether the resulting wasm file is a valid smart @@ -16,12 +14,10 @@ pub async fn compile_project(project_path: &str) -> crate::Result> { _ => ErrorKind::Io.custom(e), })?; - // Hack to create a structure as no_docker is private in BuildCommand - let cargo_near_build_command: BuildCommand = CliBuildCommand { + let cargo_opts = cargo_near::BuildOpts { no_release: false, - no_docker: true, - no_locked: false, no_embed_abi: false, + no_locked: true, no_doc: true, color: None, no_abi: true, @@ -39,12 +35,9 @@ pub async fn compile_project(project_path: &str) -> crate::Result> { ), features: None, no_default_features: false, - } - .into(); + }; - let compile_artifact = cargo_near_build_command - .run(BuildContext::Build) - .map_err(|e| ErrorKind::Io.custom(e))?; + let compile_artifact = cargo_near::build(cargo_opts).map_err(|e| ErrorKind::Io.custom(e))?; let file = compile_artifact .path