-
Notifications
You must be signed in to change notification settings - Fork 482
Fixed errors with non-absolute labels #1185
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
Conversation
This is also impacting this PR: https://buildkite.com/bazel/rules-rust-rustlang/builds/5643#51bcff38-d1a6-48ce-bad2-7b660b8b63a5
|
@dfreese do you have a solution to the error in #1185 (comment) ? |
nothing concrete beyond what I mentioned in that initial comment, which I don't think directly translates. I'm trying to work on a minimally reproducible test case, but was running into the issue this PR addresses. |
@UebelAndre this is the smallest test case I could get that demonstrates the failure.
load("@rules_cc//cc:defs.bzl", "cc_test")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")
package(default_visibility = ["//visibility:private"])
# Passes
# cc_binary(
# name = "code_generation",
# srcs = ["code_generation.cc"],
# )
# Fails
rust_binary(
name = "code_generation",
srcs = ["code_generation.rs"],
)
genrule(
name = "generated",
srcs = [],
outs = ["generated.h"],
cmd = "$(location :code_generation) > $@",
# Irrelevant to the failure, but checked both with and without.
stamp = True,
tools = [":code_generation"],
)
cc_test(
name = "test_value",
srcs = [
"generated.h",
"test_value.cc",
],
visibility = ["//visibility:public"],
)
fn main() {
println!("constexpr int kTestValue = 42;");
}
#include "generated.h"
int main() { return kTestValue == 42 ? 0 : 1; } # load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Updated 2022-03-11. Main last updated 2022-03-11.
# http_archive(
# name = "rules_rust",
# sha256 = "ba638848794ff0698425e23f3cdc7c1c3cd3c1911fda720c80accbef4f0a48b6",
# strip_prefix = "rules_rust-5e6ad9f638b5334a70ee914b63f080140020b3c4",
# urls = [
# "https://github.com/bazelbuild/rules_rust/archive/5e6ad9f638b5334a70ee914b63f080140020b3c4.tar.gz",
# ],
# )
# Local repository applying PR #1185
local_repository(
name = "rules_rust",
path = "../rules_rust",
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
rules_rust_dependencies()
rust_register_toolchains() With that I see the following error. It looks the same on version 4.0.0 and 4.2.1. someone@somewhere:~/cycle_example$ bazel-5.0.0 test //...
ERROR: /home/viz/.cache/bazel/_bazel_viz/1e97f2cc96b4e28933552bb1116a0892/external/rules_rust/util/process_wrapper/BUILD.bazel:7:6: in alias rule @rules_rust//util/process_wrapper:process_wrapper: cycle in dependency graph:
//:generated (28ff57593ba01d914893f9cd455c859110ce813ccf3771961541220915f453dc)
//:code_generation (ad7becf1f627c98f4c44ac49f5991ab41aa98662628ab4c26b029d7fb1035392)
.-> @rules_rust//util/process_wrapper:process_wrapper (ad7becf1f627c98f4c44ac49f5991ab41aa98662628ab4c26b029d7fb1035392)
| @rules_rust//util/process_wrapper:process_wrapper_impl (ad7becf1f627c98f4c44ac49f5991ab41aa98662628ab4c26b029d7fb1035392)
| @rules_rust//util/process_wrapper:process_wrapper_bin (ad7becf1f627c98f4c44ac49f5991ab41aa98662628ab4c26b029d7fb1035392)
`-- @rules_rust//util/process_wrapper:process_wrapper (ad7becf1f627c98f4c44ac49f5991ab41aa98662628ab4c26b029d7fb1035392)
ERROR: Analysis of target '//:generated' failed; build aborted
INFO: Elapsed time: 0.258s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 3 targets configured)
FAILED: Build did NOT complete successfully (1 packages loaded, 3 targets configured) |
I put together this #1187, which fixes both problems, I think. |
This change was addressed by #1187 |
This fixes the following errors when building post #1159