-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install rust globally #331
Changes from 4 commits
a5b0c84
7250ffa
69fba5e
0bb5667
5295378
2845d07
6906afa
cad2cbd
47c897e
7ef887f
6c22bac
e9542fe
67defe7
45e9698
362cb9b
edb1c59
0c9aaa9
d7681dd
87df9d4
84ce195
b3c6a0c
3cbff95
c597e34
485bfaf
d5999e9
837b794
39f1b77
177d263
648cb4c
340e5e1
fc8609a
8eea743
ad585ea
851bd30
d2af8f5
d8bb7a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,12 +269,12 @@ | |
toolchain = "nightly" | ||
|
||
args = [str(installer_path), "--verbose", "--default-toolchain", toolchain, "--profile", | ||
"minimal", "--target", "wasm32-unknown-unknown", "--no-modify-path", "-y"] | ||
output = myprocess.run_process(args, env=self.get_env_for_install()) | ||
"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, env=self.get_env_for_install()) | ||
myprocess.run_process(sc_meta_args) | ||
|
||
def _get_installer_url(self) -> str: | ||
if workstation.is_windows(): | ||
|
@@ -317,25 +317,8 @@ | |
tools_folder = workstation.get_tools_folder() | ||
return tools_folder / "vendor-rust" | ||
|
||
def get_env(self): | ||
directory = self.get_directory("") | ||
resolution = self.get_resolution() | ||
|
||
if resolution == DependencyResolution.Host: | ||
return { | ||
"PATH": os.environ.get("PATH", ""), | ||
"RUSTUP_HOME": os.environ.get("RUSTUP_HOME", ""), | ||
"CARGO_HOME": os.environ.get("CARGO_HOME", "") | ||
} | ||
if resolution == DependencyResolution.SDK: | ||
return { | ||
# At this moment, cc (build-essential) is sometimes required by the meta crate (e.g. for reports) | ||
"PATH": f"{path.join(directory, 'bin')}:{os.environ['PATH']}", | ||
"RUSTUP_HOME": str(directory), | ||
"CARGO_HOME": str(directory) | ||
} | ||
|
||
raise errors.BadDependencyResolution(self.key, resolution) | ||
def get_env(self) -> Dict[str, str]: | ||
return dict(os.environ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. |
||
|
||
def _get_env_for_is_installed_in_sdk(self) -> Dict[str, str]: | ||
directory = self.get_directory("") | ||
|
@@ -347,14 +330,7 @@ | |
} | ||
|
||
def get_env_for_install(self): | ||
directory = self.get_directory("") | ||
|
||
env = { | ||
# For installation, wget (or curl) and cc (build-essential) are also required. | ||
"PATH": f"{path.join(directory, 'bin')}:{os.environ['PATH']}", | ||
"RUSTUP_HOME": str(directory), | ||
"CARGO_HOME": str(directory) | ||
} | ||
env: Dict[str, str] = {} | ||
Check warning on line 333 in multiversx_sdk_cli/dependencies/modules.py GitHub Actions / runner / mypy
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, we can do the same as for |
||
|
||
if workstation.is_windows(): | ||
env["RUSTUP_USE_HYPER"] = "1" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