bazelbuild / bazelbuild/rules_apple

Command line --minimum_os_version is not supported for macOS rules

Open
#936 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
593
Forks
334
Avg merge
16h 48m
Merged PRs (30d)
9

Description

I'm using `macos_xpc_service`.
Based on #196 I expected to be able to set `--minimum_os_version=10.10` in my .bazelrc and have it set workspace wide. I also set `--macos_minimum_os` just in case.
However, macos_xpc_service has this attr marked as required. If I change a forked copy of the rules to make them not required, I still get this transition failure.

```
ERROR: /private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_rules_apple/apple/internal/transition_support.bzl:50:5: OptionsParsingError for option 'macos_minimum_os': Dotted version components must all be of the form \d+([a-z0-9]*?)?(\d+)? but got ''
ERROR: Errors encountered while applying Starlark transition
ERROR: /private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_rules_apple/apple/internal/transition_support.bzl:50:5: OptionsParsingError for option 'macos_minimum_os': Dotted version components must all be of the form \d+([a-z0-9]*?)?(\d+)? but got ''
ERROR: Errors encountered while applying Starlark transition
ERROR: /private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_rules_apple/apple/internal/BUILD:489:18: in environment_plist rule @build_bazel_rules_apple//apple/internal:environment_plist_macos:
Traceback (most recent call last):
File "/private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_rules_apple/apple/internal/environment_plist.bzl", line 39, column 23, in _environment_plist
legacy_actions.run(
File "/private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_rules_apple/apple/internal/utils/legacy_actions.bzl", line 115, column 45, in _run
actions.run(**_kwargs_for_apple_platform(
File "/private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_rules_apple/apple/internal/utils/legacy_actions.bzl", line 66, column 93, in _kwargs_for_apple_platform
action_execution_requirements = apple_support.action_required_execution_requirements(ctx)
File "/private/var/tmp/_bazel_nikhilm/f7e4a634181022223ae0be799fce6716/external/build_bazel_apple_support/lib/apple_support.bzl", line 187, column 5, in _action_required_execution_requirements
def _action_required_execution_requirements():
Error: _action_required_execution_requirements() does not accept positional arguments, but got 1
```

It would be nice to make this attribute optional and specify it workspace wide using.

Contributor guide

Open the contributing guide

Research direction

Reproduce the macos_xpc_service case with --minimum_os_version and --macos_minimum_os, then inspect apple/internal/transition_support.bzl and the related errors in environment_plist.bzl, legacy_actions.bzl, and apple_support.bzl. Done means the minimum OS can be configured workspace-wide without the transition or action-execution failures shown.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.