Skip to content

Get build to work on macOS#35

Open
hellais wants to merge 2 commits into
mainfrom
macos-build
Open

Get build to work on macOS#35
hellais wants to merge 2 commits into
mainfrom
macos-build

Conversation

@hellais
Copy link
Copy Markdown
Member

@hellais hellais commented Apr 16, 2026

Use pyo3_build_config to build correct build and linker flags on macOS.

hellais and others added 2 commits May 11, 2026 15:27
Today, the README gives some information for how to link the python interpreter and expects the user to find their way.
This commit only enables PyO3 extension-module for maturin builds, but disable it for plain cargo builds.
This way, Rust test binaries link libpython correctly.
Along the way, we remove some unused configuration flags in build.rs, and add wheels/ to .gitignore.
@mmaker
Copy link
Copy Markdown
Collaborator

mmaker commented May 11, 2026

Hi @hellais! I've tested it on my machine and made an extra commit for the following:

  1. ignore the wheels/ folder.
  2. update the ooniauth_py.pyi file
  3. remove the following lines, which I believe are unused:
    println!("cargo:rustc-check-cfg=cfg(Py_3_10)");
    println!("cargo:rustc-check-cfg=cfg(Py_3_11)");
    println!("cargo:rustc-check-cfg=cfg(Py_3_12)");
    println!("cargo:rustc-check-cfg=cfg(Py_3_13)");
    println!("cargo:rustc-check-cfg=cfg(Py_3_14)");
    println!("cargo:rustc-check-cfg=cfg(Py_3_15)");
  1. make cargo test work without writing yourself the linking flags, and update readme accordingly.

I'm OK to remove (4), and otherwise the patch looks good to me.

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.

2 participants