Skip to content

Commit 3eb8bf7

Browse files
author
Isaac Brodsky
authored
pin dockcross version farther back (#98)
* pin dockcross version farther back * add tag to docker rmi * use docker system prune * system prune --force --all * Update changelog * fix h3.system.prune option name in tests.yml
1 parent 9b0fb8f commit 3eb8bf7

File tree

6 files changed

+87
-19
lines changed

6 files changed

+87
-19
lines changed

.github/workflows/tests.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
os: [ubuntu-latest]
1717
java-distribution: [adopt]
18-
java-version: [8, 11, 15]
18+
java-version: [8, 11, 15, 17]
1919

2020
steps:
2121
- uses: actions/[email protected]
@@ -40,7 +40,39 @@ jobs:
4040
run: mvn com.spotify.fmt:fmt-maven-plugin:check
4141

4242
- name: Tests
43-
run: mvn "-Dh3.remove.images=true" -B -V clean test site
43+
run: mvn "-Dh3.system.prune=true" -B -V clean test site
44+
45+
tests-new-dockcross:
46+
name: Dockcross ${{ matrix.dockcross-tag }} Java ${{ matrix.java-version }} ${{ matrix.os }}
47+
runs-on: ${{ matrix.os }}
48+
49+
strategy:
50+
matrix:
51+
os: [ubuntu-latest]
52+
java-distribution: [adopt]
53+
java-version: [17]
54+
dockcross-tag: ["20220528-e4627de"]
55+
56+
steps:
57+
- uses: actions/[email protected]
58+
with:
59+
submodules: recursive
60+
61+
- uses: actions/setup-java@v2
62+
with:
63+
distribution: "${{ matrix.java-distribution }}"
64+
java-version: "${{ matrix.java-version }}"
65+
66+
- uses: actions/cache@v2
67+
id: maven-cache
68+
with:
69+
path: ~/.m2/
70+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
71+
restore-keys: |
72+
${{ runner.os }}-maven-
73+
74+
- name: Tests
75+
run: mvn "-Dh3.system.prune=true" "-Dh3.dockcross.tag=${{ matrix.dockcross-tag }}" -B -V clean test
4476

4577
tests-no-docker:
4678
name: Java (No Docker) ${{ matrix.java-version }} ${{ matrix.os }}
@@ -51,7 +83,7 @@ jobs:
5183
# TODO: Docker on macos-latest running is not working
5284
os: [macos-latest, windows-latest]
5385
java-distribution: [adopt]
54-
java-version: [8, 11, 15]
86+
java-version: [8, 11, 15, 17]
5587

5688
steps:
5789
- uses: actions/[email protected]

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The public API of this library consists of the public functions declared in
66
file [H3Core.java](./src/main/java/com/uber/h3core/H3Core.java), and support
77
for the Linux x64 and Darwin x64 platforms.
88

9+
## [4.0.0-rc2] - Unreleased
10+
### Changed
11+
- Required version of glibc on Linux is 2.26. (#98)
12+
13+
### Removed
14+
- Removed support for Linux MIPS (#98)
15+
916
## [4.0.0-rc1] - 2022-03-29
1017
### Breaking Changes
1118
- Changed the API of `H3Core` to align it with the core library. (#91)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ H3-Java provides bindings to the H3 library, which is written in C. The built ar
5252

5353
| Operating System | Architectures
5454
| ---------------- | -------------
55-
| Linux | x64, x86, ARM64, ARMv5, ARMv7, MIPS, PPC64LE, s390x
55+
| Linux | x64, x86, ARM64, ARMv5, ARMv7, PPC64LE, s390x
5656
| Windows | x64, x86
5757
| Darwin (Mac OSX) | x64, ARM64
5858
| FreeBSD | x64

pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070

7171
<h3.git.remote>https://github.com/uber/h3.git</h3.git.remote>
7272
<h3.use.docker>true</h3.use.docker>
73-
<h3.remove.images>false</h3.remove.images>
73+
<h3.system.prune>false</h3.system.prune>
74+
<h3.dockcross.tag>20210624-de7b1b0</h3.dockcross.tag>
7475
<!-- Used for passing additional arguments to surefire when using JaCoCo -->
7576
<h3.additional.argLine />
7677

@@ -265,7 +266,8 @@
265266
<argument>${h3.git.remote}</argument>
266267
<argument>${h3.git.reference}</argument>
267268
<argument>${h3.use.docker}</argument>
268-
<argument>${h3.remove.images}</argument>
269+
<argument>${h3.system.prune}</argument>
270+
<argument>${h3.dockcross.tag}</argument>
269271
</arguments>
270272
</configuration>
271273
</execution>

src/main/c/h3-java/build-h3-docker.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,37 @@
1515
# limitations under the License.
1616
#
1717

18-
# Arguments: [build-root]
19-
# build-root - Location to build the library.
18+
# Arguments: [build-root] [upgrade-cmake]
19+
# build-root - Location to build the library.
20+
# upgrade-cmake - Whether to download and install a new version of CMake
21+
# cmake-root - Where to download and install the new version of CMake
2022
#
2123
# Builds H3 and H3-Java in the given directory. This is intended to be
2224
# called from build-h3.sh as part of the cross compilation process.
2325

2426
set -ex
2527

2628
BUILD_ROOT=$1
29+
UPGRADE_CMAKE=$2
30+
CMAKE_ROOT=$3
2731

28-
cd $BUILD_ROOT
32+
if $UPGRADE_CMAKE; then
33+
pushd "$CMAKE_ROOT"
34+
if ! [ -e cmake-3.23.2-linux-x86_64.sh ]; then
35+
wget -nv https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2-linux-x86_64.sh
36+
fi
37+
echo "5cca63af386e5bd0bde67c87ffac915865abd7dcc48073528f58645abda8f695 cmake-3.23.2-linux-x86_64.sh" > cmake-3.23.2-SHA-256.txt
38+
sha256sum -c cmake-3.23.2-SHA-256.txt
39+
if ! [ -e ./bin/cmake ]; then
40+
chmod a+x cmake-3.23.2-linux-x86_64.sh
41+
./cmake-3.23.2-linux-x86_64.sh --skip-license
42+
fi
43+
export PATH=$(pwd)/bin:$PATH
44+
cmake --version
45+
popd
46+
fi
47+
48+
cd "$BUILD_ROOT"
2949

3050
mkdir -p build
3151
pushd build

src/main/c/h3-java/build-h3.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
# git-ref - Specific git ref of H3 to build.
2222
# use-docker - "true" to perform cross compilation via Docker, "false" to
2323
# skip that step.
24-
# remove-images - If use-docker is true and this argument is true, Docker
25-
# cross compilation images will be removed after each step
24+
# system-prune - If use-docker is true and this argument is true, Docker
25+
# system prune will be run after each step
2626
# (i.e. for disk space constrained environments like CI)
27+
# dockcross-tag - Tag name for dockcross
2728
#
2829
# This script downloads H3, builds H3 and the H3-Java native library, and
2930
# cross compiles via Docker.
@@ -36,7 +37,8 @@ set -ex
3637
GIT_REMOTE=$1
3738
GIT_REVISION=$2
3839
USE_DOCKER=$3
39-
REMOVE_IMAGES=$4
40+
SYSTEM_PRUNE=$4
41+
DOCKCROSS_TAG=$5
4042

4143
echo Downloading H3 from "$GIT_REMOTE"
4244

@@ -156,21 +158,25 @@ if ! command -v docker; then
156158
exit 0
157159
fi
158160

159-
dockcross_tag="20211126-f096312"
161+
# Needed for older versions of dockcross
162+
UPGRADE_CMAKE=true
163+
CMAKE_ROOT=target/cmake-3.23.2-linux-x86_64
164+
mkdir -p $CMAKE_ROOT
160165

161166
# linux-armv6 excluded because of build failure
162-
for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux-mips linux-s390x \
167+
# linux-mips excluded due to manifest error
168+
for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux-s390x \
163169
linux-ppc64le linux-x64 linux-x86 windows-static-x64 windows-static-x86; do
164170

165171
# Setup for using dockcross
166172
BUILD_ROOT=target/h3-java-build-$image
167173
mkdir -p $BUILD_ROOT
168-
docker pull dockcross/$image:$dockcross_tag
169-
docker run --rm dockcross/$image:$dockcross_tag > $BUILD_ROOT/dockcross
174+
docker pull dockcross/$image:$DOCKCROSS_TAG
175+
docker run --rm dockcross/$image:$DOCKCROSS_TAG > $BUILD_ROOT/dockcross
170176
chmod +x $BUILD_ROOT/dockcross
171177

172178
# Perform the actual build inside Docker
173-
$BUILD_ROOT/dockcross --args "-v $JAVA_HOME:/java" src/main/c/h3-java/build-h3-docker.sh "$BUILD_ROOT"
179+
$BUILD_ROOT/dockcross --args "-v $JAVA_HOME:/java" src/main/c/h3-java/build-h3-docker.sh "$BUILD_ROOT" "$UPGRADE_CMAKE" "$CMAKE_ROOT"
174180

175181
# Copy the built artifact into the source tree so it can be included in the
176182
# built JAR.
@@ -186,8 +192,9 @@ for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux
186192
if [ -e $BUILD_ROOT/lib/libh3-java.dylib ]; then cp $BUILD_ROOT/lib/libh3-java.dylib $OUTPUT_ROOT ; fi
187193
if [ -e $BUILD_ROOT/lib/libh3-java.dll ]; then cp $BUILD_ROOT/lib/libh3-java.dll $OUTPUT_ROOT ; fi
188194

189-
if $REMOVE_IMAGES; then
190-
docker rmi dockcross/$image
195+
if $SYSTEM_PRUNE; then
196+
docker system prune --force --all
197+
docker system df
191198
rm $BUILD_ROOT/dockcross
192199
fi
193200
echo Current disk usage:

0 commit comments

Comments
 (0)