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

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

Closed
betamos opened this issue Jul 17, 2022 · 1 comment
Closed

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

betamos opened this issue Jul 17, 2022 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@betamos
Copy link
Contributor

betamos commented Jul 17, 2022

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.

@betamos betamos added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jul 17, 2022
@betamos
Copy link
Contributor Author

betamos commented Jul 17, 2022

Tried this alternative method, from the main app's build.rs file (although this shouldn't do anything):

fn main() {
  println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.13.6");
  tauri_build::build()
}

The env var is still not present in the dep's build.rs command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant