bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.99k stars 4.03k forks source link

macos_minimum_os documentation improvement and default value #16932

Open svenevs opened 1 year ago

svenevs commented 1 year ago

Description of the feature request:

An Xcode update resulted in odd behavior where compiling on monterey would produce ventura binaries. With most other tools you can either

Adding the compilation flags to bazel actually doesn't work, and if you search enough you eventually find this SO answer endorsing --macos_minimum_os). The feature request:

  1. The environment variable MACOSX_DEPLOYMENT_TARGET, when set, should define this value without the user needing to populate it. All of the other tools involved in our wheel build use this variable, bazel is the only one that does not.
  2. Regardless of the decision of (1), the current docs could be updated to include better search terms and make this easier to find. Currently it states
[--macos_minimum_os](https://bazel.build/reference/command-line-reference#flag--macos_minimum_os)=<a dotted version (for example '2.3' or '3.3alpha2.4')> default: see description
    Minimum compatible macOS version for targets. If unspecified, uses 'macos_sdk_version'.
    Tags: [loses_incremental_state](https://bazel.build/reference/command-line-reference#effect_tag_LOSES_INCREMENTAL_STATE)

Something including the phrase(s) macOS deployment target (deployment target being the one that everyone will search for) and ideally a mention of its default value of MACOSX_DEPLOYMENT_TARGET from the environment, or at least a mention of that exact variable (and it not setting the default if that is the decision) will make this easier for users to find.

What underlying problem are you trying to solve with this feature?

Which operating system are you running Bazel on?

macOS monterey 12.6.1 (among others)

What is the output of bazel info release?

release 5.3.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

n/a

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

n/a

Have you found anything relevant by searching the web?

https://stackoverflow.com/a/68227936

Any other information, logs, or outputs that you want to share?

If its just a docs update I think I can add them for you all with a little guidance, but if using the environment variable is agreed upon I don't know enough bazel to help with that.

github-actions[bot] commented 7 months ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.