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

Error: There is no configuration fragment named 'swift'. Available fragments: 'platform', 'coverage', 'bazel_py', 'android', 'bazel_android', 'apple', 'cpp', 'java', 'j2objc', 'objc', 'proto', 'py' #1148

Closed
sgowroji opened this issue Jan 16, 2024 · 1 comment · Fixed by #1149

Comments

@sgowroji
Copy link
Member

sgowroji commented Jan 16, 2024

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3594#018d1012-3183-4ff1-9791-7fffb20420b9

Platform: MacOS

Logs:

Traceback (most recent call last):
	File "/var/lib/buildkite-agent/builds/bk-docker-5xrg/bazel-org-repo-root/rules_swift/swift/internal/swift_toolchain.bzl", line 298, column 36, in _swift_toolchain_impl
		swiftcopts = list(ctx.fragments.swift.copts())
Error: There is no configuration fragment named 'swift'. Available fragments: 'platform', 'coverage', 'bazel_py', 'android', 'bazel_android', 'apple', 'cpp', 'java', 'j2objc', 'objc', 'proto', 'py'
(02:41:23) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/94c266353aabbe7180eecb7aa311392a/external/_main~non_module_deps~build_bazel_rules_swift_local_config/BUILD:9:16: Analysis of target '@@_main~non_module_deps~build_bazel_rules_swift_local_config//:toolchain' failed
(02:41:23) ERROR: Analysis of target '//examples/xplatform/grpc:echo_client_services_swift' failed; build aborted: Analysis failed
(02:41:23) INFO: Elapsed time: 3.548s, Critical Path: 0.19s
(02:41:23) INFO: 5 processes: 5 internal.
(02:41:23) ERROR: Build did NOT complete successfully
(02:41:23) FAILED:

Steps:

git clone -v https://github.com/bazelbuild/rules_swift.git
git reset 0919507c7c6c23d410a15b67c01e5f8025ea96b8 --hard
export USE_BAZEL_VERSION=cddec1247571f1cda9939ffb7546e089e528c76e
bazel build  -- //examples/... -//examples/apple/... 

CC Greenteam @meteorcloudy

@meteorcloudy
Copy link
Member

/cc @keith

keith added a commit that referenced this issue Jan 18, 2024
The swift fragment was removed at bazel HEAD and replaced by our custom
starlark flag for copts in rules swift. This requires a version check
that we're relying on bazel_features for if we want to be 100% accurate.

Fixes #1148
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

Successfully merging a pull request may close this issue.

2 participants