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 rules for protobufs so that we don't have to regenerate generated protobuf code #83

Closed
dabacon opened this issue Feb 13, 2018 · 7 comments

Comments

@dabacon
Copy link
Collaborator

dabacon commented Feb 13, 2018

No description provided.

@dabacon
Copy link
Collaborator Author

dabacon commented Sep 12, 2018

We no longer include the generated code because the engine code can use straight python dictionaries. However we should probably include bazel rules here anyway.

@vtomole
Copy link
Collaborator

vtomole commented Sep 13, 2018

Would like to help with this if i knew what it meant. I'm willing to learn Bazel but there are no tutorials for Python: https://docs.bazel.build/versions/master/getting-started.html

@vtomole
Copy link
Collaborator

vtomole commented Sep 13, 2018

Looks like Bazel rules are language agnostic. This is what I have in a BUILD file in cirq/api/google/v1

proto_library(
    name = "operations_proto",
    srcs = ["operations.proto"],
)

proto_library(
    name = "params_proto",
    srcs = ["params.proto"],
)

proto_library(
    name = "program_proto",
    srcs = ["program.proto"],
    deps = [
    "operations_proto",
    "params_proto",
    ],
)

@dabacon
Copy link
Collaborator Author

dabacon commented Sep 18, 2018

@vtomole have you check to see if this compiles in Bazel? If so I think we should add these (without making bazel a requirement of Cirq, but I think this will be useful...at least it will be inside of Google!)

@vtomole
Copy link
Collaborator

vtomole commented Sep 18, 2018

Bazel can compile it. Should I also send the WORKSPACE file? It's in Cirq/ and it contains

# This statement defines the @com_google_protobuf repo.
http_archive(
    name = "com_google_protobuf",
    sha256 = "cef7f1b5a7c5fba672bec2a319246e8feba471f04dcebfe362d55930ee7c1c30",
    strip_prefix = "protobuf-3.5.0",
    urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"],
)

Cirq$ bazel build //cirq/api/google/v1:program_proto
and friends can't succeed without it.

@Strilanc Strilanc reopened this Oct 16, 2018
@Strilanc
Copy link
Contributor

I had to kill the bazel step on travis because the jdk download started 404ing

@dabacon
Copy link
Collaborator Author

dabacon commented Apr 24, 2019

we have valid BUILD files, but aren't using or requiring bazel. I think we should close.

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

No branches or pull requests

3 participants