[Git][java-team/snappy-java][master] 5 commits: New upstream version 1.1.10.8
Tony Mancill (@tmancill)
gitlab at salsa.debian.org
Fri Aug 8 19:34:09 BST 2025
Tony Mancill pushed to branch master at Debian Java Maintainers / snappy-java
Commits:
87304634 by tony mancill at 2025-08-07T15:28:29-07:00
New upstream version 1.1.10.8
- - - - -
5ce61575 by tony mancill at 2025-08-07T15:28:30-07:00
Update upstream source from tag 'upstream/1.1.10.8'
Update to upstream version '1.1.10.8'
with Debian dir fb89ee6a324b661d0510c338b76d9debf87740a7
- - - - -
433be2a2 by tony mancill at 2025-08-07T15:29:08-07:00
Bump Standards-Version to 4.7.2
- - - - -
8f8fe38d by tony mancill at 2025-08-07T15:39:39-07:00
Freshen years in debian/copyright
- - - - -
ac4d55b7 by tony mancill at 2025-08-07T15:40:01-07:00
Prepare changelog for upload
- - - - -
21 changed files:
- .github/workflows/build-native.yml
- .github/workflows/release.yml
- .github/workflows/snapshot.yml
- .github/workflows/test.yml
- .scalafmt.conf
- BUILD.md
- + CLAUDE.md
- Makefile
- Makefile.common
- README.md
- build.sbt
- debian/changelog
- debian/control
- debian/copyright
- + docker/Dockerfile.linux-x86_64-musl
- project/build.properties
- project/plugins.sbt
- src/main/java/org/xerial/snappy/OSInfo.java
- src/main/java/org/xerial/snappy/SnappyInputStream.java
- src/main/java/org/xerial/snappy/SnappyOutputStream.java
- src/main/resources/META-INF/native-image/org.xerial.snappy/snappy-java/resource-config.json
Changes:
=====================================
.github/workflows/build-native.yml
=====================================
@@ -4,7 +4,6 @@ on:
workflow_dispatch:
push:
branches:
- - master
- main
paths:
- 'src/main/resources/org/xerial/snappy/VERSION'
=====================================
.github/workflows/release.yml
=====================================
@@ -32,6 +32,6 @@ jobs:
./sbt publishSigned
- name: Release to Sonatype
env:
- SONATYPE_USERNAME: '${{ secrets.SONATYPE_USER }}'
- SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASS }}'
- run: ./sbt sonatypeBundleRelease
+ SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
+ SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
+ run: ./sbt sonaRelease
=====================================
.github/workflows/snapshot.yml
=====================================
@@ -3,7 +3,7 @@ name: Snapshot Release
on:
push:
branches:
- - master
+ - main
paths:
- '**.scala'
- '**.java'
@@ -24,9 +24,10 @@ jobs:
fetch-depth: 10000
# Fetch all tags so that sbt-dynver can find the previous release version
- run: git fetch --tags
- - uses: olafurpg/setup-scala at v14
+ - uses: actions/setup-java at v4
with:
- java-version: adopt at 1.11
+ distribution: 'zulu'
+ java-version: '11'
- uses: actions/cache at v4
with:
path: ~/.cache
@@ -34,6 +35,6 @@ jobs:
restore-keys: ${{ runner.os }}-snapshot-
- name: Publish snapshots
env:
- SONATYPE_USERNAME: '${{ secrets.SONATYPE_USER }}'
- SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASS }}'
+ SONATYPE_USERNAME: '${{ secrets.SONATYPE_USERNAME }}'
+ SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASSWORD }}'
run: ./sbt publish
=====================================
.github/workflows/test.yml
=====================================
@@ -2,30 +2,37 @@ name: CI
on:
pull_request:
- paths:
- - '**.scala'
- - '**.java'
- - '**.sbt'
- - '.github/workflows/*.yml'
- - '**.so'
- - '**.dll'
- - 'src/main/resources/**'
- - 'project/build.properties'
push:
branches:
- - master
- main
- paths:
- - '**.scala'
- - '**.java'
- - '**.sbt'
- - '.github/workflows/*.yml'
- - 'src/main/resources/org/xerial/snappy/**'
- - 'project/build.properties'
jobs:
+ changes:
+ runs-on: ubuntu-latest
+ outputs:
+ code: ${{ steps.filter.outputs.code }}
+ steps:
+ - uses: actions/checkout at v4
+ - uses: dorny/paths-filter at v3
+ id: filter
+ with:
+ filters: |
+ code:
+ - '**.scala'
+ - '**.java'
+ - '**.sbt'
+ - '.github/workflows/*.yml'
+ - '**.so'
+ - '**.dll'
+ - 'src/main/resources/**'
+ - 'project/build.properties'
+ - '.scalafmt.conf'
+ - 'sbt'
+ - 'sbt.bat'
code_format:
name: code format
+ needs: changes
+ if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout at v4
@@ -34,8 +41,10 @@ jobs:
test-jdk:
strategy:
matrix:
- version: [ '8', '11', '17', '21' ]
+ version: [ '8', '11', '17', '21', '24' ]
name: test jdk${{ matrix.version }}
+ needs: changes
+ if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout at v4
=====================================
.scalafmt.conf
=====================================
@@ -1,5 +1,16 @@
-version = 3.8.3
-runner.dialect = scala213source3
-maxColumn = 180
+version = 3.9.4
+project.layout = StandardConvention
+runner.dialect = scala3
+maxColumn = 100
style = defaultWithAlign
-optIn.breaksInsideChains = true
+docstrings.blankFirstLine = yes
+rewrite.scala3.convertToNewSyntax = true
+rewrite.scala3.removeOptionalBraces = yes
+rewrite.scala3.insertEndMarkerMinLines = 30
+# Add a new line before case class
+newlines.topLevelStatementBlankLines = [
+ {
+ blanks { after = 1 }
+ }
+]
+newlines.source = unfold
=====================================
BUILD.md
=====================================
@@ -116,4 +116,9 @@ If you are using Mac and openjdk7 (or higher), use the following option:
$ make native LIBNAME=libsnappyjava.dylib
+## Building with Alpine
+This project supports Alpine-based container images, which use the musl libc implementation. When building on Alpine, be aware that:
+- All required dependencies are compatible with musl libc
+- The build process has been tested and verified on Alpine environments
+- No additional configuration is needed for Alpine compatibility
=====================================
CLAUDE.md
=====================================
@@ -0,0 +1,137 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Project Overview
+
+snappy-java is a Java port of Google's Snappy compression library, providing fast compression/decompression with JNI bindings for native performance across multiple platforms.
+
+## Build Commands
+
+### Using sbt (primary build tool)
+
+```bash
+# Enter sbt console
+./sbt
+
+# Run tests
+./sbt test
+
+# Run tests matching a pattern
+./sbt "testOnly *BitShuffleTest"
+
+# Create jar file
+./sbt package
+
+# Publish to local Maven repository
+./sbt publishM2
+
+# Run tests continuously on code changes
+./sbt "~test"
+```
+
+### Using make (for native library compilation)
+
+```bash
+# Build native libraries
+make
+
+# Clean build artifacts
+make clean
+
+# Platform-specific builds (when cross-compiling)
+make native-all
+```
+
+## Architecture
+
+### Core Components
+
+1. **Java API Layer** (`src/main/java/org/xerial/snappy/`)
+ - `Snappy.java`: Main API facade providing high-level compression/decompression methods
+ - `SnappyNative.java`: JNI interface to native Snappy library
+ - `SnappyLoader.java`: Handles platform-specific native library loading
+
+2. **Native Layer** (`src/main/java/org/xerial/snappy/`)
+ - `SnappyNative.cpp`: JNI implementation bridging Java and C++ Snappy
+ - `BitShuffleNative.cpp`: JNI implementation for BitShuffle algorithm
+
+3. **Stream API** (`src/main/java/org/xerial/snappy/`)
+ - `SnappyOutputStream`/`SnappyInputStream`: Block-based compression streams
+ - `SnappyFramedOutputStream`/`SnappyFramedInputStream`: Framing format implementation
+ - `SnappyHadoopCompatibleOutputStream`: Hadoop-compatible format
+
+4. **Memory Management** (`src/main/java/org/xerial/snappy/buffer/` and `/pool/`)
+ - Buffer allocation and pooling for efficient memory usage
+ - Direct ByteBuffer management for zero-copy operations
+
+### Platform Support
+
+The project includes pre-built native libraries for multiple platforms in `src/main/resources/org/xerial/snappy/native/`:
+- Windows (x86, x86_64, aarch64)
+- macOS (x86, x86_64, aarch64)
+- Linux (x86, x86_64, aarch64, arm, armv6, armv7, ppc64, ppc64le, s390x, riscv64, loongarch64)
+- AIX (ppc, ppc64)
+- SunOS (x86, x86_64, sparc)
+- Android (arm, aarch64)
+
+### Cross-compilation
+
+The project uses Docker-based cross-compilation toolchains (see `docker/` directory) for building native libraries across different architectures.
+
+## Testing
+
+```bash
+# Run all tests with debug logging
+./sbt "testOnly * -- -l debug"
+
+# Run specific test class
+./sbt "testOnly org.xerial.snappy.SnappyTest"
+
+# The project uses AirSpec (for Scala tests) and JUnit (for Java tests)
+# Tests are located in src/test/java/org/xerial/snappy/
+```
+
+## Important Notes
+
+1. **Native Library Loading**: The project automatically detects the platform and loads the appropriate native library from resources
+2. **Memory Safety**: Uses direct ByteBuffers for efficient memory operations - be aware of buffer boundaries
+3. **Thread Safety**: Snappy compression/decompression methods are thread-safe as they don't maintain state
+4. **OSGi Support**: The project includes OSGi bundle configuration in build.sbt
+5. **Compatibility**: Multiple stream formats are supported - ensure you use matching read/write formats (see compatibility matrix in README.md)
+
+## Development Workflow
+
+### Pull Request Guidelines
+- Use squashed commits when merging PRs to maintain clean commit history
+- Run tests before creating PR: `./sbt test`
+- Format code: `./sbt scalafmtAll`
+
+### Release Process
+The project uses sbt's built-in Sonatype integration for publishing:
+
+```bash
+# 1. Stage artifacts to Sonatype
+./sbt publishSigned
+
+# 2. Release to Maven Central
+./sbt sonaRelease
+```
+
+**Prerequisites:**
+- Set up Sonatype credentials in `~/.sbt/1.0/sonatype.sbt`:
+ ```scala
+ credentials += Credentials("Sonatype Nexus Repository Manager",
+ "s01.oss.sonatype.org",
+ "<username>",
+ "<password>")
+ ```
+- Configure PGP signing for artifact signing
+
+### Common Development Tasks
+- When making changes to native code, rebuild with `make clean-native native`
+- For Java/Scala changes, use `./sbt ~test` for continuous testing
+- Always test on multiple JDK versions if possible (8, 11, 17, 21)
+
+### Native Code Testing
+- Use make clean-native native for testing native code
=====================================
Makefile
=====================================
@@ -94,13 +94,13 @@ snappy-header: $(SNAPPY_CMAKE_CACHE)
$(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class: $(SRC)/org/xerial/snappy/SnappyNative.java
@mkdir -p $(TARGET)/jni-classes
- $(JAVAC) -source 1.7 -target 1.7 -h $(SRC)/org/xerial/snappy/ -d $(TARGET)/jni-classes -sourcepath $(SRC) $<
+ $(JAVAC) -source 8 -target 8 -h $(SRC)/org/xerial/snappy/ -d $(TARGET)/jni-classes -sourcepath $(SRC) $<
$(SRC)/org/xerial/snappy/SnappyNative.h: $(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class
$(TARGET)/jni-classes/org/xerial/snappy/BitShuffleNative.class: $(SRC)/org/xerial/snappy/BitShuffleNative.java
@mkdir -p $(TARGET)/jni-classes
- $(JAVAC) -source 1.7 -target 1.7 -h $(SRC)/org/xerial/snappy/ -d $(TARGET)/jni-classes -sourcepath $(SRC) $<
+ $(JAVAC) -source 8 -target 8 -h $(SRC)/org/xerial/snappy/ -d $(TARGET)/jni-classes -sourcepath $(SRC) $<
$(SRC)/org/xerial/snappy/BitShuffleNative.h: $(TARGET)/jni-classes/org/xerial/snappy/BitShuffleNative.class
@@ -151,7 +151,7 @@ native: jni-header snappy-header $(NATIVE_DLL)
native-nocmake: jni-header $(NATIVE_DLL)
snappy: native $(TARGET)/$(snappy-jar-version).jar
-native-all: native native-arm clean-docker mac64 win32 win64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x
+native-all: native native-arm clean-docker mac64 win32 win64 linux32 linux64 linux-ppc64le linux-riscv64 linux-s390x musl-image musl
ifdef CI
# Clean docker images within CI to avoid no space left error
@@ -199,6 +199,12 @@ linux32: jni-header
linux64: jni-header
docker run $(DOCKER_RUN_OPTS) -i -v $$PWD:/work xerial/centos5-linux-x86_64-pic bash -c 'make clean-native native-nocmake OS_NAME=Linux OS_ARCH=x86_64'
+musl-image:
+ docker build -f docker/Dockerfile.linux-x86_64-musl -t snappy-java-musl .
+
+musl: jni-header
+ docker run $(DOCKER_RUN_OPTS) -i -v $$PWD:/work snappy-java-musl bash -c 'make clean-native native-nocmake OS_NAME=Linux OS_ARCH=x86_64-musl'
+
freebsd64:
$(MAKE) native OS_NAME=FreeBSD OS_ARCH=x86_64
=====================================
Makefile.common
=====================================
@@ -6,7 +6,6 @@ ifndef JAVA_HOME
$(warning Set JAVA_HOME environment variable)
endif
-
JAVA := "$$JAVA_HOME/bin/java"
JAVAC := "$$JAVA_HOME/bin/javac"
JAVAH := "$$JAVA_HOME/bin/javah"
@@ -51,7 +50,7 @@ endif
# os=Default is meant to be generic unix/linux
# To support new CPU architecture, add a new target name here
-known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 Windows-aarch64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64 Linux-loongarch Linux-loongarch64
+known_os_archs := Linux-x86_64-musl Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 Windows-aarch64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64 Linux-loongarch Linux-loongarch64
os_arch := $(OS_NAME)-$(OS_ARCH)
IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7"))
@@ -103,6 +102,17 @@ Linux-x86_64_LINKFLAGS := -shared -static-libgcc -static-libstdc++
Linux-x86_64_LIBNAME := libsnappyjava.so
Linux-x86_64_SNAPPY_FLAGS :=
+Linux-x86_64-musl_CXX := $(CROSS_PREFIX)g++
+Linux-x86_64-musl_STRIP := $(CROSS_PREFIX)strip
+ifeq ($(IBM_JDK_7),)
+ Linux-x86_64-musl_CXXFLAGS := -Ilib/inc_linux -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -m64 -std=c++11
+else
+ Linux-x86_64-musl_CXXFLAGS := -include $(IBM_JDK_LIB)/jni_md.h -include $(IBM_JDK_LIB)/jniport.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -m64 -std=c++11
+endif
+Linux-x86_64-musl_LINKFLAGS := -shared -static-libgcc -static-libstdc++
+Linux-x86_64-musl_LIBNAME := libsnappyjava.so
+Linux-x86_64-musl_SNAPPY_FLAGS :=
+
Linux-ppc_CXX := g++
Linux-ppc_STRIP := strip
ifeq ($(IBM_JDK_7),)
=====================================
README.md
=====================================
@@ -51,6 +51,12 @@ Snappy-java is available from Maven's central repository. Add the following depe
<scope>compile</scope>
</dependency>
+### Using with Gradle
+
+```
+implementation("org.xerial.snappy:snappy-java:(version)")
+```
+
### Using with sbt
```
=====================================
build.sbt
=====================================
@@ -5,8 +5,11 @@ organization := "org.xerial.snappy"
organizationName := "xerial.org"
description := "snappy-java: A fast compression/decompression library"
-sonatypeProfileName := "org.xerial"
-ThisBuild / publishTo := sonatypePublishToBundle.value
+ThisBuild / publishTo := {
+ val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
+ if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
+ else localStaging.value
+}
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html"))
homepage := Some(url("https://github.com/xerial/snappy-java"))
scmInfo := Some(
@@ -24,7 +27,7 @@ ThisBuild / dynverSonatypeSnapshots := true
// Use coursier friendly version separator
ThisBuild / dynverSeparator := "-"
-ThisBuild / scalaVersion := "2.12.11"
+ThisBuild / scalaVersion := "3.7.1"
// For building jars for JDK8
ThisBuild / javacOptions ++= {
@@ -72,13 +75,13 @@ autoScalaLibrary := false
crossPaths := false
libraryDependencies ++= Seq(
- "junit" % "junit" % "4.13.2" % "test",
- "org.codehaus.plexus" % "plexus-classworlds" % "2.8.0" % "test",
- "org.xerial.java" % "xerial-core" % "2.1" % "test",
- "org.wvlet.airframe" %% "airframe-log" % "24.9.0" % "test",
- "org.osgi" % "org.osgi.core" % "6.0.0" % "provided",
- "com.github.sbt" % "junit-interface" % "0.13.3" % "test",
- "org.apache.hadoop" % "hadoop-common" % "3.4.0" % "test" exclude ("org.xerial.snappy", "snappy-java")
+ "junit" % "junit" % "4.13.2" % "test",
+ "org.codehaus.plexus" % "plexus-classworlds" % "2.9.0" % "test",
+ "org.xerial.java" % "xerial-core" % "2.1" % "test",
+ "org.wvlet.airframe" %% "airframe-log" % "2025.1.14" % "test",
+ "org.osgi" % "org.osgi.core" % "6.0.0" % "provided",
+ "com.github.sbt" % "junit-interface" % "0.13.3" % "test",
+ "org.apache.hadoop" % "hadoop-common" % "3.4.1" % "test" exclude ("org.xerial.snappy", "snappy-java")
)
enablePlugins(SbtOsgi)
@@ -111,6 +114,7 @@ OsgiKeys.additionalHeaders := Map(
"org/xerial/snappy/native/Linux/ppc64/libsnappyjava.so;osname=linux;processor=ppc64le",
"org/xerial/snappy/native/Linux/s390x/libsnappyjava.so;osname=linux;processor=s390x",
"org/xerial/snappy/native/Linux/loongarch64/libsnappyjava.so;osname=linux;processor=loongarch64",
+ "org/xerial/snappy/native/Linux/x86_64-musl/libsnappyjava.so;osname=linux;processor=x86-64",
"org/xerial/snappy/native/AIX/ppc/libsnappyjava.a;osname=aix;processor=ppc",
"org/xerial/snappy/native/AIX/ppc64/libsnappyjava.a;osname=aix;processor=ppc64",
"org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86",
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+snappy-java (1.1.10.8-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream version 1.1.10.8
+ * Bump Standards-Version to 4.7.2
+
+ -- tony mancill <tmancill at debian.org> Thu, 07 Aug 2025 15:28:35 -0700
+
snappy-java (1.1.10.7-1) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -10,7 +10,7 @@ Build-Depends:
libmaven-bundle-plugin-java,
libsnappy-dev,
maven-debian-helper
-Standards-Version: 4.7.0
+Standards-Version: 4.7.2
Vcs-Browser: https://salsa.debian.org/java-team/snappy-java
Vcs-Git: https://salsa.debian.org/java-team/snappy-java.git
Homepage: https://github.com/xerial/snappy-java
=====================================
debian/copyright
=====================================
@@ -14,13 +14,14 @@ Files-Excluded: src/main/resources/org/xerial/snappy/native/*
.gitignore
Files: *
-Copyright: 2008-2011, Taro L. Saito
- 2011-2016, xerial.org
+Copyright: 2008-2025, Taro L. Saito
+ 2011-2025, xerial.org
License: Apache-2.0
Files: debian/*
-Copyright: 2012 Charles Plessy <plessy at debian.org>
- 2012-2018 Andreas Tille <tille at debian.org>
+Copyright: 2012-2025 Charles Plessy <plessy at debian.org>
+ 2012-2025 Andreas Tille <tille at debian.org>
+ 2023-2025 tony mancill <tmancill at debian.org>
License: Apache-2.0
License: Apache-2.0
=====================================
docker/Dockerfile.linux-x86_64-musl
=====================================
@@ -0,0 +1,36 @@
+FROM alpine:3.18
+
+# Set workspace directory
+WORKDIR /work
+
+# Copy the project to the container
+COPY . .
+
+# Install build dependencies
+RUN apk add --no-cache \
+ openjdk8 \
+ cmake \
+ make \
+ gcc \
+ g++ \
+ musl-dev \
+ linux-headers \
+ git \
+ util-linux \
+ bash \
+ curl
+
+# Install SBT
+RUN curl -L "https://github.com/sbt/sbt/releases/download/v1.9.7/sbt-1.9.7.tgz" | tar xz -C /usr/local
+ENV PATH="/usr/local/sbt/bin:${PATH}"
+
+# Install python/pip
+ENV PYTHONUNBUFFERED=1
+RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
+RUN python3 -m ensurepip
+RUN pip3 install --no-cache --upgrade pip setuptools
+
+# Set Env Vars
+ENV CC=gcc CXX=g++
+ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
+ENV PATH="${JAVA_HOME}/bin:${PATH}"
=====================================
project/build.properties
=====================================
@@ -1,2 +1,2 @@
-sbt.version=1.10.1
+sbt.version=1.11.3
=====================================
project/plugins.sbt
=====================================
@@ -1,5 +1,4 @@
-addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.3")
-addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
+addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
addSbtPlugin("com.github.sbt" % "sbt-osgi" % "0.10.0")
-addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
-addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
+addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.5")
+addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.1")
=====================================
src/main/java/org/xerial/snappy/OSInfo.java
=====================================
@@ -25,6 +25,7 @@
package org.xerial.snappy;
import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -44,6 +45,7 @@ public class OSInfo {
public static final String IA64 = "ia64";
public static final String PPC = "ppc";
public static final String PPC64 = "ppc64";
+ public static final String PPC64LE = "ppc64le";
public static final String IBMZ = "s390";
public static final String IBMZ_64 = "s390x";
public static final String AARCH_64 = "aarch64";
@@ -80,6 +82,9 @@ public class OSInfo {
archMapping.put("power_pc", PPC);
archMapping.put("power_rs", PPC);
+ //PowerPC 64bit Little Endian mappings
+ archMapping.put(PPC64LE, PPC64LE);
+
// TODO: PowerPC 64bit mappings
archMapping.put(PPC64, PPC64);
archMapping.put("power64", PPC64);
@@ -172,7 +177,7 @@ public class OSInfo {
}
// Java 1.8 introduces a system property to determine armel or armhf
- // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8005545
+ // https://bugs.openjdk.org/browse/JDK-8005545
String abi = System.getProperty("sun.arch.abi");
if(abi != null && abi.startsWith("gnueabihf")) {
return "armv7";
@@ -215,6 +220,10 @@ public class OSInfo {
return "android-arm";
}
+ if (isX64Musl()) {
+ return "x86_64-musl";
+ }
+
if(osArch.startsWith("arm")) {
osArch = resolveArmArchType();
}
@@ -226,6 +235,14 @@ public class OSInfo {
return translateArchNameToFolderName(osArch);
}
+ private static boolean isX64Musl() {
+ try {
+ return new File("/lib/ld-musl-x86_64.so.1").exists();
+ } catch (SecurityException e) {
+ return false;
+ }
+ }
+
static String translateOSNameToFolderName(String osName) {
if(osName.contains("Windows")) {
return "Windows";
=====================================
src/main/java/org/xerial/snappy/SnappyInputStream.java
=====================================
@@ -448,12 +448,7 @@ public class SnappyInputStream
// extend the compressed data buffer size
if (compressed == null || chunkSize > compressed.length) {
// chunkSize exceeds limit
- try {
- compressed = new byte[chunkSize];
- }
- catch (java.lang.OutOfMemoryError e) {
- throw new SnappyError(SnappyErrorCode.INVALID_CHUNK_SIZE, e.getMessage());
- }
+ compressed = new byte[chunkSize];
}
readBytes = 0;
while (readBytes < chunkSize) {
=====================================
src/main/java/org/xerial/snappy/SnappyOutputStream.java
=====================================
@@ -60,8 +60,8 @@ public class SnappyOutputStream
extends OutputStream
{
public static final int MAX_BLOCK_SIZE = 512 * 1024 * 1024; // 512 MiB
- static final int MIN_BLOCK_SIZE = 1 * 1024;
- static final int DEFAULT_BLOCK_SIZE = 32 * 1024; // Use 32kb for the default block size
+ public static final int MIN_BLOCK_SIZE = 1 * 1024;
+ public static final int DEFAULT_BLOCK_SIZE = 32 * 1024; // Use 32kb for the default block size
protected final OutputStream out;
private final int blockSize;
=====================================
src/main/resources/META-INF/native-image/org.xerial.snappy/snappy-java/resource-config.json
=====================================
@@ -3,7 +3,7 @@
"includes": [
{"pattern":".*libsnappyjava.dylib"},
{"pattern":".*libsnappyjava.so"},
- {"pattern":".*libsnappyjava.dll"},
+ {"pattern":".*snappyjava.dll"},
{"pattern":".*libsnappyjava.a"}
]
},
View it on GitLab: https://salsa.debian.org/java-team/snappy-java/-/compare/6ef7856d27e054a0d3681c871bafdd99db81bd6f...ac4d55b7911cdf28855087f542b7f21572b72ed3
--
View it on GitLab: https://salsa.debian.org/java-team/snappy-java/-/compare/6ef7856d27e054a0d3681c871bafdd99db81bd6f...ac4d55b7911cdf28855087f542b7f21572b72ed3
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20250808/b82f9ed4/attachment.htm>
More information about the pkg-java-commits
mailing list