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

Regression in external cc_proto_library after f43df1e29765f75e02838e4139417e914b3ee812 #4780

Closed
pmbethe09 opened this issue Mar 6, 2018 · 7 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: bug

Comments

@pmbethe09
Copy link
Member

ATTENTION! Please read and follow:

Description of the problem / feature request:

After f43df1e
building a cc_proto_library from a remote repo results in an error.

ERROR: /private/var/tmp/_bazel_pmbethe/d03eb8f816153c36c4229eeab3f690b4/external/com_github_pmbethe09_dtac/cards_proto/BUILD:8:1: Generating C++ proto_library @com_github_pmbethe09_dtac//cards_proto:cards_proto failed (Exit 1)
bazel-out/darwin-fastbuild/genfiles/external/com_github_pmbethe09_dtac/: No such file or directory

Feature requests: what underlying problem are you trying to solve with this feature?

n/a

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

to your WORKSPACE:
git_repository(
name = "com_github_pmbethe09_dtac",
commit = "43b2658ce4bfdd22bd8a0845a10d9b86b33e0385",
remote = "https://github.com/pmbethe09/DTAC.git",
)

bazel build @com_github_pmbethe09_dtac//cards_proto:cards_proto_cc

What operating system are you running Bazel on?

OSX

What's the output of bazel info release?

development version

I ran git bisect from HEAD back a few days and it selected
f43df1e
which I confirmed manually

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

bazel build -c opt --stamp //src:bazel

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

git@github.com:bazelbuild/bazel.git
3e687ff
f43df1e

Have you found anything relevant by searching the web?

f43df1e
fixed an issue with objc protos, but introduced this new one.

Any other information, logs, or outputs that you want to share?

@pmbethe09
Copy link
Member Author

Ah, and you will also need protobuf, say 3.5.1. in your WORKSPACE

PROTO_VERS = "3.5.1"
http_archive(
name = "com_google_protobuf",
sha256 = "1f8b9b202e9a4e467ff0b0f25facb1642727cdf5e69092038f15b37c75b99e45",
strip_prefix = "protobuf-" + PROTO_VERS,
urls = ["https://github.com/google/protobuf/archive/v" + PROTO_VERS + ".zip"],
)

@laszlocsomor laszlocsomor added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Mar 6, 2018
@laszlocsomor laszlocsomor assigned c-parsons and unassigned iirina Mar 6, 2018
@laszlocsomor
Copy link
Contributor

/cc @mikelikespie @c-parsons

@cgrushko cgrushko assigned iirina and unassigned cgrushko Mar 6, 2018
@c-parsons
Copy link
Contributor

I'll issue a rollback.

bazel-io pushed a commit that referenced this issue Mar 6, 2018
*** Reason for rollback ***

Breaks external cc_proto_library. See #4780
RELNOTES: None.

*** Original change description ***

Fixing issue with external j2objc protos

PiperOrigin-RevId: 188041921
@mikelikespie
Copy link
Contributor

I should have a fix for this in the next day or so that makes my change work for both cc_proto_library as well as j2objc's proto library.

I think there's a difference in the codegen plugins where the j2objc one will output.

for protoc -Icards_proto/cards.proto=external/com_github_pmbethe09_dtac/cards_proto/cards.proto

j2objc will output

cards_proto/cars.j2objc.pb.h 

and the c++ will output

external/com_github_pmbethe09_dtac/cards_proto/cards.h

@pmbethe09
Copy link
Member Author

SGTM. I am working on an integration test to catch this sort of thing for cc_proto_library

bazel-io pushed a commit that referenced this issue Mar 29, 2018
This is a re-attempt at #4058 which got reverted via #4780

#4780 was being caused because cc plugin and j2objc plugin used different paths for outputs. I also manually verified that this works for both external cc_proto_librarys and external j2objc java_proto_libraries.

The output files are created without a repository, but the expected
filenames have them

This resolves issues when having a proto_library from an external build
file.

cc @c-parsons @pmbethe09

Closes #4793.

PiperOrigin-RevId: 190950452
@hlopko hlopko added team-Rules-CPP Issues for C++ rules and removed category: rules > C++ labels Oct 11, 2018
@meisterT
Copy link
Member

@c-parsons is this still relevant?

@c-mita
Copy link
Member

c-mita commented Nov 23, 2020

Closing for now. If this is still a problem then please reopen.

@c-mita c-mita closed this as completed Nov 23, 2020
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    This is a re-attempt at bazelbuild/bazel#4058 which got reverted via bazelbuild/bazel#4780

    #4780 was being caused because cc plugin and j2objc plugin used different paths for outputs. I also manually verified that this works for both external cc_proto_librarys and external j2objc java_proto_libraries.

    The output files are created without a repository, but the expected
    filenames have them

    This resolves issues when having a proto_library from an external build
    file.

    cc @c-parsons @pmbethe09

    Closes #4793.

    PiperOrigin-RevId: 190950452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

No branches or pull requests

9 participants