Skip to content
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9507bb9
add Win32_System_LibraryLoader feature for LoadLibraryExW
iamllama Nov 1, 2025
4b7dade
add libc crate for macos as well (for dlopen)
iamllama Nov 1, 2025
5f5849c
add helper scripts
iamllama Nov 1, 2025
085e5cd
add PyFfi
iamllama Nov 1, 2025
310a841
add libpython_path
iamllama Nov 1, 2025
18759f4
add get_libpython_path
iamllama Nov 1, 2025
7d581a4
clear lib path cache on sync
iamllama Nov 1, 2025
97f6e55
add PyFfi impl
iamllama Nov 1, 2025
a9aed29
add PyFfi impl for nixes
iamllama Nov 1, 2025
66f95b1
add PyFfi impl for windows
iamllama Nov 1, 2025
90f969f
add run_anki_normally
iamllama Nov 1, 2025
f1cfca2
launch anki embeddedly(?), fallback to usual launch
iamllama Nov 1, 2025
2e11d86
add bindgen'd py39/313 PyConfig definitions
iamllama Nov 2, 2025
866d7ad
add ffi types
iamllama Nov 2, 2025
e8bccf1
refactor get_libpython_path into get_python_env_info
iamllama Nov 2, 2025
75ada38
add new ffi methods
iamllama Nov 2, 2025
546fd5d
add PyConfigExt and refactor PyFfi impl
iamllama Nov 2, 2025
41997be
update ffi load impls
iamllama Nov 2, 2025
5e16989
update ffl run impls
iamllama Nov 2, 2025
1ba8422
remove CString unwraps
iamllama Nov 2, 2025
09766c1
sys.executable is the bin we're getting sys.executable from 🤦‍♂️
iamllama Nov 2, 2025
d690a0a
trim after splitting
iamllama Nov 2, 2025
f037e26
refactor, fix: dlerror may return null
iamllama Nov 12, 2025
2aa9108
refactor windows ffi macro
iamllama Nov 12, 2025
dbc7adc
refactor pointer casts
iamllama Nov 22, 2025
7c4a1e6
dedup platform-specific run
iamllama Nov 23, 2025
3e0e591
remove incorrect call to ensure_terminal_shown
iamllama Nov 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor pointer casts
  • Loading branch information
iamllama committed Nov 22, 2025
commit dbc7adca2dd9a736e31aa57f9092768bdb0cddbb
12 changes: 6 additions & 6 deletions qt/launcher/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ macro_rules! impl_pyconfig {
Self: Sized,
{
let mut config: Self = unsafe { std::mem::zeroed() };
(ffi.PyConfig_InitPythonConfig)(&mut config as *const _ as *mut _);
(ffi.PyConfig_InitPythonConfig)(&raw mut config as _);
config.parse_argv = 0;
config.install_signal_handlers = 1;
config
}

fn set_exec(&mut self, ffi: &PyFfi) -> Result<&mut Self> {
let status = (ffi.PyConfig_SetBytesString)(
self as *const _ as *mut _,
self as *mut _ as _,
&mut self.executable,
ffi.exec.as_ptr(),
);
Expand All @@ -252,9 +252,9 @@ macro_rules! impl_pyconfig {
.map(|x| x.as_ptr() as *mut i8)
.collect::<Vec<_>>();
let status = (ffi.PyConfig_SetBytesArgv)(
self as *mut _ as *mut _,
self as *mut _ as _,
argvp.len() as isize,
argvp.as_ptr() as *mut _,
argvp.as_ptr().cast(),
);
ensure!((ffi.PyStatus_Exception)(status) == 0, "failed to set argv");
Ok(self)
Expand All @@ -271,12 +271,12 @@ impl PyFfi {
"39" => {
let mut config = py39::PyConfig::init(&self);
config.set_exec(&self)?.set_argv(&self)?;
(self.Py_InitializeFromConfig)(&config as *const _ as *const _);
(self.Py_InitializeFromConfig)(&raw const config as _);
}
"313" => {
let mut config = py313::PyConfig::init(&self);
config.set_exec(&self)?.set_argv(&self)?;
(self.Py_InitializeFromConfig)(&config as *const _ as *const _);
(self.Py_InitializeFromConfig)(&raw const config as _);
}
_ => Err(anyhow!("unsupported python version: {version}"))?,
};
Expand Down