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

Set clang flags in lldb, propagate linker options #119

Merged
merged 7 commits into from
Sep 14, 2020
Merged
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
7 changes: 3 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ build --test_output=errors # Prints log file output to the console on failure
# because it takes quite some time. They will only run on CI
build --deleted_packages tests/ios/frameworks/sources-with-prebuilt-binaries

# Enable these features to test local and CI builds
# when swiftmodule caching is enabled.
# build --features=swift.cacheable_swiftmodules
# build --features=swift.use_global_module_cache
# Enable dbg compilation mode in this repo, so we can test xcodeproj-built
# binaries contain debug symbol tables.
build --compilation_mode=dbg
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ ios_application(

See the [tests](https://github.com/bazel-ios/rules_ios/tree/master/tests)
directory for sample applications.

## Special note about debugging
Debugging does not work in sandbox mode, due to issue #108. The workaround for now is to disable sandboxing in the .bazelrc file.
4 changes: 4 additions & 0 deletions rules/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,13 @@ def _apple_framework_packaging_impl(ctx):
"imported_library",
"force_load_library",
"multi_arch_linked_archives",
"multi_arch_linked_binaries",
"multi_arch_dynamic_libraries",
"source",
"define",
"include",
"link_inputs",
"linkopt",
Copy link
Collaborator Author

@amberdixon amberdixon Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the reference for objcprovider: https://docs.bazel.build/versions/master/skylark/lib/ObjcProvider.html

I searched for the string "link" and "final bundle" on this page to see what fields have to get propagated.

]:
set = depset(
direct = [],
Expand Down
7 changes: 5 additions & 2 deletions rules/xcodeproj.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _xcodeproj_impl(ctx):
"BAZEL_BUILD_EXEC": "$BAZEL_STUBS_DIR/build-wrapper",
"BAZEL_OUTPUT_PROCESSOR": "$BAZEL_STUBS_DIR/output-processor.rb",
"BAZEL_PATH": ctx.attr.bazel_path,
"BAZEL_RULES_IOS_OPTIONS": "--@build_bazel_rules_ios//rules:local_debug_options_enabled --features=-swift.cacheable_swiftmodules --features=-swift.use_global_module_cache",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason these features are removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of this change, debugging works in local development, even when cacheable swiftmodules are enabled. Therefore, we don't need to explicitly turn off the cacheable swiftmodules feature ... the developer can decide what to do with the feature in their bazelrc if they wish.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!!

"BAZEL_RULES_IOS_OPTIONS": "--@build_bazel_rules_ios//rules:local_debug_options_enabled",
"BAZEL_WORKSPACE_ROOT": "$SRCROOT/%s" % script_dot_dots,
"BAZEL_STUBS_DIR": "$PROJECT_FILE_PATH/bazelstubs",
"BAZEL_INSTALLERS_DIR": "$PROJECT_FILE_PATH/bazelinstallers",
Expand Down Expand Up @@ -456,7 +456,7 @@ def _xcodeproj_impl(ctx):
if target_info.product_type != existing_type:
fail("""\
Failed to generate xcodeproj for "{}" due to conflicting targets:
Target "{}" is already defined with type "{}".
Target "{}" is already defined with type "{}".
A same-name target with label "{}" of type "{}" wants to override.
Double check your rule declaration for naming or add `xcodeproj-ignore-as-target` as a tag to choose which target to ignore.
""".format(ctx.label, target_name, existing_type, target_info.bazel_build_target_name, target_info.product_type))
Expand Down Expand Up @@ -510,6 +510,9 @@ Double check your rule declaration for naming or add `xcodeproj-ignore-as-target
target_settings["SWIFT_ACTIVE_COMPILATION_CONDITIONS"] = " ".join(
["\"%s\"" % d for d in defines_without_equal_sign],
)
target_settings["BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS"] = " ".join(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the key for getting swift to work again right?

Copy link
Collaborator Author

@amberdixon amberdixon Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two issues: (1) LLDB settings need to be right or else LLDB will dump a bunch of errors and (2) the linker command for the application/test needs to include the add_ast_path option. This linker option needs to get propagated down to the application/test target by setting linkopts in the ObjcProvider returned from the framework target for the dependency. If we don't provide the AST option to the linker, then LLDB will not load all the necessary ASTs for swift debugging to work.

Copy link
Contributor

@gyfelton gyfelton Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for this! I should have caught them on the description section.
Looking back, I wonder how can we know these are the steps needed without Sam's input...

Also did you manually ensure that breakpoints work in test projects in this repo? If not that's fine I can do another round of tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can explain how I went about finding these problems. I first added the line log enable lldb types -f /tmp/types.log to my lldbinit, so that I would get very verbose diagnostic lldb logging in a file called /tmp/types.log

  1. I noticed the linker invocations being made by bazel to generate the final binary did not reference all the AST paths for transitive dependencies. I saw that LLDB was (1) sometimes complaining about missing ASTs and (2) in the types.log file , I noticed that the AST for transitive deps were not being loaded (They were being loaded in the working case.) So I just experimented with adding on the add_ast_path option to the linker and that did the trick.

As far as the actual implementation of this change, Sam noticed that framework.bzl was not propagating linker opts for transitive deps, which would explain why these linker options were not present.

  1. After I made that fix, debugging was still not working. The LLDB output was complaining about an error with importing GPBProtocolBuffers.h. I noticed that one of our projects at Square has a clang flag with GPB in the name (this flag affects the way we build source files that depend on google protobufs.) So I used the lldb setting for extra-clang-flags to add all the necessary clang flags.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will double check the breakpoints in the test project, but note that debugging in the test project only works when sandboxing is disabled (which requires changing local bazelrc.)

In order to test this change, I updated build.sh to check for the presence of AST files in the symbol table for the binary. I think that should be sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed explanation! Learnt that we can do logging for lldb just like we can do it for SourceKIT (so in future get the logs is the priority so we can not shooting in the dark)
As far as the testing go, I think it might be worth to call out in readme that sandbox needs to be disabled to get debugging working? Definitely a separate concern tho

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amberdixon Can point to me where are the changes on build.sh for presence of AST files? 🙏

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amberdixon Can point to me where are the changes on build.sh for presence of AST files? 🙏

saw the updated checks, that's awesome!

["-D%s" % d for d in target_info.cc_defines.to_list()],
)

if target_info.product_type == "application":
target_settings["INFOPLIST_FILE"] = "$BAZEL_STUBS_DIR/Info-stub.plist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,22 @@ set -euo pipefail
#
# command source ~/.lldbinit-source-map
cat <<-END > ~/.lldbinit-source-map
settings set target.source-map ./external/ "$BAZEL_WORKSPACE_ROOT/bazel-$(basename "$BAZEL_WORKSPACE_ROOT")/external"
settings append target.source-map ./ "$BAZEL_WORKSPACE_ROOT/"
settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/"
settings set target.sdk-path $SDKROOT
settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS
END

if [[ -n ${BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS:-} ]]
then
cat <<-END >> ~/.lldbinit-source-map
settings set -- target.swift-extra-clang-flags $BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS
END
fi

BAZEL_EXTERNAL_DIRNAME="$BAZEL_WORKSPACE_ROOT/bazel-$(basename "$BAZEL_WORKSPACE_ROOT")/external"
if [ -d "$BAZEL_EXTERNAL_DIRNAME" ]
then
cat <<-END >> ~/.lldbinit-source-map
settings append target.source-map ./external/ "$BAZEL_EXTERNAL_DIRNAME"
END
fi
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = /tests/ios/frameworks/objc;
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACH_O_TYPE = "$(inherited)";
PRODUCT_NAME = ObjcFramework;
Expand All @@ -290,7 +291,7 @@
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
BAZEL_OUTPUT_PROCESSOR = "$BAZEL_STUBS_DIR/output-processor.rb";
BAZEL_PATH = bazelisk;
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled --features=-swift.cacheable_swiftmodules --features=-swift.use_global_module_cache";
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled";
BAZEL_STUBS_DIR = $PROJECT_FILE_PATH/bazelstubs;
BAZEL_WORKSPACE_ROOT = $SRCROOT/../../..;
CC = "$BAZEL_STUBS_DIR/clang-stub";
Expand All @@ -314,11 +315,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = /tests/ios/frameworks/objc;
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
MACH_O_TYPE = "$(inherited)";
PRODUCT_NAME = ObjcFrameworkTestLib;
Expand All @@ -331,11 +333,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = /tests/ios/frameworks/objc;
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACH_O_TYPE = "$(inherited)";
PRODUCT_NAME = ObjcFramework;
Expand All @@ -353,7 +356,7 @@
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
BAZEL_OUTPUT_PROCESSOR = "$BAZEL_STUBS_DIR/output-processor.rb";
BAZEL_PATH = bazelisk;
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled --features=-swift.cacheable_swiftmodules --features=-swift.use_global_module_cache";
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled";
BAZEL_STUBS_DIR = $PROJECT_FILE_PATH/bazelstubs;
BAZEL_WORKSPACE_ROOT = $SRCROOT/../../..;
CC = "$BAZEL_STUBS_DIR/clang-stub";
Expand All @@ -375,9 +378,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = /tests/ios/frameworks/objc;
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
Expand All @@ -393,9 +397,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = /tests/ios/frameworks/objc;
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
Expand All @@ -411,11 +416,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = /tests/ios/frameworks/objc;
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-f75cadb68314/bin/tests/ios/frameworks/objc/ObjcFramework\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_public_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-0010df40fd2e/bin/tests/ios/frameworks/objc/ObjcFrameworkTestLib_private_angled_hmap.hmap\" \"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
MACH_O_TYPE = "$(inherited)";
PRODUCT_NAME = ObjcFrameworkTestLib;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,22 @@ set -euo pipefail
#
# command source ~/.lldbinit-source-map
cat <<-END > ~/.lldbinit-source-map
settings set target.source-map ./external/ "$BAZEL_WORKSPACE_ROOT/bazel-$(basename "$BAZEL_WORKSPACE_ROOT")/external"
settings append target.source-map ./ "$BAZEL_WORKSPACE_ROOT/"
settings set target.source-map ./ "$BAZEL_WORKSPACE_ROOT/"
settings set target.sdk-path $SDKROOT
settings set target.swift-framework-search-paths $FRAMEWORK_SEARCH_PATHS
END

if [[ -n ${BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS:-} ]]
then
cat <<-END >> ~/.lldbinit-source-map
settings set -- target.swift-extra-clang-flags $BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS
END
fi

BAZEL_EXTERNAL_DIRNAME="$BAZEL_WORKSPACE_ROOT/bazel-$(basename "$BAZEL_WORKSPACE_ROOT")/external"
if [ -d "$BAZEL_EXTERNAL_DIRNAME" ]
then
cat <<-END >> ~/.lldbinit-source-map
settings append target.source-map ./external/ "$BAZEL_EXTERNAL_DIRNAME"
END
fi
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
BAZEL_OUTPUT_PROCESSOR = "$BAZEL_STUBS_DIR/output-processor.rb";
BAZEL_PATH = bazelisk;
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled --features=-swift.cacheable_swiftmodules --features=-swift.use_global_module_cache";
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled";
BAZEL_STUBS_DIR = $PROJECT_FILE_PATH/bazelstubs;
BAZEL_WORKSPACE_ROOT = $SRCROOT/../../..;
CC = "$BAZEL_STUBS_DIR/clang-stub";
Expand Down Expand Up @@ -309,7 +309,7 @@
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
BAZEL_OUTPUT_PROCESSOR = "$BAZEL_STUBS_DIR/output-processor.rb";
BAZEL_PATH = bazelisk;
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled --features=-swift.cacheable_swiftmodules --features=-swift.use_global_module_cache";
BAZEL_RULES_IOS_OPTIONS = "--@build_bazel_rules_ios//rules:local_debug_options_enabled";
BAZEL_STUBS_DIR = $PROJECT_FILE_PATH/bazelstubs;
BAZEL_WORKSPACE_ROOT = $SRCROOT/../../..;
CC = "$BAZEL_STUBS_DIR/clang-stub";
Expand All @@ -331,9 +331,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app";
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/TestImports-App_framework_unlinked\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/TestImports-App_framework_unlinked\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
Expand All @@ -350,9 +351,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app";
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/SomeFramework\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/SomeFramework\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT\"";
INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist";
Expand All @@ -369,9 +371,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app";
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/SomeFramework\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/SomeFramework\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT\"";
INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist";
Expand All @@ -388,9 +391,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app";
BAZEL_LLDB_SWIFT_EXTRA_CLANG_FLAGS = "";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/TestImports-App_framework_unlinked\"";
FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks \"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-dbg-ST-e11e4ada49a5/bin/tests/ios/unit-test/test-imports-app/TestImports-App_framework_unlinked\"";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
HEADER_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT\"";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
Expand Down
Loading