Skip to content

Commit

Permalink
WIP: Upgrade to libthrift 0.19.0
Browse files Browse the repository at this point in the history
Scrooge's `TArrayByteTransport` and `TReusableMemoryTransport` classes both
extend libthrift's abstract `org.apache.thrift.transport.TTransport` class.
That class gained 3 new abstract members with apache/thrift#2191
(September 2020), released with libthrift v0.14.0 (February 2021). Consequently,
both classes currently fail to compile, due to missing implementations for these
methods:

def checkReadBytesAvailable(x$1: Long): Unit = ???
def getConfiguration(): org.apache.thrift.TConfiguration = ???
def updateKnownMessageSize(x$1: Long): Unit = ???

Note that Snyk PR twitter#357 updates only
one of several files that needs to be updated for a libthrift upgrade, and
the most important file is probably `build.sbt`, not `demos/scrooge-maven-demo/pom.xml`.
  • Loading branch information
rtyley committed Mar 12, 2024
1 parent c99132b commit 6766fbe
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ project/boot/
project/plugins/project/
sbt-launch.jar
target/
.bsp/

# Scrooge specific
.classpath.txt
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ val releaseVersion = "24.2.0-SNAPSHOT"

lazy val versions = new {
val slf4j = "1.7.30"
val libthrift = "0.10.0"
val libthrift = "0.19.0"
}

def util(which: String) = "com.twitter" %% ("util-" + which) % releaseVersion
Expand Down
2 changes: 1 addition & 1 deletion demos/scrooge-maven-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.10.0</version>
<version>0.19.0</version>
</dependency>
<dependency>
<groupId>com.twitter</groupId>
Expand Down
4 changes: 2 additions & 2 deletions doc/src/sphinx/CodeGenDep.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Dependencies of the generated code
==================================

The plain code generated by Scrooge depends on apache libthrift (version 0.10.0) and scrooge-core.
The plain code generated by Scrooge depends on apache libthrift (version 0.19.0) and scrooge-core.
You'll need to add the following dependencies to your project, if you use maven (other
build systems are similar)

Expand All @@ -18,7 +18,7 @@ build systems are similar)

.. note::

We recommend using Apache Thrift 0.10.0 to ensure compatibility with Scrooge generated code.
We recommend using Apache Thrift 0.19.0 to ensure compatibility with Scrooge generated code.

If you specify --finagle option, you need to have the following additional dependencies

Expand Down
4 changes: 2 additions & 2 deletions doc/src/sphinx/SBTPlugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ An example using a `build.sbt` file.
.settings(
name := "Scrooge Demo",
libraryDependencies ++= Seq(
"org.apache.thrift" % "libthrift" % "0.10.0",
"org.apache.thrift" % "libthrift" % "0.19.0",
"com.twitter" %% "scrooge-core" % "23.11.0",
"com.twitter" %% "finagle-thrift" % "23.11.0",
scalaTest % Test
Expand Down Expand Up @@ -100,7 +100,7 @@ have Scrooge generate Java code.
scroogeBuildOptions in Compile := Seq(),
scroogeLanguages in Compile := Seq("java"),
libraryDependencies ++= Seq(
"org.apache.thrift" % "libthrift" % "0.10.0",
"org.apache.thrift" % "libthrift" % "0.19.0",
"com.twitter" %% "scrooge-core" % "23.11.0",
"com.twitter" %% "finagle-thrift" % "23.11.0",
scalaTest % Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Licensed under the Apache License, Version 2.0 (see LICENSE).
<dependency org="commons-lang" name="commons-lang" rev="2.6">
<conf name="default" mapped="default"/>
</dependency>
<dependency org="org.apache.thrift" name="libthrift" rev="0.10.0">
<dependency org="org.apache.thrift" name="libthrift" rev="0.19.0">
<conf name="default" mapped="default"/>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Licensed under the Apache License, Version 2.0 (see LICENSE).
<dependency org="commons-lang" name="commons-lang" rev="2.6">
<conf name="default" mapped="default"/>
</dependency>
<dependency org="org.apache.thrift" name="libthrift" rev="0.10.0">
<dependency org="org.apache.thrift" name="libthrift" rev="0.19.0">
<conf name="default" mapped="default"/>
</dependency>
</dependencies>
Expand Down

0 comments on commit 6766fbe

Please sign in to comment.