Skip to content

Commit

Permalink
[Backport 1.2] Protobuf: bump to 29.1 (#2802)
Browse files Browse the repository at this point in the history
* Protobuf: bump to 29.1 (#2801)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
  • Loading branch information
Yury-Fridlyand authored Dec 11, 2024
1 parent 54d624c commit 79c3bc9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "28.2"
version: "29.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Create secret key ring file
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "28.2"
version: "29.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Start standalone Valkey server
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "28.2"
version: "29.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build java client
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "28.2"
version: "29.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build java wrapper
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
- name: Install protoc (protobuf)
uses: arduino/setup-protoc@v3
with:
version: "26.1"
version: "29.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Test java wrapper
Expand Down
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#### Changes
* Java: Bump protobuf (protoc) version ([#2561](https://github.com/valkey-io/valkey-glide/pull/2561))
* Java: Bump protobuf (protoc) version ([#2561](https://github.com/valkey-io/valkey-glide/pull/2561), [#2802](https://github.com/valkey-io/valkey-glide/pull/2802)
* Java: bump `netty` version ([#2777](https://github.com/valkey-io/valkey-glide/pull/2777))

#### Breaking Changes

#### Fixes
* Core: Fix RESP2 multi-node response from cluster ([#2381](https://github.com/valkey-io/valkey-glide/pull/2381))

#### Operational Enhancements

Expand Down Expand Up @@ -108,8 +109,6 @@
#### Fixes
* Core: UDS Socket Handling Rework ([#2482](https://github.com/valkey-io/valkey-glide/pull/2482))

* Core: Fix RESP2 multi-node response from cluster ([#2381](https://github.com/valkey-io/valkey-glide/pull/2381))

#### Operational Enhancements

* Java: Add modules CI ([#2388](https://github.com/valkey-io/valkey-glide/pull/2388), [#2404](https://github.com/valkey-io/valkey-glide/pull/2404), [#2416](https://github.com/valkey-io/valkey-glide/pull/2416))
Expand Down
27 changes: 7 additions & 20 deletions java/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The Valkey GLIDE Java wrapper consists of both Java and Rust code. Rust bindings
- git
- GCC
- pkg-config
- protoc (protobuf compiler) >= 28.2
- protoc (protobuf compiler) >= 29.1
- openssl
- openssl-dev
- rustup
Expand Down Expand Up @@ -64,17 +64,17 @@ Continue with **Install protobuf compiler** below.
To install protobuf for MacOS, run:
```bash
brew install protobuf
# Check that the protobuf compiler version 28.2 or higher is installed
# Check that the protobuf compiler version 29.1 or higher is installed
protoc --version
```

For the remaining systems, do the following:
```bash
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v28.2/protoc-28.2-linux-x86_64.zip
unzip protoc-28.2-linux-x86_64.zip -d $HOME/.local
curl -LO $PB_REL/download/v29.1/protoc-29.1-linux-x86_64.zip
unzip protoc-29.1-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
# Check that the protobuf compiler version 28.2 or higher is installed
# Check that the protobuf compiler version 29.1 or higher is installed
protoc --version
```

Expand All @@ -87,11 +87,7 @@ Before starting this step, make sure you've installed all software dependencies.
git clone https://github.com/valkey-io/valkey-glide.git
cd valkey-glide/java
```
2. Initialize git submodule:
```bash
git submodule update --init --recursive
```
3. Build the Java wrapper (Choose a build option from the following and run it from the `java` folder):
2. Build the Java wrapper (Choose a build option from the following and run it from the `java` folder):

1. Enter the java directory:

Expand Down Expand Up @@ -164,8 +160,7 @@ Some troubleshooting issues:
you may need to restart your machine. In particular, this may solve the following problems:
- Failed to find `cargo` after `rustup`.
- No Protobuf compiler (protoc) found.
- If build fails because of rust compiler fails, make sure submodules are updated using `git submodule update`.
- If protobuf 28.0 or earlier is detected, upgrade to the latest protobuf release.
- If protobuf 29.0 or earlier is detected, upgrade to the latest protobuf release.
## Running Examples App
Expand Down Expand Up @@ -275,14 +270,6 @@ To (re)generate protobuf code, use the following command:
./gradlew protobuf
```

### Submodules

After pulling new changes, ensure that you update the submodules by running the following command:

```bash
git submodule update
```

### Contributing new ValKey commands

A Valkey command can either have a standalone or cluster implementation which is dependent on their specifications.
Expand Down
10 changes: 5 additions & 5 deletions java/client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}

dependencies {
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '4.28.2'
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '4.29.1'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.13.0'

implementation group: 'io.netty', name: 'netty-handler', version: '4.1.115.Final'
Expand All @@ -38,11 +38,11 @@ dependencies {

ext {
checkProtocVersion = { String output ->
// Line in format like: libprotoc 28.1
// Line in format like: libprotoc 29.1
int majorVersion = Integer.parseInt(output.split(" ")[1].split("\\.")[0].trim());
int minorVersion = Integer.parseInt(output.split(" ")[1].split("\\.")[1].trim());
if (majorVersion < 28) {
throw new GradleException("Protobuf compiler (protoc) version 28.0 or newer is required. Current version: $output");
if (majorVersion < 29) {
throw new GradleException("Protobuf compiler (protoc) version 29.0 or newer is required. Current version: $output");
}
return output.split(" ")[1]
}
Expand All @@ -61,7 +61,7 @@ tasks.register('protobuf', Exec) {
}
} catch (Exception e) {
if (e.getMessage().startsWith("A problem occurred starting process")) {
throw new GradleException("No Protobuf compiler (protoc) found. Protobuf compiler version 28.0 or newer is required.");
throw new GradleException("No Protobuf compiler (protoc) found. Protobuf compiler version 29.0 or newer is required.");
}
throw e
}
Expand Down

0 comments on commit 79c3bc9

Please sign in to comment.