bazelbuild / bazelbuild/rules_apple
Reduce disk space usage of the rules
- Dominant language
- Starlark
- Stars
- 593
- Forks
- 334
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 9
Description
This is a general issue to describe the current disk space usage issues of some of the rules.
The current default is to **not** use the `use_tree_artifacts_output` flag, this mostly seems to be because of potentially now fixed issues in Bazel like: https://github.com/bazelbuild/bazel/issues/16361. See also: https://github.com/bazelbuild/rules_apple/pull/2545
With the current default the disk space usage for a large-ish application target is >3x the size when compared to the tree artifact ouputs.
Without usage of the use_tree_artifacts_outputs flag (default):
```
bin/Code/Apps/App/App_archive-root/Payload/App.app (732 MB)
bin/Code/Apps/App/App-intermediates/unprocessed_archive.zip (732 MB)
bin/Code/Apps/App/App.ipa (740 MB)
```
With use_tree_artifacts_outputs flag:
```
bin/Code/Apps/App/App_archive-root/Payload/App.app (732 MB)
```
For large projects this can add several hundreds of gigabytes to the output-base which means engineers need to frequently `bazel clean --expunge` to clear up disk space (or worse run into failed builds when they run out of disk space).
This has also been a topic of concern for other users, see: https://github.com/bazelbuild/rules_apple/discussions/2638
Contributor guide
Research direction
Start by reviewing the use_tree_artifacts_outputs flag, the linked Bazel issue, and rules_apple pull request #2545 to understand the current constraints. Compare the two output layouts described in the issue and determine a concrete change that reduces redundant disk usage without breaking the application build.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100