Skip to content

Commit

Permalink
remove default sc-meta installation when installing rust
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Sep 21, 2023
1 parent edb1c59 commit 0c9aaa9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ jobs:
- name: Setup test dependencies
run: |
python3 -m multiversx_sdk_cli.cli deps install testwallets
python3 -m multiversx_sdk_cli.cli deps install wasm-opt
rustup default nightly-2023-05-26
cargo install multiversx-sc-meta
ls $HOME/.cargo/bin
echo $PATH
cat $HOME/.bashrc
python3 -m multiversx_sdk_cli.cli deps install wasm-op
python3 -m multiversx_sdk_cli.cli deps install rust --overwrite
- name: Run unit tests
run: |
export PYTHONPATH=.
Expand Down
5 changes: 1 addition & 4 deletions multiversx_sdk_cli/dependencies/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,8 @@ def _do_install(self, tag: str) -> None:

args = [str(installer_path), "--verbose", "--default-toolchain", toolchain, "--profile",
"minimal", "--target", "wasm32-unknown-unknown", "-y"]
output = myprocess.run_process(args)

if output:
sc_meta_args = ["cargo", "install", "multiversx-sc-meta"]
myprocess.run_process(sc_meta_args)
myprocess.run_process(args)

def _get_installer_url(self) -> str:
if workstation.is_windows():
Expand Down
10 changes: 10 additions & 0 deletions multiversx_sdk_cli/projects/project_rust.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import shutil
import subprocess
from pathlib import Path
from typing import Any, Dict, List, Set, cast
Expand Down Expand Up @@ -53,7 +54,14 @@ def prepare_build_wasm_args(self, args: List[str]):
self.get_output_folder()
])

def check_if_sc_meta_is_installed(self):
which_sc_meta = shutil.which("sc-meta")

if which_sc_meta is None:
raise errors.KnownError("'sc-meta' is not installed. Run 'cargo install multiversx-sc-meta' then try again.")

def run_meta(self):
self.check_if_sc_meta_is_installed()
env = self.get_env()

with_wasm_opt = not self.options.get("no-wasm-opt")
Expand Down Expand Up @@ -123,6 +131,8 @@ def get_env(self):
return dependencies.get_module_by_key("rust").get_env()

def build_wasm_with_debug_symbols(self, build_options: Dict[str, Any]):
self.check_if_sc_meta_is_installed()

cwd = self.path
env = self.get_env()
target_dir: str = build_options.get("target-dir", "")
Expand Down

0 comments on commit 0c9aaa9

Please sign in to comment.