Skip to content

Commit

Permalink
Enable --experimental_strict_conflict_checks (#671)
Browse files Browse the repository at this point in the history
Correct `update_in_place` script inputs.
  • Loading branch information
mattrobmattrob authored Oct 24, 2023
1 parent 0d27ebd commit 6b2d950
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ build --spawn_strategy=standalone
# Setup Xcode configuration for xcodeproj tests
build --xcode_version_config=//:host_xcodes

build --experimental_strict_conflict_checks

build --verbose_failures # Print the full command line for commands that failed
build --test_output=errors # Prints log file output to the console on failure

Expand Down
18 changes: 9 additions & 9 deletions rules/import_middleman.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ _FindImportsAspectInfo = provider(fields = {
def _update_framework(ctx, framework):
# Updates the `framework` for Apple Silicon
out_file = ctx.actions.declare_file(ctx.attr.name + "/" + framework.basename + ".framework" + "/" + framework.basename)
out_dir = ctx.actions.declare_file(ctx.attr.name + "/" + framework.basename + ".framework")
cmd = """
set -e
TOOL="{}"
FRAMEWORK_BINARY="{}"
OUT_DIR="{}"
FW_DIR="$(dirname "$FRAMEWORK_BINARY")"
INPUT_FRAMEWORK_BINARY="{}"
OUTPUT_FRAMEWORK_BINARY="{}"
INPUT_FW_DIR="$(dirname "$INPUT_FRAMEWORK_BINARY")"
OUTPUT_FW_DIR="$(dirname "$OUTPUT_FRAMEWORK_BINARY")"
# Duplicate the _entire_ input framework
mkdir -p "$(dirname "$OUT_DIR")"
mkdir -p "$OUTPUT_FW_DIR"
ditto "$FW_DIR" "$OUT_DIR"
"$TOOL" "$OUT_DIR/$(basename "$FRAMEWORK_BINARY")"
""".format(ctx.files.update_in_place[0].path, framework.path, out_dir.path)
ditto "$INPUT_FW_DIR" "$OUTPUT_FW_DIR"
"$TOOL" "$OUTPUT_FW_DIR/$(basename "$INPUT_FRAMEWORK_BINARY")"
""".format(ctx.files.update_in_place[0].path, framework.path, out_file.path)

ctx.actions.run_shell(
outputs = [out_dir, out_file],
outputs = [out_file],
inputs = depset([framework] + ctx.attr.update_in_place[DefaultInfo].default_runfiles.files.to_list()),
command = cmd,
execution_requirements = {"no-remote": "1"},
Expand Down

0 comments on commit 6b2d950

Please sign in to comment.