[Bazel] Change external_zlib attribute to string
When using `llvm_zlib_external` rule with `external_zlib` attribute set to a label referring to the main repository, like `@//third_party/zlib`, it will be replaced with `//third_party/zlib` after template substitution. This will then attempt to find `//third_party/zlib` within the local repository `@llvm_zlib//third_party/zlib`, which does not exist, rather than the intended reference back to the main repository. The issue appears to be that the conversion of `Label` type to string with `str(repository_ctx.attr.external_zlib)`, which is causing the main repository qualifier to be lost. This diff fixes the issue by changing the `external_zlib` attribute to `attr.string` type rather than `attr.label`. In future a more elegant solution may be possible that preserves use of the `Label` type, depending on resolution of the issue https://github.com/bazelbuild/bazel/issues/13731. Ported from Github PR https://github.com/google/llvm-bazel/pull/236. Reviewed By: GMNGeoffrey Differential Revision: https://reviews.llvm.org/D106606
Loading
Please sign in to comment