Closed mattrobmattrob closed 1 year ago
And perhaps a different but similar outcome in Xcode itself:
diff --git a/examples/integration/BUILD b/examples/integration/BUILD
index f59fad0c..97e36670 100644
--- a/examples/integration/BUILD
+++ b/examples/integration/BUILD
@@ -1,5 +1,6 @@
load(
"@com_github_buildbuddy_io_rules_xcodeproj//xcodeproj:defs.bzl",
+ "top_level_target",
"xcodeproj",
)
load(
@@ -15,6 +16,17 @@ load(
exports_files(["README.md"])
+xcodeproj(
+ name = "xcodeproj",
+ project_name = "App",
+ # scheme_autogeneration_mode = "all",
+ top_level_targets = [
+ top_level_target("//iOSApp", target_environments = ["simulator"]),
+ ],
+)
+
# Example of xcodeproj cache warming
#
# 1. Register a single macOS execution platform in `WORKSPACE`:
Then build: | Xcode | Log |
---|---|---|
Build iOSApp_2023-01-31T21-58-02.txt |
So a couple comments:
build //some:target
with the command-line API. While it will put you in the correct "environment", you still won't have the same transitions applied. That's why --generator_output_groups
exists. Though, I also do this from time to time just to test something, knowing I won't get cache hits.xcodeproj
itself).The issue isn't with the command-line API, it's from --define=apple.experimental.tree_artifact_outputs=1
. This will fail as well:
bazel build //iOSApp/Source:iOSApp --define=apple.experimental.tree_artifact_outputs=1
INFO: Build options --@com_github_buildbuddy_io_rules_xcodeproj//xcodeproj:extra_common_flags, --@com_github_buildbuddy_io_rules_xcodeproj//xcodeproj:extra_generator_flags, --@com_github_buildbuddy_io_rules_xcodeproj//xcodeproj:extra_indexbuild_flags, and 2 more have changed, discarding analysis cache.
INFO: Analyzed target //iOSApp/Source:iOSApp (79 packages loaded, 2467 targets configured).
INFO: Found 1 target...
ERROR: /Users/brentley/Developer/rules_xcodeproj/examples/integration/iOSApp/Source/BUILD:29:16: Creating runfiles tree bazel-out/applebin_ios-ios_sim_arm64-fastbuild-ST-7785c4ff3d6f/bin/iOSApp/Source/iOSApp.runfiles failed: build-runfiles failed: error executing command
(cd /Users/brentley/Developer/rules_xcodeproj/examples/integration/bazel-output-base/execroot/__main__ && \
exec env - \
PATH=/Users/brentley/Developer/rules_xcodeproj/examples/integration/tools:/opt/homebrew/opt/mysql-client/bin:/Users/brentley/.dotfiles/bin:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/brentley/google-cloud-sdk/bin \
/var/tmp/_bazel_brentley/install/730b09b9d9f2bfd30b4c0a074ba23835/build-runfiles --allow_relative bazel-out/applebin_ios-ios_sim_arm64-fastbuild-ST-7785c4ff3d6f/bin/iOSApp/Source/iOSApp.runfiles_manifest bazel-out/applebin_ios-ios_sim_arm64-fastbuild-ST-7785c4ff3d6f/bin/iOSApp/Source/iOSApp.runfiles): Process exited with status 1: Process exited with status 1
/var/tmp/_bazel_brentley/install/730b09b9d9f2bfd30b4c0a074ba23835/build-runfiles (args bazel-out/applebin_ios-ios_sim_arm64-fastbuild-ST-7785c4ff3d6f/bin/iOSApp/Source/iOSApp.runfiles_manifest bazel-out/applebin_ios-ios_sim_arm64-fastbuild-ST-7785c4ff3d6f/bin/iOSApp/Source/iOSApp.runfiles): link or target filename contains space on line 1: '__main__/iOSApp/Source/iOS App.app /Users/brentley/Developer/rules_xcodeproj/examples/integration/bazel-output-base/execroot/__main__/bazel-out/applebin_ios-ios_sim_arm64-fastbuild-ST-7785c4ff3d6f/bin/iOSApp/Source/iOS App.app'
Target //iOSApp/Source:iOSApp failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 7.672s, Critical Path: 0.03s
INFO: 26 processes: 26 internal.
FAILED: Build did NOT complete successfully
So this is an issue with rules_apple, not rules_xcodeproj.
Perfect. Thanks for looking, @brentleyjones!
Describe the bug
This is potentially odd/contrived but the difference between vanilla
bazel.build
andrules_xcodeproj.xcodeproj.build
was confusing. Perhaps the outcome is to just fire a warning when this is encountered during generation or similar.To reproduce, make this change to the integration tests:
Reproduction steps
Expected behavior
Same as normal
bazel build
command:Versions
Repro'd in repo on 323c33d72bf87b64f2bc9c805cd602a5a248f6e2.