Skip to content

Releases: caffeine-mgn/klua

klua 0.2.1

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 30 Sep 12:28

klua 0.2.1

Build/CI release: the whole publication now happens on a macOS host, so a single
Maven Central deployment carries every target.

Distribution

  • All published Kotlin/Native targets in one deployment: linuxx64, linuxarm64, mingwx64, macosarm64, androidnativearm64, androidnativex64, plus the klua-android AAR and the JVM jar.
  • pw.binom:klua-macosarm64 is new. The Apple target is now macosArm64; macosx64 was removed (deprecated upstream in Kotlin 2.3.20 and never actually published, even though the root module advertised it — macOS consumers got a broken resolution instead of a clear "unsupported").
  • klua-jvm now really bundles all four host natives: libklua.so for Linux x86_64/AArch64, libklua.dll (MinGW x86_64) and libklua.dylib (macOS Apple silicon). The Windows and macOS libraries were silently missing before, so desktop JVM on those platforms failed at load time.

Fixes

  • Windows JNI build: the MinGW sysroot shipped with Kotlin/Native has no clock_gettime, so the limits core uses QueryPerformanceCounter under _WIN32. The Windows library had never actually been built before, because the cross target silently no-op'ed without the platform's jni_md.h.
  • The Android AAR ABI gate now also runs on the macOS host (GNU readelf does not exist there; greadelf/llvm-readelf is resolved instead).
  • -Pversion= now overrides the tag-derived version, so the release graph can be dry-run without publishing.

CI

  • A separate Ubuntu job runs jvmTest and linuxX64Test (a Linux test binary cannot run on macOS, and Apple targets cannot be built on Linux); the macOS job runs jvmTest + macosArm64Test, builds and gates the AAR, then publishes.
  • The JVM jar payload and the AAR ABI (bionic, not glibc) are asserted before publishing.

No changes to the Lua API in this release.

klua 0.2.0

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 29 Sep 07:33

klua 0.2.0

Android support and a proper sandbox for untrusted Lua.

Android

  • New artifact pw.binom:klua-android — a com.android.library AAR (minSdk 24) that ships prebuilt libklua.so for arm64-v8a and x86_64 and loads it via System.loadLibrary("klua"). 32-bit ABIs are not packaged.
  • New Kotlin/Native targets androidNativeArm64 / androidNativeX64 (removed androidNativeArm32 / androidNativeX86).
  • The JNI Kotlin now lives in a shared jvmSharedMain source set used by both jvmMain (desktop jar loader) and androidMain; the platform seam is expect fun loadNativeLibrary().

Sandboxing

  • LuaEngine(libraries: Set<LuaLibrary> = emptySet(), ...) — per-library standard-library selection (LuaLibrary.ALL, LuaLibrary.SAFE). A fresh engine is still bare (no os/io/package/debug).
  • Binary chunks are rejected by default (allowBinaryChunks = false): eval compiles text-only and the same restriction is applied to Lua's load / loadstring / loadfile / dofile.
  • Execution limits (LuaLimits(maxInstructions, timeout, maxMemoryBytes)): instruction cap, wall-clock deadline and memory cap, enforced by a shared C core (custom lua_Alloc + LUA_MASKCOUNT hook) used by both the JNI and Kotlin/Native backends. Violations throw LuaLimitException(kind); pcall cannot swallow them.
  • LuaEngine.cancel() cooperatively aborts a long-running eval from another thread (LuaLimitKind.CANCELLED).

Fixes / build

  • Replaced java.lang.ref.Cleaner (API 33+) with a PhantomReference-based cleaner plus deferred, owner-thread unref, fixing a cross-thread race and keeping minSdk 24.
  • Untracked build/ and .gradle/ outputs.
  • CI: release workflow now installs the Android SDK, packages the AAR, runs a bionic/glibc ABI gate (readelf), and checks that build outputs are not tracked.

Tests

  • jvmTest 61/61, linuxX64Test 50/50 (library selection, binary-chunk rejection, execution limits).

