lordgamez commented on code in PR #2307:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2307#discussion_r4612605186
##########
bootstrap/package_manager.py:
##########
@@ -31,11 +32,35 @@ def _query_yes_no(question: str, no_confirm: bool) -> bool:
print("Please respond with 'yes' or 'no' (or 'y' or 'n').")
+def _is_rust_installed() -> bool:
+ cargo_bin = os.path.expanduser("~/.cargo/bin")
+ search_path = os.environ.get("PATH", "") + os.pathsep + cargo_bin
+ rustc = shutil.which("rustc", path=search_path)
+ cargo = shutil.which("cargo", path=search_path)
+ if not rustc or not cargo:
+ return False
+
+ try:
+ subprocess.run([rustc, "--version"], check=True, capture_output=True)
+ subprocess.run([cargo, "--version"], check=True, capture_output=True)
+ except (subprocess.CalledProcessError, OSError):
+ return False
Review Comment:
Removed output capture in
https://github.com/apache/nifi-minifi-cpp/pull/2307/commits/c978943949cda27963190c4fcfdffc5f2beb5945
##########
bootstrap/package_manager.py:
##########
@@ -266,6 +323,7 @@ def _get_activate_venv_path():
def _minifi_setup_env_str(vs_where_location: VsWhereLocation) -> str:
return f"""
call refreshenv
+set _OLD_VIRTUAL_PATH=
Review Comment:
Added comment in
https://github.com/apache/nifi-minifi-cpp/pull/2307/commits/c978943949cda27963190c4fcfdffc5f2beb5945
##########
bootstrap/package_manager.py:
##########
@@ -178,14 +224,18 @@ def __init__(self, no_confirm):
PackageManager.__init__(self, no_confirm)
def install(self, dependencies: dict[str, set[str]]) -> bool:
- return self._install(
+ install_result = self._install(
dependencies=dependencies,
install_cmd="sudo zypper install -y",
replace_dict={
"libarchive": {"libarchive-devel"},
"python": {"python3-devel"},
+ "rust_toolchain": {"curl", "clang", "clang-devel"},
},
)
+ if not install_result:
+ return False
+ return "rust_toolchain" not in dependencies or
_install_rust_on_unix(self.no_confirm)
Review Comment:
Good point, added a wrapper `_install_with_rust_toolchain` and a unix base
class that overrides it, and the chocolatey package manager also overrides it
with its own rust installation in
https://github.com/apache/nifi-minifi-cpp/pull/2307/commits/c978943949cda27963190c4fcfdffc5f2beb5945
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]