tulsi
tulsi copied to clipboard
latest tulsi master doesnt build on MacOS Catalina or Big Sur
with bazel 4.0.0 (also tried using the latest bazel from bazelisk which i think is 4.2.1) update: also fails on MacOS Mojave so likely not OS-related
running the command: sh build_and_run.sh
yields
ERROR: /private/var/tmp/_bazel_bk/873acf0c977b07f10854ef16945ce48f/external/local_config_cc/BUILD:48:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'darwin_x86_64' ERROR: Analysis of target '//:tulsi' failed; build aborted: Analysis of target '@local_config_cc//:toolchain' failed
I don't see this issue locally, can you checkout https://github.com/bazelbuild/bazel/issues/13855 and see if this fixes your issue
thanks for the quick response, yes i had tried those steps many times.
i had seen that advice elsewhere. no luck.
can you tell me what your xcode-select -p reports, and what xcode version you have installed?
maybe i am setting xcode-select to the wrong sub-directory within the xcode app folder?
If you select the default in the Xcode preferences GUI you can make sure it's normalized. Or xcode-select --reset
I'm using 12.5.1
thanks, I tried the Xcode preferences setup and also -r (reset on tools), no luck
see attached my preferences

the interesting thing: on the BUILD file it is complaining about (line 48) there does not see to be a "64" mentioned at all
there is darwin mentioned but not the _x86_64 suffixes
it's like my system is putting some old stuff into that tmp folder when trying to build. I tried to delete the whole tmp path: /private/var/tmp/_bazel_bk , and it regenerates with the same (wrong?) stuff. do you know where that file comes from?
/private/var/tmp/_bazel_bk/873acf0c977b07f10854ef16945ce48f/external/local_config_cc/BUILD:48:19
pasting the file here, I had to add .TXT to the file name to get it to paste
update to this ticket: based upon some notes I saw elsewhere, i manually added _x86_64 items to the tmp BUILD file that is system-generated (by some bit of the bazel process or ???) (see attached image). I do not know if this is correct, but it seems to get me past that error. why the 64 bit stuff is not defined by default is a mystery still, since macs have been 64 bit for a long time now.

using Bazel 4.0.0 my intended target, I was able to get past the above error, but now get another error about xcode version not being able to be determined, (see stack trace below)
however, i have defined my xcode command line version via xcode-select, verified by:
xcode-select -p /Applications/Xcode.app/Contents/Developer
-- new stack trace from build_and_run.sh indicating cant find xcode version:
sh build_and_run.sh ERROR: /private/var/tmp/_bazel_bk/873acf0c977b07f10854ef16945ce48f/external/build_bazel_rules_swift_local_config/BUILD:9:22: in xcode_swift_toolchain rule @build_bazel_rules_swift_local_config//:toolchain: Traceback (most recent call last): File "/private/var/tmp/_bazel_bk/873acf0c977b07f10854ef16945ce48f/external/build_bazel_rules_swift/swift/internal/xcode_swift_toolchain.bzl", line 715, column 34, in _xcode_swift_toolchain_impl if _is_xcode_at_least_version(xcode_config, "10.0"): File "/private/var/tmp/_bazel_bk/873acf0c977b07f10854ef16945ce48f/external/build_bazel_rules_swift/swift/internal/xcode_swift_toolchain.bzl", line 604, column 13, in _is_xcode_at_least_version fail("Could not determine Xcode version at all. This likely means " + Error in fail: Could not determine Xcode version at all. This likely means Xcode isn't available; if you think this is a mistake, please file an issue. Analyzing: target //:tulsi (1 packages loaded, 64 targets configured) FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node 'ConfiguredTargetKey{label=//src/tools/bazel_cache_reader:bazel_cache_reader_lib, config=BuildConfigurationValue.Key[06fc204b732d4e88444a2f6a4e314da161641b227f81c153581c2cd147fd5514]}' (requested by nodes 'ConfiguredTargetKey{label=//src/tools/bazel_cache_reader:bazel_cache_reader, config=BuildConfigurationValue.Key[82a658eb2772be3f6fef934dc81084eca17edfcada4cd3236f77c81196f5c337]}', 'ConfiguredTargetKey{label=//src/tools/bazel_cache_reader:bazel_cache_reader.swift_runtime_linkopts, config=BuildConfigurationValue.Key[06fc204b732d4e88444a2f6a4e314da161641b227f81c153581c2cd147fd5514]}') at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:563) at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:398) at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) Caused by: java.lang.NullPointerException at com.google.devtools.build.lib.rules.objc.CompilationSupport.getFeatureConfiguration(CompilationSupport.java:569) at com.google.devtools.build.lib.rules.objc.CompilationSupport.compile(CompilationSupport.java:263) at com.google.devtools.build.lib.rules.objc.CompilationSupport.ccCompileAndLink(CompilationSupport.java:367) at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1001) at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1063) at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:949) at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:81) at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:42) at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:381) at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:194) at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:938) at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:1013) at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:371) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:477) ... 7 more
another update, i found that you can pass the xcode version on the .sh command line with the -x option
i see now in the README.md file provided in Tulsi says that it looks for 12.4 xcode if you dont specify the -x option. however, the error message doesnt indicate this, it just says that it cannot find any version of xcode.
sh build_and_run.sh -x 12.2
this gets me past the xcode version problem above but then bazel crashes internally with a java stack trace
sh build_and_run.sh -x 12.2 Starting local Bazel server and connecting to it... Analyzing: target //:tulsi (48 packages loaded, 285 targets configured) FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node 'ConfiguredTargetKey{label=//src/tools/bazel_cache_reader:bazel_cache_reader_lib, config=BuildConfigurationValue.Key[837a4d110a5c72a8ff14e0f9fa3d34f8e81bed52ad6a7cf4f101a511036579b8]}' (requested by nodes 'ConfiguredTargetKey{label=//src/tools/bazel_cache_reader:bazel_cache_reader, config=BuildConfigurationValue.Key[4b75ad6bc1c6b35dea2399a9173723465d054b422a182d8404d7e323c4b8a701]}', 'ConfiguredTargetKey{label=//src/tools/bazel_cache_reader:bazel_cache_reader.swift_runtime_linkopts, config=BuildConfigurationValue.Key[837a4d110a5c72a8ff14e0f9fa3d34f8e81bed52ad6a7cf4f101a511036579b8]}') at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:563) at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:398) at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) Caused by: java.lang.NullPointerException at com.google.devtools.build.lib.rules.objc.CompilationSupport.getFeatureConfiguration(CompilationSupport.java:569) at com.google.devtools.build.lib.rules.objc.CompilationSupport.compile(CompilationSupport.java:263) at com.google.devtools.build.lib.rules.objc.CompilationSupport.ccCompileAndLink(CompilationSupport.java:367) at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1001) at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:1063) at com.google.devtools.build.lib.rules.objc.CompilationSupport.registerCompileAndArchiveActions(CompilationSupport.java:949) at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:81) at com.google.devtools.build.lib.rules.objc.ObjcLibrary.create(ObjcLibrary.java:42) at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:381) at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:194) at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:938) at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:1013) at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:371) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:477) ... 7 more
Thanks for submitting this issue but this tool is being deprecated. Please checkout rules_xcodeproj for a more complete and maintained Xcode integration.
thanks, we gave up on this toolchain also