Skip to content

prettier *.js + fix miri build #5028

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

Merged
merged 2 commits into from
Jul 19, 2023
Merged

Conversation

youknowone
Copy link
Member

No description provided.

@youknowone youknowone changed the title prettier *.js prettier *.js + fix miri Jul 19, 2023
@youknowone youknowone changed the title prettier *.js + fix miri prettier *.js + fix miri build Jul 19, 2023
@zanieb
Copy link
Contributor

zanieb commented Jul 19, 2023

@youknowone
Copy link
Member Author

I didn't know prettifier also check .md and .html files

@youknowone youknowone merged commit c28cb39 into RustPython:main Jul 19, 2023
@youknowone youknowone deleted the lint-js branch July 19, 2023 14:43
@youknowone
Copy link
Member Author

Windows tests have SSL-related regression but it doesn't look related to this change.

@PIG208
Copy link

PIG208 commented Aug 25, 2023

OpenSSL v3.1.1 was approved on Choco on July 18. It is a major update and likely breaks The migration guide might be useful to inform what has been changed. Looks like the breakage happens here:

#[pymethod]
fn load_verify_locations(
&self,
args: LoadVerifyLocationsArgs,
vm: &VirtualMachine,
) -> PyResult<()> {
if let (None, None, None) = (&args.cafile, &args.capath, &args.cadata) {
return Err(
vm.new_type_error("cafile, capath and cadata cannot be all omitted".to_owned())
);
}
if let Some(cadata) = args.cadata {
let certs = match cadata {
Either::A(s) => {
if !s.is_ascii() {
return Err(vm.new_type_error("Must be an ascii string".to_owned()));
}
X509::stack_from_pem(s.as_str().as_bytes())
}
Either::B(b) => b.with_ref(x509_stack_from_der),
};
let certs = certs.map_err(|e| convert_openssl_error(vm, e))?;
let mut ctx = self.builder();
let store = ctx.cert_store_mut();
for cert in certs {
store
.add_cert(cert)
.map_err(|e| convert_openssl_error(vm, e))?;
}
}
if args.cafile.is_some() || args.capath.is_some() {
let cafile = args.cafile.map(|s| s.to_cstring(vm)).transpose()?;
let capath = args.capath.map(|s| s.to_cstring(vm)).transpose()?;
let ret = unsafe {
let ctx = self.ctx.write();
sys::SSL_CTX_load_verify_locations(
ctx.as_ptr(),
cafile
.as_ref()
.map_or_else(std::ptr::null, |cs| cs.as_ptr()),
capath
.as_ref()
.map_or_else(std::ptr::null, |cs| cs.as_ptr()),
)
};
if ret != 1 {
let errno = std::io::Error::last_os_error().raw_os_error().unwrap();
let err = if errno != 0 {
crate::vm::stdlib::os::errno_err(vm)
} else {
convert_openssl_error(vm, ErrorStack::get())
};
return Err(err);
}
}
Ok(())
}

@youknowone
Copy link
Member Author

@PIG208 Thank you! Not sure it was a full fix, but I made fix in #5044

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.

3 participants