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

Bazel CI: rules_rust is failing in downstream #7463

Closed
meteorcloudy opened this issue Feb 19, 2019 · 9 comments
Closed

Bazel CI: rules_rust is failing in downstream #7463

meteorcloudy opened this issue Feb 19, 2019 · 9 comments
Assignees
Labels
breakage P1 I'll work on this now. (Assignee required)

Comments

@meteorcloudy meteorcloudy added P1 I'll work on this now. (Assignee required) breakage labels Feb 19, 2019
@meteorcloudy
Copy link
Member Author

@cushon Should we rollback this or fix from rules_rust?

@cushon
Copy link
Contributor

cushon commented Feb 19, 2019

@meteorcloudy how do I reproduce the failure?

@meteorcloudy
Copy link
Member Author

I think you can build Bazel from HEAD, they try to build rules_rust by
bazel_head build @docs//:rust-docs

More detailed command is here: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/813#96514f68-0f66-4b73-9e5b-c53f2eb23ec8

@cushon
Copy link
Contributor

cushon commented Feb 19, 2019

@c-parsons

It looks like Bazel at head is being used with the //tools/jdk package from a previous release loaded as the io_bazel workspace by skydoc: https://github.com/bazelbuild/skydoc/blob/0a008878383c51c41db24b313980de19996a6438/setup.bzl#L66

If that's accurate, why is skydoc doing that? Shouldn't it be using the version from the current release?

@c-parsons
Copy link
Contributor

c-parsons commented Feb 19, 2019

I'm confused by your question, sorry.

You've linked to skydoc's binding of @io_bazel at current HEAD, but rust depends on skydoc at an older version. (Specifically, skydoc at that commit seems to depend on io_bazel at e7ebb7e)

If you need a newer version of a repository that's a transitive dependency of skydoc, you should be able to either resolve the diamond dependency explicitly yourself, or depend on a version of skydoc that happens to have its dependency versions compatible with whatever else you need.

@cushon
Copy link
Contributor

cushon commented Feb 19, 2019

Right, but I think that still explains the issue.

Bazel at head removes the native java_host_runtime_alias and atomically replaced the canonical use of that target in tools/jdk with a starlark implementation, so loading old version of tools/jdk with Bazel at head no longer works.

I'm not sure the thing that stardoc is doing here should be supported.

If you need a newer version of a repository that's a transitive dependency of skydoc, you should be able to either resolve the diamond dependency explicitly yourself

How can rules_rust override the version of io_bazel to match the version of bazel in the current build?

@c-parsons
Copy link
Contributor

What is specifically loading the old version of tools/jdk with Bazel at HEAD?
I still don't understand fully what's going on here, so if you could explain in detail what you think is occurring, that would be helpful. So far, it sounds like you have a diamond dependency, specifically two ways to depend on io_bazel, and they have recently become incompatible. The way this is generally resolved is to select a specific version of the conflicting dependency (in this case io_bazel) which is compatible with both of its dependers.

I'm not sure the thing that stardoc is doing here should be supported.

What is "the thing" in this sentence, specifically?

How can rules_rust override the version of io_bazel to match the version of bazel in the current build?

By defining io_bazel themselves in their workspace file prior to the io_bazel_skydoc definition.

@cushon
Copy link
Contributor

cushon commented Feb 19, 2019

What is specifically loading the old version of tools/jdk with Bazel at HEAD?

bazel query -k 'somepath(@docs//:rust-docs, @io_bazel//tools/jdk:*)'
...
@docs//:rust-docs
@io_bazel//src/main/java/com/google/devtools/build/skydoc:skydoc
@io_bazel//src/main/java/com/google/devtools/build/skydoc:skydoc_lib
@io_bazel//src/main/java/com/google/devtools/build/skydoc/fakebuildapi/cpp:cpp
@io_bazel//src/main/java/com/google/devtools/build/lib/actions:actions
@io_bazel//src/main/java/com/google/devtools/build/lib:unix
@io_bazel//src/main/native:libunix.so
@io_bazel//src/main/native:jni_md.h
@io_bazel//src/main/native:copy_link_jni_md_header
@io_bazel//tools/jdk:jni_md_header-windows
@io_bazel//tools/jdk:include/win32/jni_md.h

So far, it sounds like you have a diamond dependency, specifically two ways to depend on io_bazel, and they have recently become incompatible.

It's not really a diamond dependency, just that Bazel at head isn't compatible with old versions of //tools/jdk.

What is "the thing" in this sentence, specifically?

Accessing stuff that's in @bazel_tools by create a separate workspace containing the entire Bazel tree seems like a bad idea. The canonical supported instance of the java_host_runtime_alias rule is in @bazel_tools.

@cushon
Copy link
Contributor

cushon commented Feb 19, 2019

By defining io_bazel themselves in their workspace file prior to the io_bazel_skydoc definition.

Thanks! I opened a PR with a work-around: bazelbuild/rules_rust#195

@cushon cushon closed this as completed Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakage P1 I'll work on this now. (Assignee required)
Projects
None yet
Development

No branches or pull requests

3 participants