Skip to content

MACOSX_DEPLOYMENT_TARGET causing spurious rebuilds due to objc-sys #1804

@emilk

Description

@emilk

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions