Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1d39683
Update nix inputs to nixpkgs 26.05 with the .NET 10 SDK and clang for…
neko-kai Oct 6, 2026
8ade08b
Move the C# tests to .NET 10 and update NuGet dependencies to their l…
neko-kai Oct 6, 2026
066684b
Migrate the Scala build to sbt 2.0.9 and Scala 3.9.0, add Scala Nativ…
neko-kai Oct 6, 2026
ad031d2
Publish NuGet packages via OIDC trusted publishing instead of a long-…
neko-kai Oct 6, 2026
f1b052c
Request the NuGet trusted publishing key on every event except pull r…
neko-kai Oct 6, 2026
7939e79
Accept only ByteArrayInputStream in the Scala Native incremental read…
neko-kai Oct 6, 2026
00a613d
Run testFull in the test-scala action because sbt 2 test skips cached…
neko-kai Oct 6, 2026
1b505ea
Stage test output outside the scanned tree and move it into place so …
neko-kai Oct 6, 2026
e86c654
Run the traversal benchmark once on Scala Native as on JS instead of …
neko-kai Oct 6, 2026
932256d
Read files into memory in IncrementalEBAReader.openFile on Scala Nati…
neko-kai Oct 6, 2026
b594377
Read each file once in the cross-platform incremental read test so a …
neko-kai Oct 6, 2026
aef32d4
Link Scala Native without multithreading, whose runtime crashed the t…
neko-kai Oct 6, 2026
f36131e
Classify exact decimals as Float by their shortest round-tripping dec…
neko-kai Oct 6, 2026
ae5bbff
Decode Float entries to their shortest decimal on every platform inst…
neko-kai Oct 6, 2026
062182f
Revert "Decode Float entries to their shortest decimal on every platf…
neko-kai Oct 7, 2026
533d051
Revert "Classify exact decimals as Float by their shortest round-trip…
neko-kai Oct 7, 2026
3be8e49
Provide which in the dev shell; Scala Native locates clang with it an…
neko-kai Oct 7, 2026
483bdb3
Revert newtonsoft to 13.0.1
neko-kai Oct 7, 2026
022c1ea
Drop the Microsoft.SourceLink.GitHub reference; the .NET SDK has incl…
neko-kai Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ jobs:
- uses: 7mind/github-env@minimal
with:
cache-scala: false
- uses: bitwarden/sm-action@v2
- name: NuGet login (OIDC trusted publishing)
id: nuget-login
if: github.event_name != 'pull_request'
uses: NuGet/login@v1
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
637c5cad-a680-4ea3-ac8b-b193010bee40 > TOKEN_NUGET
user: ${{ vars.NUGET_USER }}
- name: Build and Test
env:
TOKEN_NUGET: ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
run: nix develop --command mdl --github-actions :publish-cs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
output/
output-staging/
.DS_Store
.metals
.vscode
Expand Down
10 changes: 5 additions & 5 deletions .mdl/defs/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ set -euo pipefail
SCALA_DIR="${sys.project-root}/json-sick-scala"
cd "$SCALA_DIR"

sbt +clean +test:compile +test
sbt --server -batch +clean +Test/compile +testFull

ret success:bool=true
```
Expand Down Expand Up @@ -104,10 +104,10 @@ fi
cd "$SCALA_DIR"

if [[ "$CI_BRANCH_TAG_VAL" =~ ^v.*$ ]]; then
sbt +clean +compile +publishSigned sonaUpload sonaRelease
sbt '++2.13 json-sickJS/fullOptJS'
sbt --server -batch +clean +compile +publishSigned sonaUpload sonaRelease
sbt --server -batch '++ 2.13 json-sickJS/fullOptJS'
else
sbt +clean +compile +publishSigned
sbt --server -batch +clean +compile +publishSigned
fi

ret success:bool=true
Expand All @@ -131,7 +131,7 @@ if [[ "$CI_PULL_REQUEST_VAL" != "false" ]]; then
fi

cd "$SCALA_DIR"
sbt '++2.13 json-sickJS/fullOptJS'
sbt --server -batch '++ 2.13 json-sickJS/fullOptJS'

ret dist-dir:directory="$DIST_DIR"
```
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "SICK build environment";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/25.11";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/26.05";

inputs.flake-utils.url = "github:numtide/flake-utils";

Expand All @@ -20,14 +20,17 @@
ncurses
graalvmPackages.graalvm-ce
sbt
dotnet-sdk_9
dotnet-sdk_10
nodejs_24

gitMinimal

openssl

scala-cli

clang
which
] ++ [
mudyla.packages.${system}.default
];
Expand Down
12 changes: 6 additions & 6 deletions json-sick-csharp/SickSharp.Test/SickSharp.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<!-- <LangVersion>9</LangVersion>-->
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -10,11 +10,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageReference Include="NUnit" Version="5.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.3.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.15.0" />
<PackageReference Include="coverlet.collector" Version="10.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions json-sick-csharp/SickSharp.Test/SickTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace SickSharp.Test;
public class SickTests
{
private const string PathOut = "../../../../../output";
private const string PathOutCs = "../../../../../output/cs";
private const string PathInput = "../../../../../samples";
private const string RootName = "sample.json";
private const uint iters = 100_000;
Expand All @@ -19,21 +20,21 @@ public class SickTests
[SetUp]
public void Setup()
{
Directory.CreateDirectory(PathOut);
Directory.CreateDirectory(PathOutCs);
_files = Directory.EnumerateFiles(PathInput, "*.json", SearchOption.AllDirectories).ToList();

foreach (var file in _files)
{
var fi = new FileInfo(file);
var name = Path.GetFileNameWithoutExtension(fi.Name);
DoWrite(file, Path.Combine(PathOut, $"{name}-CS.bin"));
DoWrite(file, Path.Combine(PathOutCs, $"{name}-CS.bin"));
}
}

[Test]
public void Test1_Queries()
{
var input = Path.Join(PathOut, "petstore-with-external-docs-CS.bin");
var input = Path.Join(PathOutCs, "petstore-with-external-docs-CS.bin");

using (var reader = SickReader.OpenFile(input, ISickCacheManager.NoCache, ISickProfiler.Noop(),
loadInMemoryThreshold: 32768))
Expand All @@ -60,7 +61,7 @@ public void Test1_Queries()
[Test]
public void Test_Query_Benchmark()
{
var input = Path.Join(PathOut, "petstore-with-external-docs-CS.bin");
var input = Path.Join(PathOutCs, "petstore-with-external-docs-CS.bin");

using (var reader = SickReader.OpenFile(input, ISickCacheManager.NoCache, ISickProfiler.Noop(), loadInMemoryThreshold: 0))
{
Expand Down Expand Up @@ -196,7 +197,7 @@ public int Traverse(SickCursor cursor, int count, short limit)
[Test]
public void Test2_Read()
{
var inputs = Directory.EnumerateFiles(PathOut, "*.bin", SearchOption.TopDirectoryOnly).ToList();
var inputs = Directory.EnumerateFiles(PathOut, "*.bin", SearchOption.AllDirectories).ToList();
inputs.Sort();

Assert.IsNotNull(inputs.Find(x => x.Contains("-CS")), "No file containing `-CS` found!");
Expand Down
1 change: 0 additions & 1 deletion json-sick-csharp/SickSharp/SickSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<None Include="$(SolutionDir)/../README.md" Pack="true" PackagePath="\" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion json-sick-csharp/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.0",
"version": "10.0.100",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down
62 changes: 37 additions & 25 deletions json-sick-scala/build.sbt
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
import com.github.sbt.git.SbtGit.GitKeys
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}

val circeVersion = "0.14.13"
val scalatestVersion = "3.2.19"
val zstdVersion = "1.5.7-4"
def sharedSourceDirs(sharedDirName: String) = Seq(
Compile / unmanagedSourceDirectories += baseDirectory.value.getParentFile / sharedDirName / "src" / "main" / "scala",
Test / unmanagedSourceDirectories += baseDirectory.value.getParentFile / sharedDirName / "src" / "test" / "scala",
)

val circeVersion = "0.14.17"
val scalatestVersion = "3.2.20"
val zstdVersion = "1.5.7-21"
val nodeTypesVersion = "18.11.9"
// Can't convert latest node due to error: `not found: type TReturn`
// val nodeTypesVersion = "24.3.1"

lazy val `json-sick` = crossProject(JVMPlatform, JSPlatform)
lazy val `json-sick` = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("json-sick"))
.settings(
name := "json-sick",
crossScalaVersions := Seq(
"3.3.6",
"2.13.16",
"3.9.0",
"2.13.18",
),
scalaVersion := crossScalaVersions.value.head,
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-jawn" % circeVersion,
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-jawn" % circeVersion,
),
libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion % Test,
libraryDependencies += "org.scalatest" %% "scalatest" % scalatestVersion % Test,
scalacOptions ++= {
val s = scalaVersion.value
if (s.startsWith("2")) {
Seq(
"-Xsource:3-cross",
"-release:8",
"-release:17",
"-explaintypes",
"-Wconf:cat=optimizer:warning",
"-Wconf:cat=other-match-analysis:error",
Expand All @@ -47,7 +52,8 @@ lazy val `json-sick` = crossProject(JVMPlatform, JSPlatform)
)
} else {
Seq(
"-language:3.3",
"-release:17",
"-Ximport-suggestion-timeout:0",
"-no-indent",
"-explain",
"-explain-types",
Expand All @@ -58,19 +64,29 @@ lazy val `json-sick` = crossProject(JVMPlatform, JSPlatform)
.jvmSettings(
libraryDependencies += "com.github.luben" % "zstd-jni" % zstdVersion % Test
)
.jvmSettings(sharedSourceDirs("jvm-native"))
.nativeSettings(sharedSourceDirs("jvm-native"))
.nativeSettings(
nativeConfig ~= (_.withMultithreading(false)),
libraryDependencySchemes += "org.scala-native" % s"test-interface_native${scalanative.sbtplugin.ScalaNativeCrossVersion.currentBinaryVersion}_${scalaBinaryVersion.value}" % VersionScheme.Always
)
.jvmSettings(sharedSourceDirs("jvm-js"))
.jsSettings(sharedSourceDirs("jvm-js"))
.jsSettings(sharedSourceDirs("js-native"))
.nativeSettings(sharedSourceDirs("js-native"))
.jsSettings(
// sourced from https://github.com/ScalablyTyped/Demos/blob/558213f6e21e6afbc6f015e06d053038f3a4e66f/build.sbt#L325
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv,
jsEnv := Def.uncached(new org.scalajs.jsenv.nodejs.NodeJSEnv),
// stStdlib := List("esnext"),
// stUseScalaJsDom := false,
// Test / npmDependencies ++= Seq(
// // Using manual bindings to avoid CI errors caused by ScalablyTyped. Uncomment "@types/node" and sbt-converter and ScalablyTypedConverterPlugin and its options to use generated bindings.
// "@types/node" -> nodeTypesVersion
// ),
libraryDependencies += "io.circe" %%% "circe-scalajs" % circeVersion,
libraryDependencies += "io.circe" %% "circe-scalajs" % circeVersion,
Compile / fullOptJS / artifactPath := {
def outerRef = ProjectRef(file("."), "json-sick-scala")
(outerRef / target).value / "dist" / s"${moduleName.value}-${scalaBinaryVersion.value}-fullOpt.js"
val output = (LocalRootProject / baseDirectory).value / "target" / "dist" / s"${moduleName.value}-${scalaBinaryVersion.value}-fullOpt.js"
fileConverter.value.toVirtualFile(output.toPath)
},
scalaJSLinkerConfig := {
scalaJSLinkerConfig.value
Expand Down Expand Up @@ -121,15 +137,10 @@ lazy val `json-sick` = crossProject(JVMPlatform, JSPlatform)
""".stripMargin)
},
)
.jsConfigure(
project =>
project
.enablePlugins(ScalaJSBundlerPlugin)
// .enablePlugins(ScalablyTypedConverterPlugin)
)

lazy val `json-sickJVM` = `json-sick`.jvm
lazy val `json-sickJS` = `json-sick`.js
lazy val `json-sickNative` = `json-sick`.native

ThisBuild / scalacOptions ++= Seq(
"-encoding",
Expand Down Expand Up @@ -181,21 +192,21 @@ ThisBuild / credentials ++= Seq(
.filter(_.exists())
.map(Credentials.apply)

ThisBuild / homepage := Some(url("https://github.com/7mind/sick"))
ThisBuild / homepage := Some(uri("https://github.com/7mind/sick"))
ThisBuild / licenses := Seq(
"BSD-style" -> url("http://www.opensource.org/licenses/bsd-license.php")
"BSD-style" -> uri("http://www.opensource.org/licenses/bsd-license.php")
)
ThisBuild / developers := List(
Developer(
id = "7mind",
name = "Septimal Mind",
url = url("https://github.com/7mind"),
url = uri("https://github.com/7mind"),
email = "team@7mind.io",
)
)
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/7mind/sick"),
uri("https://github.com/7mind/sick"),
"scm:git:https://github.com/7mind/sick.git",
)
)
Expand All @@ -209,4 +220,5 @@ lazy val `json-sick-scala` = project
.aggregate(
`json-sickJVM`,
`json-sickJS`,
`json-sickNative`,
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ object manualNodeBindings {
def readdirSync(path: String): js.Array[String] = js.native
def writeFileSync(path: String, array: Uint8Array): Unit = js.native
def unlinkSync(path: String): Unit = js.native
def renameSync(oldPath: String, newPath: String): Unit = js.native
def mkdirSync(path: String, options: js.Object): js.UndefOr[String] = js.native

def readFileSync(path: String): Buffer = js.native
Expand Down Expand Up @@ -76,6 +77,10 @@ abstract class FileOpsPlatformSpecific extends FileOps {
Fs.writeFileSync(path, bytesToUint8Array(bytes))
}

override def move(source: String, target: String): Unit = {
Fs.renameSync(source, target)
}

override def delete(path: String): Unit = {
Fs.unlinkSync(path)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ package io.izumi

package object sick {
final val isJs: true = true
final val outputMarker: String = "SCALA-JS"
final val outputDirName: String = "scala-js"
final val traverseIterations: Int = 1
}
Loading
Loading