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