google / copybara

Copybara: A tool for transforming and moving code between repositories.
Apache License 2.0
2.12k stars 254 forks source link

Compiling Copybara through Bazel #267

Open 8W9aG opened 10 months ago

8W9aG commented 10 months ago

I am currently trying to compile Copybara using the workspace additions recommended in the README.md with the following command:

bazel build @com_github_google_copybara//java/com/google/copybara

I am seeing the following issue:

external/io_bazel/src/main/java/net/starlark/java/eval/Dict.java:462: error: cannot find symbol
        var dict = (Dict<K, V>) m;
        ^
  symbol:   class var
  location: class Dict<K,V>
  where K,V are type-variables:
    K extends Object declared in class Dict
    V extends Object declared in class Dict

Is there a specific toolchain that copybara developers recommend when building this in bazel?

mikelalcon commented 10 months ago

You need Java 11. See https://github.com/google/copybara/blob/master/cloudbuild.yaml#L13 as an example on how to invoke.