Skip to content

Commit a794389

Browse files
authored
Upgrade to snappy-1.1.9 (#379)
* Upgrade to snappy-1.1.9 * Add sbt-dynver * Fix script so as not to requrie perl * Upgrade bitshuffle to 0.5.1 * use bitshuffle 0.3.4, which can be compiled without errors * Add native library build workflow
1 parent ef87735 commit a794389

File tree

9 files changed

+70
-7
lines changed

9 files changed

+70
-7
lines changed

.github/workflows/build-native.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Native
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Build native libraries
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Build native libraries
12+
run: make clean-native native-all
13+
env:
14+
OCI_EXE: docker
15+
- name: Upload native libraries
16+
uses: actions/upload-artifact@v3
17+
with:
18+
name: native-libs
19+
path: src/main/resources/org/xerial/snappy/native/
20+
push:
21+
name: Push new native libraries to branch
22+
runs-on: ubuntu-latest
23+
needs: [check, build]
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: Download native libraries
27+
uses: actions/download-artifact@v3
28+
with:
29+
name: native-libs
30+
path: src/main/resources/org/xerial/snappy/native/
31+
- run: git status
32+
- name: Commit and push
33+
uses: EndBug/add-and-commit@v9
34+
with:
35+
message: 'Update native libraries'
36+
default_author: github_actions

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ NATIVE_DIR:=src/main/resources/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
140140
NATIVE_TARGET_DIR:=$(TARGET)/classes/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
141141
NATIVE_DLL:=$(NATIVE_DIR)/$(LIBNAME)
142142

143-
snappy-jar-version:=snappy-java-$(shell perl -npe "s/version in ThisBuild\s+:=\s+\"(.*)\"/\1/" version.sbt | sed -e "/^$$/d")
143+
snappy-jar-version:=snappy-java-$(shell cat version.sbt | cut -d'=' -f2 | sed 's/[ \"]//g')
144144

145145
native: jni-header snappy-header $(NATIVE_DLL)
146146
native-nocmake: jni-header $(NATIVE_DLL)
@@ -175,7 +175,7 @@ mac32: jni-header
175175
$(MAKE) native OS_NAME=Mac OS_ARCH=x86
176176

177177
mac64: jni-header
178-
docker run -it $(DOCKER_RUN_OPTS) -v $$PWD:/workdir -e CROSS_TRIPLE=x86_64-apple-darwin xerial/crossbuild make clean-native native OS_NAME=Mac OS_ARCH=x86_64
178+
docker run -it $(DOCKER_RUN_OPTS) -v $$PWD:/workdir -e CROSS_TRIPLE=x86_64-apple-darwin multiarch/crossbuild make clean-native native OS_NAME=Mac OS_ARCH=x86_64
179179

180180
linux32: jni-header
181181
docker run $(DOCKER_RUN_OPTS) -ti -v $$PWD:/work xerial/centos5-linux-x86_64-pic bash -c 'make clean-native native-nocmake OS_NAME=Linux OS_ARCH=x86'

Makefile.common

+7-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ OS_ARCH := $(shell $(JAVA) -cp lib $(OSINFO_CLASS) --arch)
2626
LIB_FOLDER := $(shell $(JAVA) -cp lib $(OSINFO_CLASS))
2727
IBM_JDK_LIB := lib/inc_ibm
2828

29-
ENDIANESS=$(shell lscpu | grep "Byte Order" |cut -d ":" -f2)
29+
ifeq ($(OS_NAME),Mac)
30+
ENDIANESS:="Little Endian"
31+
else
32+
ENDIANESS:=$(shell lscpu | grep "Byte Order" |cut -d ":" -f2)
33+
endif
34+
3035
# Windows uses different path separators
3136
ifeq ($(OS_NAME),Windows)
3237
sep := ;
@@ -218,7 +223,7 @@ Linux-armv6_SNAPPY_FLAGS:=
218223
Linux-armv7_CXX := $(CROSS_PREFIX)g++
219224
Linux-armv7_STRIP := $(CROSS_PREFIX)strip
220225
Linux-armv7_CXXFLAGS := -Ilib/inc_linux -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden -mfloat-abi=hard -std=c++11
221-
Linux-armv7_LINKFLAGS := -shared -static-libgcc
226+
Linux-armv7_LINKFLAGS := -shared -static-libgcc
222227
Linux-armv7_LIBNAME := libsnappyjava.so
223228
Linux-armv7_SNAPPY_FLAGS:=
224229

project/plugins.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.17")
33
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
44
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.6")
55
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
6+
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")

script/dynver.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
# Compute sbt-dynver-compatible version number
4+
BUILD_TIME=`date '+%Y%m%d-%H%M'`
5+
DYN_VER=`git describe --long --tags --abbrev=8 --match "v[0-9]*" --always --dirty="-${BUILD_TIME}"`
6+
GIT_DIST=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\2/g"`
7+
GIT_TAG=`git describe --tags --dirty`
8+
RELEASE_VERSION=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\1/g"`
9+
SNAPSHOT_VERSION=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\1-\2-\3/g"`-SNAPSHOT
10+
11+
if [ ${GIT_DIST} -eq 0 ]; then
12+
if [ ${GIT_TAG} == *"-dirty" ]; then
13+
VERSION=${SNAPSHOT_VERSION}
14+
else
15+
VERSION=${RELEASE_VERSION}
16+
fi
17+
else
18+
VERSION=${SNAPSHOT_VERSION}
19+
fi
20+
21+
echo ${VERSION}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
SNAPPY_VERSION=1.1.8
2-
BITSHUFFLE_VERSION=0.3.2
1+
SNAPPY_VERSION=1.1.9
2+
BITSHUFFLE_VERSION=0.3.4
Binary file not shown.
Binary file not shown.

version.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ThisBuild / version := "1.1.8.5-SNAPSHOT"
1+
ThisBuild / version := "1.1.9.0-SNAPSHOT"

0 commit comments

Comments
 (0)