Skip to content
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

MACOSX_DEPLOYMENT_TARGET causing spurious rebuilds due to objc-sys #1804

Closed
emilk opened this issue Oct 12, 2023 · 1 comment · Fixed by #1815
Closed

MACOSX_DEPLOYMENT_TARGET causing spurious rebuilds due to objc-sys #1804

emilk opened this issue Oct 12, 2023 · 1 comment · Fixed by #1815
Labels
enhancement New feature or request

Comments

@emilk
Copy link

emilk commented Oct 12, 2023

Running maturin develop will set the MACOSX_DEPLOYMENT_TARGET environment variable. The objc-sys crate has a build.rs file that rebuilds if MACOSX_DEPLOYMENT_TARGET changes.

The problem comes from me then running a normal cargo build, which doesn't set MACOSX_DEPLOYMENT_TARGET. Now objc-sys and all its dependencies (a lot of them, including winit) will rebuild. When I type maturing develop again, everything rebuilds yet again.

One solution is to set MACOSX_DEPLOYMENT_TARGET=11.0 globally in my ~/.zshrc, but I'd like for a more solid solution that works for any contributor to my repository.

I initially though that adding MACOSX_DEPLOYMENT_TARGET="11.0" under [env] in .cargo/config.toml would solve it, but those env-vars seems to only be visible to build.rs files inside my repository, and hence not by objc-sys/build.rs.

So now I'm wondering - can we have an option so that Maturin does NOT set MACOSX_DEPLOYMENT_TARGET, at least not when running maturin develop? What would be the effect of not setting it?

@messense
Copy link
Member

messense commented Oct 20, 2023

It should be fine to not set MACOSX_DEPLOYMENT_TARGET for maturin develop, but for distribution (maturin build) we need to set it, otherwise the wheel built on newer macOS version may not work on older macOS versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants