Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rules_swift is failing with Bazel@HEAD in CI #1093

Closed
sgowroji opened this issue Aug 23, 2023 · 7 comments
Closed

rules_swift is failing with Bazel@HEAD in CI #1093

sgowroji opened this issue Aug 23, 2023 · 7 comments

Comments

@sgowroji
Copy link
Member

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3256#018a202d-c126-4377-9286-aa36c305ed76

Main pipeline https://buildkite.com/bazel/rules-swift-swift/builds/4473#018a2090-44ee-4d64-bc5b-7faceb961171

Platform : Linux

Log :

ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/e0fba04d7d9e5bdfaeacf1eecab3e828/external/build_bazel_rules_swift_local_config/BUILD:9:16: While resolving toolchains for target @build_bazel_rules_swift_local_config//:toolchain: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type.
To debug, rerun with --toolchain_resolution_debug='@bazel_tools//tools/cpp:toolchain_type'
If platforms or toolchains are a new concept for you, we'd encourage reading https://bazel.build/concepts/platforms-intro.
(02:17:07) ERROR: Analysis of target '//examples/apple/objc_interop:main' failed; build aborted: Analysis failed

Steps :

git clone -v https://github.com/bazelbuild/rules_swift.git

git reset 5e58cfc00d3fc3fe0beb1ff68b30d5e08c5dc07c --hard
export USE_BAZEL_VERSION=6a19449233d6e51d8a862545726a60a611943068

shell_commands:
      - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME"
      - "mkdir $SWIFT_HOME"
      - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME"
   
 bazel build //examples/...
    

CC Greenteam @SalmaSamy

@keith
Copy link
Member

keith commented Aug 23, 2023

Did you bisect this one? I'm surprised that it only broken on linux w/o any changes on our side

@keith
Copy link
Member

keith commented Aug 23, 2023

broken by bazelbuild/bazel@03b8616

@keith
Copy link
Member

keith commented Aug 23, 2023

it's because of these objc_library targets even though they are marked as incompatible on linux

objc_library(
name = "PrintStream",
srcs = ["OIPrintStream.m"],
hdrs = ["OIPrintStream.h"],
target_compatible_with = ["@platforms//os:macos"],
)

@keith
Copy link
Member

keith commented Aug 23, 2023

likely related: bazelbuild/bazel#16662

@keith
Copy link
Member

keith commented Aug 23, 2023

and maybe bazelbuild/bazel#16099

keith added a commit that referenced this issue Aug 23, 2023
There's a hole in bazel where target_compatible_with isn't enough #1093
@keith
Copy link
Member

keith commented Aug 23, 2023

#1094

keith added a commit that referenced this issue Aug 23, 2023
There's a hole in bazel where target_compatible_with isn't enough
#1093
@keith keith closed this as completed Aug 23, 2023
@sgowroji
Copy link
Member Author

Thanks @keith!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants