Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AppleDebugInfo and AppleSymbolsFileInfo available from outside of rules_apple #2559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apple/internal/partials/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ bzl_library(
deps = [
"//apple/internal:intermediates",
"//apple/internal:processor",
"//apple/internal/providers:apple_symbols_file_info",
"@bazel_skylib//lib:partial",
"@bazel_skylib//lib:shell",
"@build_bazel_apple_support//lib:apple_support",
Expand Down
15 changes: 6 additions & 9 deletions apple/internal/partials/apple_symbols_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ load(
"@build_bazel_rules_apple//apple/internal:processor.bzl",
"processor",
)

_AppleSymbolsFileInfo = provider(
doc = "Private provider to propagate the transitive .symbols `File`s.",
fields = {
"symbols_output_dirs": "Depset of `File`s containing directories of $UUID.symbols files for transitive dependencies.",
},
load(
"@build_bazel_rules_apple//apple/internal/providers:apple_symbols_file_info.bzl",
"AppleSymbolsFileInfo",
)

def _apple_symbols_file_partial_impl(
Expand Down Expand Up @@ -89,9 +86,9 @@ def _apple_symbols_file_partial_impl(
transitive_output_files = depset(
direct = outputs,
transitive = [
x[_AppleSymbolsFileInfo].symbols_output_dirs
x[AppleSymbolsFileInfo].symbols_output_dirs
for x in dependency_targets
if _AppleSymbolsFileInfo in x
if AppleSymbolsFileInfo in x
],
)

Expand All @@ -102,7 +99,7 @@ def _apple_symbols_file_partial_impl(

return struct(
bundle_files = bundle_files,
providers = [_AppleSymbolsFileInfo(symbols_output_dirs = transitive_output_files)],
providers = [AppleSymbolsFileInfo(symbols_output_dirs = transitive_output_files)],
)

def apple_symbols_file_partial(
Expand Down
10 changes: 10 additions & 0 deletions apple/internal/providers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

licenses(["notice"])

bzl_library(
name = "apple_symbols_file_info",
srcs = ["apple_symbols_file_info.bzl"],
visibility = [
# Visibility set to pkg since this provider is used only
# by the `apple_symbols_file` partial.
"//apple/internal/partials:__pkg__",
],
)

bzl_library(
name = "app_intents_info",
srcs = ["app_intents_info.bzl"],
Expand Down
2 changes: 0 additions & 2 deletions apple/internal/providers/apple_debug_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

"""AppleDebugInfo provider implementation for resource aspect and debug symbols partial support."""

visibility("//apple/internal/...")

AppleDebugInfo = provider(
doc = """
Private provider to propagate transitive dSYM and link maps information used by the debug symbols
Expand Down
22 changes: 22 additions & 0 deletions apple/internal/providers/apple_symbols_file_info.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""AppleSymbolsFileInfo provider implementation for transitive .symbols `File`s propagation."""

AppleSymbolsFileInfo = provider(
doc = "Private provider to propagate the transitive .symbols `File`s.",
fields = {
"symbols_output_dirs": "Depset of `File`s containing directories of $UUID.symbols files for transitive dependencies.",
},
)