klua 0.1.7

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 20 Sep 13:02

kn-clang 0.0.5 → 0.0.7.

klua 0.1.6 — CI/CD to Maven Central

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 20 Sep 11:27

CI/CD: tag-triggered Maven Central publish

Adds the publishing infrastructure that was previously wired only for a self-hosted macOS ARM runner.

Build changes

  • Plugin chain swap. maven-publish + pw.binom.publish.PrepareProject → com.vanniktech.maven.publish + org.jetbrains.dokka, both pinned in the new gradle/libs.versions.toml catalog.
  • mavenPublishing { publishToMavenCentral(automaticRelease = true); signAllPublications(); coordinates(pw.binom:klua:<tag>) } replaces the old in-house POM/scm/license blocks.
  • Signing toggle. signingUseGpg=true (CI) switches the signing extension to useGpgCmd(); locally it falls back to in-memory PGP keys from signingInMemoryKey{,Id,Password,IsBase64} (or the legacy binom.gpg.* properties).
  • Source-set wiring. The dead pw.binom.publish.dependsOn(mask, to) helper (from the removed binom-publish plugin) is replaced with a standard sourceSets.matching { ... }.configureEach { dependsOn(...) } block — same semantics for the linux/androidNative/mingw/macos POSIX family.
  • buildSrc cleanup. Dropped pw.binom:binom-publish:0.1.23, org.jetbrains.dokka:dokka-gradle-plugin:1.9.20, and the now-orphaned pw.binom.plugins.HttpServerTask + io.vertx:vertx-web:4.2.1.

Workflow

  • New .github/workflows/release.yml (tag-triggered on N.N.N*).
  • ubuntu-latest + Temurin OpenJDK 21 (Liberica 21.0.6 trips getgeneric under this project's JNI binding, see project memory).
  • Installs gcc g++ clang mingw-w64, imports the GPG key via printf '%b' + pinentry-mode loopback.
  • Pre-publish test gate: jvmTest linuxX64Test must stay green. Pre-chained with downloadKonanToolchainLinux_arm64, downloadKonanToolchainMingw_x64 so the cross-target JVM host libs have toolchains. The KGP 2.4.20 downloadKonan task itself is skipped (-x downloadKonan) because it hardcodes the legacy asset name; the workflow pre-fetches the correct kotlin-native-prebuilt-linux-x86_64-2.4.20.tar.gz from GitHub releases and unpacks it into ~/.konan/ before gradle runs.
  • publishToMavenCentral is invoked with -PsigningUseGpg=true -Psigning.gnupg.{keyName,passphrase}=… -PmavenCentralUsername=… -PmavenCentralPassword=…. Uses the new Central Portal API (central.sonatype.com), not the legacy s01 staging URL.
  • Old .github/workflows/publish.yml (self-hosted semeru JDK 17) removed.
  • .gitignore now covers build/, .gradle/, buildSrc/{build,.gradle}/, .kotlin/, .idea/, .veai/.

Verified locally

  • ./gradlew help — plugins load clean.
  • ./gradlew tasks --group=publishing — publishToMavenCentral, per-target publishJvmPublicationToMavenCentralRepository / publishLinuxX64PublicationToMavenCentralRepository / publishLinuxArm64… / publishMingwX64… / publishAndroidNative{32,64,X86,X64}…, plus sign*Publication tasks are registered.
  • ./gradlew jvmTest — 44/44 pass.
  • ./gradlew linuxX64Test — 35/35 pass.

0.1.5

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 18 Dec 22:30
Added support of List/Array

0.1.4

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 08 Dec 21:00

Add support Lua List/Array

0.1.3

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 02 Dec 23:11
Added method for force close LuaEngine

0.1.2

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 01 Dec 11:12
Update kotlin to 2.0.21

0.1.1

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 24 Jun 21:26
Kotlin version update

0.1.0

Choose a tag to compare

@caffeine-mgn caffeine-mgn released this 08 May 13:09
2493d14
refactoring