rules_apple
rules_apple copied to clipboard
xcframework creation fails with poor error for incorrect deps / headers
With this BUILD file:
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework")
apple_static_xcframework(
name = "foo",
ios = {
"simulator": ["x86_64"],
"device": ["arm64"],
},
minimum_os_versions = {"ios": "15.0"},
public_hdrs = ["no_header.h"],
deps = ["no_target"],
)
Where no_target
and no_header.h
don't exist, if you bazel build foo
you get this error:
error: /Applications/Xcode-13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode-13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode-13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
Target //:foo failed to build
Use --verbose_failures to see the command lines of failed build steps.
Ideally this would error earlier in bazel since this makes it look like something went wrong with the build, not the configuration.