Skip to content

Commit

Permalink
Add BAZEL_DIAGNOSTICS_DIR to proj_settings_base
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelaGuardia committed Dec 8, 2023
1 parent ca2c2ac commit 6413e5f
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 5 deletions.
7 changes: 5 additions & 2 deletions rules/legacy_xcodeproj.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ _PRODUCT_SPECIFIER_LENGTH = len("com.apple.product-type.")

_IGNORE_AS_TARGET_TAG = "xcodeproj-ignore-as-target"

_BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/"

def _dir(o):
return [
x
Expand Down Expand Up @@ -730,15 +732,15 @@ _BUILD_WITH_BAZEL_SCRIPT = """
set -euxo pipefail
cd $BAZEL_WORKSPACE_ROOT
export BAZEL_DIAGNOSTICS_DIR="$BUILD_DIR/../../bazel-xcode-diagnostics/"
export BAZEL_DIAGNOSTICS_DIR="{BAZEL_DIAGNOSTICS_DIR}"
mkdir -p $BAZEL_DIAGNOSTICS_DIR
export DATE_SUFFIX="$(date +%Y%m%d.%H%M%S%L)"
export BAZEL_BUILD_EVENT_TEXT_FILENAME="$BAZEL_DIAGNOSTICS_DIR/build-event-$DATE_SUFFIX.txt"
export BAZEL_BUILD_EXECUTION_LOG_FILENAME="$BAZEL_DIAGNOSTICS_DIR/build-execution-log-$DATE_SUFFIX.log"
export BAZEL_PROFILE_FILENAME="$BAZEL_DIAGNOSTICS_DIR/build-profile-$DATE_SUFFIX.log"
env -u RUBYOPT -u RUBY_HOME -u GEM_HOME $BAZEL_BUILD_EXEC $BAZEL_BUILD_TARGET_LABEL
$BAZEL_INSTALLER
"""
""".format(BAZEL_DIAGNOSTICS_DIR = _BAZEL_DIAGNOSTICS_DIR)

# See https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#scheme
# on structure of xcodeproj_schemes_by_name[target_info.name]
Expand Down Expand Up @@ -1069,6 +1071,7 @@ def _xcodeproj_impl(ctx):
"BAZEL_INSTALLER": "$BAZEL_INSTALLERS_DIR/%s" % ctx.executable.installer.basename,
"BAZEL_EXECUTION_LOG_ENABLED": ctx.attr.bazel_execution_log_enabled,
"BAZEL_PROFILE_ENABLED": ctx.attr.bazel_profile_enabled,
"BAZEL_DIAGNOSTICS_DIR": _BAZEL_DIAGNOSTICS_DIR,
"BAZEL_CONFIGS": ctx.attr.configs.keys(),
"BAZEL_ADDITIONAL_BAZEL_BUILD_OPTIONS": " ".join(["{} ".format(opt) for opt in ctx.attr.additional_bazel_build_options]),
"BAZEL_ADDITIONAL_LLDB_SETTINGS": "\n".join(ctx.attr.additional_lldb_settings),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@
bar,
foo,
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -493,6 +494,7 @@
bar,
foo,
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -554,6 +556,7 @@
bar,
foo,
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -614,6 +617,7 @@
bar,
foo,
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -525,6 +526,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -319,6 +320,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -259,6 +260,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -581,6 +582,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -673,6 +674,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -507,6 +508,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -675,6 +676,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
2 changes: 2 additions & 0 deletions tests/ios/xcodeproj/TestWithHostApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -611,6 +612,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -259,6 +260,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ diff -r ./tests/ios/xcodeproj/Test-LLDB-Logs-Project.xcodeproj/project.pbxproj .
< path = ../../..;
---
> path = ../../../..;
211c211
212c212
< BAZEL_WORKSPACE_ROOT = $SRCROOT/../../..;
---
> BAZEL_WORKSPACE_ROOT = $SRCROOT/../../../..;
269c269
271c271
< BAZEL_WORKSPACE_ROOT = $SRCROOT/../../..;
---
> BAZEL_WORKSPACE_ROOT = $SRCROOT/../../../..;
Only in ./tests/ios/xcodeproj/Test-LLDB-Logs-Project.xcodeproj/project.xcworkspace/xcshareddata: swiftpm
Only in ./tests/ios/xcodeproj/Test-LLDB-Logs-Project.xcodeproj/project.xcworkspace/xcshareddata: swiftpm
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -383,6 +384,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -427,6 +428,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down Expand Up @@ -622,6 +623,7 @@
BAZEL_BUILD_EXEC = "$BAZEL_STUBS_DIR/build-wrapper";
BAZEL_CONFIGS = (
);
BAZEL_DIAGNOSTICS_DIR = "$BUILD_DIR/../../bazel-xcode-diagnostics/";
BAZEL_EXECUTION_LOG_ENABLED = 0;
BAZEL_INSTALLER = $BAZEL_INSTALLERS_DIR/installer;
BAZEL_INSTALLERS_DIR = $PROJECT_FILE_PATH/bazelinstallers;
Expand Down

0 comments on commit 6413e5f

Please sign in to comment.