GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Mark unrunnable test_threading. Fix SSL args names. Add args to sysconfigdata by youknowone · Pull Request #6470 · RustPython/RustPython Conversation
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThis PR refactors certificate-related method signatures across SSL modules to use a shared Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
448281c to
a84452a
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
crates/stdlib/src/openssl.rs (1)
2523-2528: LGTM: Consistent use of GetCertArgs struct.The method correctly adopts the new
GetCertArgsstruct. The extraction logic is sound and maintains the same default behavior.Optional: Consider naming consistency
For consistency with
get_ca_certs(line 1549), you could rename the local variable frombinarytobinary_form:fn getpeercert( &self, args: GetCertArgs, vm: &VirtualMachine, ) -> PyResult<Option<PyObjectRef>> { - let binary = args.binary_form.unwrap_or(false); + let binary_form = args.binary_form.unwrap_or(false);Then update the usage on line 2541 accordingly. This is a minor stylistic improvement and not required.
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Lib/test/test_sysconfig.py is excluded by !Lib/**Lib/test/test_threading.py is excluded by !Lib/**crates/stdlib/src/openssl.rscrates/stdlib/src/ssl.rscrates/vm/src/stdlib/sysconfigdata.rs📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.rs: Follow the default rustfmt code style by runningcargo fmtto format Rust code
Always run clippy to lint Rust code (cargo clippy) before completing tasks and fix any warnings or lints introduced by changes
Follow Rust best practices for error handling and memory management
Use the macro system (pyclass,pymodule,pyfunction, etc.) when implementing Python functionality in Rust
Files:
crates/vm/src/stdlib/sysconfigdata.rscrates/stdlib/src/ssl.rscrates/stdlib/src/openssl.rsLearnt from: arihant2math
Repo: RustPython/RustPython PR: 5790
File: build.rs:2-2
Timestamp: 2025-06-28T16:31:03.991Z
Learning: In Cargo build scripts (build.rs), the environment variable CARGO_CFG_TARGET_OS is guaranteed to exist and is automatically set by Cargo during the build process, making unwrap() safe to use when accessing this variable.
Applied to files:
crates/vm/src/stdlib/sysconfigdata.rscrates/stdlib/src/openssl.rs (1)
get_ca_certs(1544-1568)
crates/stdlib/src/openssl.rs (3)
1-1: LGTM: Spell-checker directive updated appropriately.The spell-checker directive correctly includes the new compiler/linker variable names that are referenced in the codebase.
2262-2266: LGTM: Well-structured argument encapsulation.The
GetCertArgsstruct properly uses theFromArgsderive macro and correctly declares thebinary_formfield as an optional argument. This standardizes argument handling across certificate methods.
1544-1549: LGTM: Clean refactoring to use shared argument struct.The method correctly uses the new
GetCertArgsstruct and extracts thebinary_formvalue with an appropriate default offalse.crates/stdlib/src/ssl.rs (3)
844-848: LGTM! Clean refactoring to standardize certificate argument handling.The
GetCertArgsstruct follows RustPython conventions and mirrors the implementation pattern inopenssl.rs. This refactoring improves code consistency and makes the API more maintainable.
1697-1698: Signature refactoring maintains backward compatibility.The updated signature using
GetCertArgspreserves the same API surface and default behavior. The argument handling is consistent with the openssl module implementation.
3447-3452: LGTM! Consistent with the certificate argument refactoring.The
getpeercertmethod correctly adopts theGetCertArgspattern, maintaining backward compatibility and default behavior. This completes the standardization across bothget_ca_certsandgetpeercertmethods.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Compiler configuration for native extension builds | ||
| "CC" => "cc", | ||
| "CXX" => "c++", | ||
| "CFLAGS" => "", | ||
| "CPPFLAGS" => "", | ||
| "LDFLAGS" => "", | ||
| "LDSHARED" => "cc -shared", | ||
| "CCSHARED" => "", | ||
| "SHLIB_SUFFIX" => ".so", | ||
| "SO" => ".so", | ||
| "AR" => "ar", | ||
| "ARFLAGS" => "rcs", | ||
| "OPT" => "", | ||
| "BASECFLAGS" => "", | ||
| "BLDSHARED" => "cc -shared", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Platform-specific hardcoded values will be incorrect on Windows.
The hardcoded values for SHLIB_SUFFIX, SO, LDSHARED, and BLDSHARED assume a Unix/Linux environment. On Windows, shared libraries use .dll instead of .so, and the linker commands differ significantly.
// Compiler configuration for native extension builds
"CC" => "cc",
"CXX" => "c++",
"CFLAGS" => "",
"CPPFLAGS" => "",
"LDFLAGS" => "",
- "LDSHARED" => "cc -shared",
+ "LDSHARED" => if cfg!(windows) { "link.exe" } else { "cc -shared" },
"CCSHARED" => "",
- "SHLIB_SUFFIX" => ".so",
- "SO" => ".so",
+ "SHLIB_SUFFIX" => if cfg!(windows) { ".dll" } else if cfg!(target_os = "macos") { ".dylib" } else { ".so" },
+ "SO" => if cfg!(windows) { ".pyd" } else { ".so" },
"AR" => "ar",
"ARFLAGS" => "rcs",
"OPT" => "",
"BASECFLAGS" => "",
- "BLDSHARED" => "cc -shared",
+ "BLDSHARED" => if cfg!(windows) { "link.exe" } else { "cc -shared" },
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Compiler configuration for native extension builds | |
| "CC" => "cc", | |
| "CXX" => "c++", | |
| "CFLAGS" => "", | |
| "CPPFLAGS" => "", | |
| "LDFLAGS" => "", | |
| "LDSHARED" => "cc -shared", | |
| "CCSHARED" => "", | |
| "SHLIB_SUFFIX" => ".so", | |
| "SO" => ".so", | |
| "AR" => "ar", | |
| "ARFLAGS" => "rcs", | |
| "OPT" => "", | |
| "BASECFLAGS" => "", | |
| "BLDSHARED" => "cc -shared", | |
| // Compiler configuration for native extension builds | |
| "CC" => "cc", | |
| "CXX" => "c++", | |
| "CFLAGS" => "", | |
| "CPPFLAGS" => "", | |
| "LDFLAGS" => "", | |
| "LDSHARED" => if cfg!(windows) { "link.exe" } else { "cc -shared" }, | |
| "CCSHARED" => "", | |
| "SHLIB_SUFFIX" => if cfg!(windows) { ".dll" } else if cfg!(target_os = "macos") { ".dylib" } else { ".so" }, | |
| "SO" => if cfg!(windows) { ".pyd" } else { ".so" }, | |
| "AR" => "ar", | |
| "ARFLAGS" => "rcs", | |
| "OPT" => "", | |
| "BASECFLAGS" => "", | |
| "BLDSHARED" => if cfg!(windows) { "link.exe" } else { "cc -shared" }, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.