Skip to content

Commit e8bff0e

Browse files
authored
Merge pull request #80 from eed3si9n/bport/actions
[1.x] backport CI changes + fix
2 parents a35ee84 + 1b6a79e commit e8bff0e

7 files changed

Lines changed: 30 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ jobs:
77
fail-fast: false
88
matrix:
99
include:
10-
- os: ubuntu-20.04
10+
# Changing this will change glibc
11+
- os: ubuntu-22.04
1112
java: 8
1213
jobtype: 1
13-
- os: macos-12
14+
- os: ubuntu-24.04
15+
java: 25
16+
jobtype: 2
17+
- os: macos-15-intel
1418
java: 8
1519
jobtype: 1
16-
- os: macos-14
20+
- os: macos-15
1721
java: 8
1822
jobtype: 1
23+
- os: macos-15
24+
java: 25
25+
jobtype: 1
1926
- os: windows-latest
2027
java: 8
2128
jobtype: 1
@@ -25,17 +32,17 @@ jobs:
2532
JVM_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
2633
steps:
2734
- name: Checkout
28-
uses: actions/checkout@v4
35+
uses: actions/checkout@v6
2936
- name: Setup JDK
30-
uses: actions/setup-java@v4
37+
uses: actions/setup-java@v5
3138
with:
3239
distribution: zulu
3340
java-version: "${{ matrix.java }}"
3441
cache: sbt
3542
- uses: sbt/setup-sbt@v1
3643
- name: Set up MinGW
3744
if: ${{ runner.os == 'Linux' }}
38-
uses: egor-tensin/setup-mingw@v2
45+
uses: egor-tensin/setup-mingw@v3
3946
with:
4047
platform: x64
4148
- name: Set up gcc-aarch64-linux-gnu
@@ -56,17 +63,17 @@ jobs:
5663
shell: bash
5764
run: sbt "buildNativeArtifacts; test"
5865
- name: Archive native artifacts (Linux)
59-
if: ${{ runner.os == 'Linux' }}
60-
uses: actions/upload-artifact@v4
66+
if: ${{ runner.os == 'Linux' && matrix.jobtype == '1' }}
67+
uses: actions/upload-artifact@v7
6168
with:
6269
name: dist-${{ runner.os }}
6370
path: |
6471
src/main/resources/linux/x86_64/libsbtipcsocket.so
6572
src/main/resources/linux/aarch64/libsbtipcsocket.so
6673
src/main/resources/win32/x86_64/sbtipcsocket.dll
6774
- name: Archive native artifacts (macOS)
68-
if: ${{ matrix.os == 'macos-12' }}
69-
uses: actions/upload-artifact@v4
75+
if: ${{ matrix.os == 'macos-15-intel' }}
76+
uses: actions/upload-artifact@v7
7077
with:
7178
name: dist-${{ runner.os }}
7279
path: src/main/resources/darwin/x86_64/libsbtipcsocket.dylib

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
# Metals
1414
.metals
15-
15+
metals.sbt

build.sbt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ inThisBuild(
6161
),
6262
isSnapshot := (isSnapshot or version(_ endsWith "-SNAPSHOT")).value,
6363
description := "IPC: Unix Domain Socket and Windows Named Pipes for Java",
64-
licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
64+
licenses := Seq(License.Apache2),
6565
publishTo := {
66-
val nexus = "https://oss.sonatype.org/"
67-
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
68-
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
66+
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
67+
val v = (ThisBuild / version).value
68+
if (v.endsWith("SNAPSHOT")) Some("central-snapshots" at centralSnapshots)
69+
else localStaging.value
6970
},
7071
nativeArch := "x86_64",
7172
nativeCompiler := "gcc",

jni/org_scalasbt_ipcsocket_JNIUnixDomainSocketLibraryProvider.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ Java_org_scalasbt_ipcsocket_JNIUnixDomainSocketLibraryProvider_readNative(
8989
errno = 0;
9090
jbyte *bytes = malloc(len);
9191
int bytes_read = read(fd, bytes, len);
92-
(*env)->SetByteArrayRegion(env, buffer, offset, bytes_read, bytes);
92+
if (bytes_read > 0) {
93+
(*env)->SetByteArrayRegion(env, buffer, offset, bytes_read, bytes);
94+
}
9395
free(bytes);
9496
THROW_ON_ERROR(bytes_read);
9597
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.1
1+
sbt.version=1.11.7

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
2-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
1+
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.1")
2+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
33
addSbtPlugin("com.swoval" % "sbt-source-format" % "0.3.1")

src/main/java/org/scalasbt/ipcsocket/UnixDomainSocket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private class UnixDomainSocketInputStream extends InputStream {
122122
public int read() throws IOException {
123123
byte[] buf = new byte[1];
124124
int result;
125-
if (doRead(buf, 0, 1) == 0) {
125+
if (doRead(buf, 0, 1) <= 0) {
126126
result = -1;
127127
} else {
128128
// Make sure to & with 0xFF to avoid sign extension

0 commit comments

Comments
 (0)