bazelbuild / bazelbuild/rules_apple

static_framework_transition causes swift module to be built twice

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

Description

When building an `ios_static_framework` with a Swift dep, the modules are built twice in due to what seems to be a configuration transition.

I have bisected the problem to 4af4135207ae124c443d4c43cfeeb4bf7e3db05a.

The build file is as follow:
```python
swift_library(
name = "tst",
srcs = [
"tst.swift",
],
module_name = "Tst",
)

ios_static_framework(
name = "Tst.framework",
bundle_name = "Tst",
families = [
"iphone",
"ipad",
],
minimum_os_version = "11.0",
deps = [
":tst",
],
)
```

This happens wether or not the aspect is applied (I tried disabling it).

Tried with Bazel 1.2.1 and 2.0.0rc4, with no `.bazelrc`.

Will report if I find something more.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown BUILD file and an ios_static_framework depending on the swift_library, using the reported Bazel versions. Compare the build behavior around commit 4af4135207ae124c443d4c43cfeeb4bf7e3db05a, with and without the aspect. Done means the Swift modules are built only once.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, mobile-dev
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.