bazelbuild / bazelbuild/rules_apple

Doing random post build things on IOS artifacts

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

Description

Let's say I have a normal `ios_static_framework` rule. The following works as expected:

> bazel build --apple_platform_type=ios --ios_multi_cpus=arm64,armv7 :my_static_framework

Now I want to do something on the produced framework zip file by means of a `sh_binary` rule:

```
sh_binary(
name="do_things_on_framework",
data = [ ":my_static_framework" ],
srcs = [ "my_script.sh" ],
)
```
Now I try:

> bazel run --apple_platform_type=ios --ios_multi_cpus=arm64,armv7 :do_things_on_framework

And it results in spectacular misbehavior: the script is executed as if it had no dependencies and runfiles manifest has no entry for "my_static_framework". In fact, bazel ignores the platform settings outright.

What is the correct approach to add post-build steps to `ios_*_framework` or `ios_application` rules? Those are very important, yet `rules_apple` appears to break the usual Bazel logic somehow.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown ios_static_framework, sh_binary, my_script.sh, and the two Bazel commands. Compare the runfiles manifest and platform settings for the framework dependency, then inspect the rules involved; done means a documented post-build approach for ios_*_framework or ios_application that preserves the dependency and respects the selected iOS platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, shell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.