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
This commit is contained in:
Taro L. Saito 2023-01-27 22:33:12 -08:00 committed by GitHub
parent ef87735ee9
commit a794389cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 7 deletions

36
.github/workflows/build-native.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Build Native
on:
workflow_dispatch:
jobs:
build:
name: Build native libraries
runs-on: ubuntu-latest
steps:
- name: Build native libraries
run: make clean-native native-all
env:
OCI_EXE: docker
- name: Upload native libraries
uses: actions/upload-artifact@v3
with:
name: native-libs
path: src/main/resources/org/xerial/snappy/native/
push:
name: Push new native libraries to branch
runs-on: ubuntu-latest
needs: [check, build]
steps:
- uses: actions/checkout@v3
- name: Download native libraries
uses: actions/download-artifact@v3
with:
name: native-libs
path: src/main/resources/org/xerial/snappy/native/
- run: git status
- name: Commit and push
uses: EndBug/add-and-commit@v9
with:
message: 'Update native libraries'
default_author: github_actions

View File

@ -140,7 +140,7 @@ NATIVE_DIR:=src/main/resources/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
NATIVE_TARGET_DIR:=$(TARGET)/classes/org/xerial/snappy/native/$(OS_NAME)/$(OS_ARCH)
NATIVE_DLL:=$(NATIVE_DIR)/$(LIBNAME)
snappy-jar-version:=snappy-java-$(shell perl -npe "s/version in ThisBuild\s+:=\s+\"(.*)\"/\1/" version.sbt | sed -e "/^$$/d")
snappy-jar-version:=snappy-java-$(shell cat version.sbt | cut -d'=' -f2 | sed 's/[ \"]//g')
native: jni-header snappy-header $(NATIVE_DLL)
native-nocmake: jni-header $(NATIVE_DLL)
@ -175,7 +175,7 @@ mac32: jni-header
$(MAKE) native OS_NAME=Mac OS_ARCH=x86
mac64: jni-header
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
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
linux32: jni-header
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'

View File

@ -26,7 +26,12 @@ OS_ARCH := $(shell $(JAVA) -cp lib $(OSINFO_CLASS) --arch)
LIB_FOLDER := $(shell $(JAVA) -cp lib $(OSINFO_CLASS))
IBM_JDK_LIB := lib/inc_ibm
ENDIANESS=$(shell lscpu | grep "Byte Order" |cut -d ":" -f2)
ifeq ($(OS_NAME),Mac)
ENDIANESS:="Little Endian"
else
ENDIANESS:=$(shell lscpu | grep "Byte Order" |cut -d ":" -f2)
endif
# Windows uses different path separators
ifeq ($(OS_NAME),Windows)
sep := ;

View File

@ -3,3 +3,4 @@ addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.17")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.6")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")

21
script/dynver.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# Compute sbt-dynver-compatible version number
BUILD_TIME=`date '+%Y%m%d-%H%M'`
DYN_VER=`git describe --long --tags --abbrev=8 --match "v[0-9]*" --always --dirty="-${BUILD_TIME}"`
GIT_DIST=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\2/g"`
GIT_TAG=`git describe --tags --dirty`
RELEASE_VERSION=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\1/g"`
SNAPSHOT_VERSION=`echo ${DYN_VER} | sed -re "s/v([^-]*)-([0-9]+)-g(.*)/\1-\2-\3/g"`-SNAPSHOT
if [ ${GIT_DIST} -eq 0 ]; then
if [ ${GIT_TAG} == *"-dirty" ]; then
VERSION=${SNAPSHOT_VERSION}
else
VERSION=${RELEASE_VERSION}
fi
else
VERSION=${SNAPSHOT_VERSION}
fi
echo ${VERSION}

View File

@ -1,2 +1,2 @@
SNAPPY_VERSION=1.1.8
BITSHUFFLE_VERSION=0.3.2
SNAPPY_VERSION=1.1.9
BITSHUFFLE_VERSION=0.3.4

View File

@ -1 +1 @@
ThisBuild / version := "1.1.8.5-SNAPSHOT"
ThisBuild / version := "1.1.9.0-SNAPSHOT"