Skip to content

[bug] MACOSX_DEPLOYMENT_TARGET env var not exposed to dependencies #4704

@betamos

Description

@betamos

Describe the bug

When dependencies are building custom ObjC or Swift code that target MacOS, they need to know the minimum version (from macOS.minimumSystemVersion in tauri.conf.json). Currently, we set the MACOSX_DEPLOYMENT_TARGET env var for rustc, but not "generally", so the build.rs script in deps cannot currently see what version is used by the tauri app being built, and that means cc and other tools can't be configured to use the appropriate target either.

See h4llow3En/mac-notification-sys#46

Unless there's another standardized way of propagating this metadata, I suggest setting the env var globally throughout the build, potentially with a default version such as to make the build more hermetic.

Reproduction

You can reproduce this by:

  • set "minimumSystemVersion": "10.13.6" (or any other version) in tauri conf
  • add a build.rs file to a dep and print the env var MACOSX_DEPLOYMENT_TARGET - it's not set

Expected behavior

Expecting a way for dependencies to be aware of the desired build macos deployment target.

Platform and versions

tauri-cli 1.0.4/dev

Stack trace

no stack trace

Additional context

Perhaps some users are already setting the env var in CI systems etc, and changing it could potentially break some niche builds. For this reason, it may be wise to let the env var take precedence over the tauri.conf.json value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions