bazelbuild / apple_support Goto Github PK
View Code? Open in Web Editor NEWApple support for Bazel rules
License: Apache License 2.0
Apple support for Bazel rules
License: Apache License 2.0
I'm still pretty new to bazel, so sorry if I'm doing something weird! I'm trying to get bazel_clang_tidy working, but patching it to connect it to our copy of LLVM. AIUI, it uses an aspect to generate additional actions for each cc rule. This is almost working, but I started getting errors because the sysroot contained __BAZEL_XCODE_SDKROOT__
, which I think was being added due to our use of rules_xcodeproj.
I've modified the invocation of ctx.actions.run
here to call apple_support.run
instead, and injected the "apple"
fragment and appropriate attrs too.
But now I'm seeing bazel file with the following error (truncated):
exec: com.google.devtools.build.lib.analysis.FilesToRunProvider@680cb74e: not found
It looks like this may be because apple_support.run
doesn't expect the executable to be a FilesToRunProvider
.
Is there a good workaround for this, or am I holding it wrong? :-)
Sometimes compiling the toolchain binaries causes timeouts on slower CI machines. One way we could avoid this is by vendoring the binaries for the few files we need instead of causing them to be compiled on the fly. This would also solve hermeticity issues with them
We would like to get rid of apple_cc_toolchain
. There has been recent efforts to refector it so that it is more like cc_toolchain
, to the point where I believe the only remaining difference is the three crosstool variables used by cc_toolchain_config
to set these environment variables: XCODE_VERSION_OVERRIDE
, APPLE_SDK_VERSION_OVERRIDE
, APPLE_SDK_PLATFORM
. This information is readily available in xcode_config
, which is already a dependency of cc_toolchain_config
, so I believe it should be straightforward to migrate the bazel apple cc toolchain to that.
Once that is done, we should be able to replace all instances of apple_cc_toolchain
with cc_toolchain
.
This change also removes the use on APPLE_SDK_VERSION_OVERRIDE, so that can eventually be dropped also.
Theoretically the tools we compile during toolchain setup are done so reproducibly, but it would be nice to have a test verifying this
The following error occurs on linux if a target is marked as only being compatible with MacOS and the targets that depend on that target are not marked as such.
ERROR: /home/chuck/.cache/bazel/_bazel_chuck/1356082df8f6e9e7706552f3fc65582d/external/bazel_tools/tools/cpp/BUILD:58:19: in cc_toolchain_alias rule @bazel_tools//tools/cpp:current_cc_toolchain:
Traceback (most recent call last):
File "/virtual_builtins_bzl/common/cc/cc_toolchain_alias.bzl", line 26, column 48, in _impl
File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 219, column 17, in _find_cpp_toolchain
Error in fail: Unable to find a CC toolchain using toolchain resolution. Target: @@bazel_tools//tools/cpp:current_cc_toolchain, Platform: @@apple_support~1.11.1//platforms:darwin_x86_64, Exec platform: @@loca
l_config_platform//:host
ERROR: /home/chuck/.cache/bazel/_bazel_chuck/1356082df8f6e9e7706552f3fc65582d/external/bazel_tools/tools/cpp/BUILD:58:19: Analysis of target '@bazel_tools//tools/cpp:current_cc_toolchain' failed
ERROR: Analysis of target '//Sources/PrintObjcVersion:PrintObjcVersion' failed; build aborted: Analysis failed
Error:
$ bazel test :all
Traceback (most recent call last):
File "/.../external/build_bazel_rules_apple/tools/realpath/BUILD", line 9
_apple_genrule_inner(name = 'realpath_genrule')
File "/.../external/build_bazel_apple_support/rules/apple_genrule.bzl", line 78, in _apple_genrule_impl
apple_support.run_shell(ctx, <8 more arguments>)
File "/.../external/build_bazel_apple_support/lib/apple_support.bzl", line 326, in apple_support.run_shell
ctx.actions.run_shell(<1 more arguments>)
'command' must be of type string. passing a sequence of strings as 'command' is deprecated. To temporarily disable this check, set --incompatible_objc_framework_cleanup=false.
However, --incompatible_objc_framework_cleanup=false
doesn't exist:
$ bazel test --noincompatible_objc_framework_cleanup :all
ERROR: Unrecognized option: --noincompatible_objc_framework_cleanup
It was removed here.
Here's the code with the error.
I've recently come across a failure to build gazelle that was ultimately traced down to commit a000b23. I'm not a strong enough C++ developer to understand why that's happening, but I noticed that the commit message for this stated that:
This should be the right default for everyone, if not we can look at adding a way to disable it.
Having a flag to disable this feature would be most helpful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.