Skip to content
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

Introduce Rust #453

Merged
merged 320 commits into from
Nov 15, 2024
Merged

Introduce Rust #453

merged 320 commits into from
Nov 15, 2024

Conversation

SanderVocke
Copy link
Owner

No description provided.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request introduces Rust to the ShoopDaLoop project, marking the beginning of a planned migration from Python and C++ to Rust.

  • Added Cargo.toml and build.rs to set up Rust project structure and build process
  • Modified /src/CMakeLists.txt to integrate Rust components into the existing build system
  • Updated README.md with a detailed roadmap explaining the transition to Rust and future development plans
  • Added /src/bin/build_appdir.rs to handle application directory structure creation in Rust
  • Introduced /src/cmake/CompilerCaching.cmake to improve build times using sccache or ccache

15 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings

Cargo.toml Outdated
license = "TODO"

[dependencies]
pyo3 = "0.22"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider specifying a more precise version for pyo3 to ensure compatibility, e.g., '0.22.1'

build.rs Outdated
.stdout(std::process::Stdio::inherit())
.stderr(std::process::Stdio::inherit())
.current_dir(src_dir.clone())
.status().unwrap();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: unwrap() here may cause the build to fail silently if the command execution fails. Consider using expect() with a meaningful error message.

build.rs Outdated
let venv_dir = Path::new(&out_dir).join("shoopdaloop_env");
Command::new(&host_python).args(
&["-m", "venv", venv_dir.to_str().expect("Could not get venv path")]
).status().unwrap();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: unwrap() here may cause the build to fail silently if venv creation fails. Consider using expect() with a meaningful error message.

build.rs Outdated
)
.stdout(std::process::Stdio::inherit())
.stderr(std::process::Stdio::inherit())
.status().unwrap();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: unwrap() here may cause the build to fail silently if wheel installation fails. Consider using expect() with a meaningful error message.

EXECUTABLE=$1

# Temporary files
TRACE_OUTPUT=$(mktemp)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: TRACE_OUTPUT is created but never used

std::process::exit(1);
};

let bad_usage = |msg : _| {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Specify the type for 'msg' instead of using '_'

Comment on lines 67 to 68
let binding = String::from_utf8(output.stdout).unwrap();
let build_out_dir = binding.trim();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Handle potential UTF-8 conversion errors instead of using unwrap()

Comment on lines 90 to 93
recursive_dir_cpy(
&from,
&to
).unwrap();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Handle potential errors from recursive_dir_cpy instead of using unwrap()

Comment on lines 22 to 29
if (DEFINED PTHREADS4W_PATH)
set(ZITA_CMAKE_ARGS
-DCMAKE_PREFIX_PATH=${PTHREADS4W_PATH}
-DCMAKE_LIBRARY_PATH=${PTHREADS4W_PATH}
-DCMAKE_CXX_FLAGS=-I${PTHREADS4W_PATH}
-DCMAKE_C_FLAGS=-I${PTHREADS4W_PATH}
)
endif()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider using CMAKE_CXX_STANDARD and CMAKE_C_STANDARD instead of manually setting flags for including pthreads4w.

Repository owner deleted a comment from patched-codes bot Aug 31, 2024
@SanderVocke SanderVocke merged commit 7330f78 into master Nov 15, 2024
22 of 24 checks passed
@SanderVocke SanderVocke deleted the rust branch November 15, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant