You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Stephen Jiang <sy...@gmail.com> on 2016/12/09 08:00:05 UTC

protobuf 2.5 and 3.1

master branch is in protobuf version 3.1; branch-1.1 is in protobuf version
2.5

I upgraded to version 3.1 in my machine so that I can work on master
branch; now I need to run the protobuf to generate file in branch-1.1 and
get the error:

*[ERROR] Failed to execute goal
org.apache.hadoop:hadoop-maven-plugins:2.5.1:protoc (compile-protoc) on
project hbase-protocol: org.apache.maven.plugin.MojoExecutionException:
protoc version is 'libprotoc 3.1.0', expected version is '2.5.0' -> [Help
1]*

Is there a easy way to have 2 protobuf version side-by-side and specify in
mvn command?

Thanks
Stephen

Re: protobuf 2.5 and 3.1

Posted by Ted Yu <yu...@gmail.com>.
symlink would work.

On my machine, I have the following:

-rwxr-xr-x  1 root  wheel  11756 Oct  2 10:34 /usr/local/bin/proto2
-rwxr-xr-x  1 root  wheel  17184 Oct  2 10:30 /usr/local/bin/proto30
-rwxr-xr-x  1 root  wheel  11756 Nov  2 20:42 /usr/local/bin/protoc
-rwxr-xr-x  1 root  wheel  17372 Oct  6 17:09 /usr/local/bin/protoc31

I use alias when I need to re-generate protobuf for 1.x branches:

alias pr2='proto2 -Isrc/main/protobuf --java_out=src/main/java '

FYI

On Fri, Dec 9, 2016 at 12:15 AM, 张铎 <pa...@gmail.com> wrote:

> In master we use protobuf-maven-plugin to run protoc. The plugin will
> download protoc binary from the maven repo so you do not need to install
> protoc on your machine manually.
>
> So you can just install pb 2.5 on your machine.
>
> For the general question that how to have 2 protobuf versions on one
> machine, I think you need to build protoc from source and install it
> manually, and use symbol link to select the prefered version before you run
> mvn command.
>
> Thanks.
>
> 2016-12-09 16:00 GMT+08:00 Stephen Jiang <sy...@gmail.com>:
>
> > master branch is in protobuf version 3.1; branch-1.1 is in protobuf
> version
> > 2.5
> >
> > I upgraded to version 3.1 in my machine so that I can work on master
> > branch; now I need to run the protobuf to generate file in branch-1.1 and
> > get the error:
> >
> > *[ERROR] Failed to execute goal
> > org.apache.hadoop:hadoop-maven-plugins:2.5.1:protoc (compile-protoc) on
> > project hbase-protocol: org.apache.maven.plugin.MojoExecutionException:
> > protoc version is 'libprotoc 3.1.0', expected version is '2.5.0' -> [Help
> > 1]*
> >
> > Is there a easy way to have 2 protobuf version side-by-side and specify
> in
> > mvn command?
> >
> > Thanks
> > Stephen
> >
>

Re: protobuf 2.5 and 3.1

Posted by Stack <st...@duboce.net>.
On Fri, Dec 9, 2016 at 12:15 AM, 张铎 <pa...@gmail.com> wrote:

> In master we use protobuf-maven-plugin to run protoc. The plugin will
> download protoc binary from the maven repo so you do not need to install
> protoc on your machine manually.
>
> So you can just install pb 2.5 on your machine.
>
> For the general question that how to have 2 protobuf versions on one
> machine, I think you need to build protoc from source and install it
> manually, and use symbol link to select the prefered version before you run
> mvn command.
>
> Thanks.
>
>
What Duo says above. You don't need to install 3.1 on your machine
because protobuf-maven-plugin
does all for you. If wanted, I could backport the protobuf-maven-plugin
conversion to branch-1 so you wouldn't need to install 2.5 either.

In the refguide, we have a new chapter on protobuf:
http://hbase.apache.org/book.html#_protobuf It intentionally makes no
mention of protoc nor do we make mention in the module READMEs. The thought
was that since this is all handled for you, then there is no need to bother
developer's pretty little heads w/ protobuf version details.

Let me know if I can do anything to make your experience more smooth
running Steven,
At your service,
St.Ack




> 2016-12-09 16:00 GMT+08:00 Stephen Jiang <sy...@gmail.com>:
>
> > master branch is in protobuf version 3.1; branch-1.1 is in protobuf
> version
> > 2.5
> >
> > I upgraded to version 3.1 in my machine so that I can work on master
> > branch; now I need to run the protobuf to generate file in branch-1.1 and
> > get the error:
> >
> > *[ERROR] Failed to execute goal
> > org.apache.hadoop:hadoop-maven-plugins:2.5.1:protoc (compile-protoc) on
> > project hbase-protocol: org.apache.maven.plugin.MojoExecutionException:
> > protoc version is 'libprotoc 3.1.0', expected version is '2.5.0' -> [Help
> > 1]*
> >
> > Is there a easy way to have 2 protobuf version side-by-side and specify
> in
> > mvn command?
> >
> > Thanks
> > Stephen
> >
>

Re: protobuf 2.5 and 3.1

Posted by 张铎 <pa...@gmail.com>.
In master we use protobuf-maven-plugin to run protoc. The plugin will
download protoc binary from the maven repo so you do not need to install
protoc on your machine manually.

So you can just install pb 2.5 on your machine.

For the general question that how to have 2 protobuf versions on one
machine, I think you need to build protoc from source and install it
manually, and use symbol link to select the prefered version before you run
mvn command.

Thanks.

2016-12-09 16:00 GMT+08:00 Stephen Jiang <sy...@gmail.com>:

> master branch is in protobuf version 3.1; branch-1.1 is in protobuf version
> 2.5
>
> I upgraded to version 3.1 in my machine so that I can work on master
> branch; now I need to run the protobuf to generate file in branch-1.1 and
> get the error:
>
> *[ERROR] Failed to execute goal
> org.apache.hadoop:hadoop-maven-plugins:2.5.1:protoc (compile-protoc) on
> project hbase-protocol: org.apache.maven.plugin.MojoExecutionException:
> protoc version is 'libprotoc 3.1.0', expected version is '2.5.0' -> [Help
> 1]*
>
> Is there a easy way to have 2 protobuf version side-by-side and specify in
> mvn command?
>
> Thanks
> Stephen
>