Skip to content

Add an implementation_deps field to objc_library #17646

@xiemotongye

Description

@xiemotongye

Description of the feature request:

objc_library treats all dependencies and transitive dependencies as public to its consumers. This results in include directories, headers exploding in volume when you have a complex dependency tree. When a header file of the downstream module changes, it break all of the cache of upstream modules.

swift_library has a private_deps field. cc_library has an implementation_deps field. Only objc_library doesn't have one. objc_library should behave as much like cc_library as possible. It could support an implementation_deps field. Any targets here would be considered the same as deps for compilation purposes, however when computing the final CcInfo provider, hdrs, textual_hdrs, and includes would not be included (obviously the linking context would still be included to properly pick up transitive .a/.so/etc). This would make it easy to control dependency explosion and better hide unfortunately-named files in dependencies.

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

We use bazel to organize & build our iOS project. This project have a complex dependency tree. When a header file of the downstream module changes, it break the cache of upstream modules. If implementation_deps is supported to objc_library, it make us easy to control dependency explosion and cut down lots of time for compilation.

Which operating system are you running Bazel on?

macOS 12.6

What is the output of bazel info release?

release 6.0.0

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

No response

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

No response

Have you found anything relevant by searching the web?

similar feature request for cc_library: #13000

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

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions