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

Protosb descriptor isn't 2.x compatible #28

Closed
crispywalrus opened this issue May 27, 2015 · 14 comments
Closed

Protosb descriptor isn't 2.x compatible #28

crispywalrus opened this issue May 27, 2015 · 14 comments

Comments

@crispywalrus
Copy link

scalapb/scalapb.proto contains a syntax="proto2"; directive in it, this directive isn't understood by protoc (2.x.x) This means using scalapb's very nice advance features isn't possible. Our team isn't ready to move to 3.x given it's alpha status but we'd like to start using scalapb's advance field type functionality.

@ahjohannessen
Copy link
Contributor

I use scalapb 0.4.14 and "com.github.os72" % "protoc-jar" % "2.x.5" using "-v261". It seems to work without problems having

syntax = "proto2";
import "scalapb/scalapb.proto";
...

at the beginning of my proto files.

@thesamet
Copy link
Contributor

@crispywalrus Thanks for reporting. Are you on protoc 2.6.1 or an earlier version?

We can solve it by providing a second copy of scalapb.proto without that line so it can work with older protoc's. In the mean time you can work around it by modifying your own copy of scalapb.proto.

@thesamet
Copy link
Contributor

Closing due to inactivity. I believe this should work on >=2.6.1

@onsails
Copy link

onsails commented Jul 16, 2015

@thesamet I am using protoc 2.6.1 and getting an error

Import "scalapb/scalapb.proto" was not found or had errors.

I suppose it's related to this issue.

@onsails
Copy link

onsails commented Jul 16, 2015

nvm, I didn't add scalapb-runtime

@niiamon
Copy link

niiamon commented Sep 2, 2015

@prettynatty how did you add scalapb-runtime?

@thesamet
Copy link
Contributor

thesamet commented Sep 2, 2015

@niiamon See "Adding scalapb.proto to your project" at http://trueaccord.github.io/ScalaPB/customizations.html

@niiamon
Copy link

niiamon commented Sep 5, 2015

@thesamet thanks but I already have that in the project but it's still not working.

@prettynatty I'm actually using your actor-server but I am simply unable to get it to compile due to the protobufs error.

These are some of the issues that complain when I attempt a build:

Error: Import "scalapb/scalapb.proto" was not found or had errors.
Error: Import "sequence.proto" was not found or had errors.

Any ideas how I can get over this?

@thesamet
Copy link
Contributor

thesamet commented Sep 5, 2015

@niiamon Will you be able to reproduce this issue on a minimal project and post it on github so we can help debug?

@niiamon
Copy link

niiamon commented Sep 5, 2015

@thesamet on it. I will revert here as soon as I have something.

@niiamon
Copy link

niiamon commented Sep 13, 2015

@thesamet Please see this: https://github.com/niiamon/scalapb-test. I have Scala PB added to the project and I have a small proto file in there.

I am still relatively new to Scala and Protocol Buffers as well so any comments are welcome.

@thesamet
Copy link
Contributor

@niiamon , your build.sbt was adding sbt-scalapb instead of scalapb-runtime to the library dependencies. Another unrelated issue that prevented it from compiling was a reference to a configuration named testerpackage, I renamed it to test so the example can fully run.

So the full libraryDependencies in your case should be:

libraryDependencies ++= {
  val akkaV       = "2.3.12"
  val akkaStreamV = "1.0"
  val scalaTestV  = "2.2.5"
  Seq(
    "com.typesafe.akka" %% "akka-actor"                           % akkaV,
    "com.typesafe.akka" %% "akka-stream-experimental"             % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-core-experimental"          % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-experimental"               % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-spray-json-experimental"    % akkaStreamV,
    "com.typesafe.akka" %% "akka-http-testkit-experimental"       % akkaStreamV,
    "org.scalatest"     %% "scalatest"                            % scalaTestV % "test",
    "com.trueaccord.scalapb" %% "scalapb-runtime"                 % "0.5.9" % PB.protobufConfig
  )
}

@niiamon
Copy link

niiamon commented Sep 14, 2015

@thesamet so I've made those changes here as well. No such luck. I still get the same import was not found problem.

@thesamet
Copy link
Contributor

Works completely fine here when I start sbt and type compile. Have you reloaded sbt after making the change (type 'reload' in an existing sbt session, or just exit sbt and start it again)? If the problem persists after an sbt restart, let's continue debugging it at Stackoverflow (please @thesamet there)

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

5 participants