Fix ssl-vendor (OpenSSL) - #7985
Conversation
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (4)
π§ Files skipped from review as they are similar to previous changes (4)
π WalkthroughWalkthroughThis PR threads a ChangesSSL VM-aware socket waiting
Sequence Diagram(s)sequenceDiagram
participant Client
participant PySslSocket
participant SocketStream
participant sock_wait
participant VirtualMachine
Client->>PySslSocket: read/write/shutdown
PySslSocket->>SocketStream: select(SslNeeds, deadline, vm)
SocketStream->>SocketStream: map SslNeeds -> SockWaitKind
SocketStream->>sock_wait: sock_wait(vm, SockWaitKind, deadline)
sock_wait->>VirtualMachine: request VM-aware wait
VirtualMachine-->>sock_wait: wait result
sock_wait-->>SocketStream: SelectRet
SocketStream-->>PySslSocket: readiness result / error
Estimated code review effortπ― 4 (Complex) | β±οΈ ~45 minutes Possibly related PRs
Suggested reviewers
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
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 |
f9de717 to
d0b84cd
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/stdlib/src/openssl.rs`:
- Around line 2319-2322: The match currently swallows errors from sock_wait;
change the code to propagate sock_wait errors instead of treating them as
SelectRet::Okβcall sock_wait(&*sock, wait_kind, timeout, vm)? (or otherwise map
Err to return the PyErr) and then match on the resulting bool to return
SelectRet::TimedOut or SelectRet::Ok so that errors (signals, EBADF, I/O) are
not discarded; update the block around sock_wait to use the ? operator or
explicit Err->return Err(...) propagation so exceptions bubble up instead of
being converted to SelectRet::Ok.
πͺ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: c62f895b-4f7a-4004-93a8-8bfbec72063a
β Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
π Files selected for processing (2)
Cargo.tomlcrates/stdlib/src/openssl.rs
ShaharNaveh
left a comment
There was a problem hiding this comment.
TYSM for doing this!
can you please add a somewhere in the CI something that checks it?
I think adding a cargo check --features ... under
RustPython/.github/workflows/ci.yaml
Lines 139 to 141 in dcb273b
|
Sure. I'll handle it by tomorrow. πΈ I'll also handle CodeRabbit's lint. I don't know OpenSSL and TLS too well, but based on the context I think CodeRabbit is right that returning an error is the right call. |
d0b84cd to
128779a
Compare
|
Admittedly, I know very little about CI so I hope the CI change is right. πΉ I fixed the build but also changed |
dw, you did great:)
π₯ |
Closes: RustPython#7893 Fix 1: `foreign-types-shared` needs to match `openssl`'s version. Bumping it is a SemVer violation because the latest versions of the crate aren't backwards compatible with older versions. See: rust-openssl/rust-openssl#2461 Fix 2: The second fix is to align the `openssl` module with the latest `host_env` and `ssl` changes.
128779a to
eca26d1
Compare
Closes: #7893
Fix 1:
foreign-types-sharedneeds to matchopenssl's version. Bumping it is a SemVer violation because the latest versions of the crate aren't backwards compatible with older versions.See: rust-openssl/rust-openssl#2461
Fix 2:
The second fix is to align the
opensslmodule with the latesthost_envandsslchanges.Summary by CodeRabbit
Chores
CI
Refactor