Skip to content

Repository files navigation

Darp.DLL.SerialPortStream.Native

Builds and packages the native libnserial library used by RJCP.SerialPortStream. The upstream repository is pinned to release/v3.0.5 as a Git submodule, so native builds are reproducible without copying its sources into this repository.

The NuGet package contains native assets for these runtime identifiers:

  • linux-x64
  • linux-arm64

Consume the package

Reference the managed and native packages together:

<ItemGroup>
  <PackageReference Include="RJCP.SerialPortStream" Version="3.0.5" />
  <PackageReference Include="Darp.DLL.SerialPortStream.Native" Version="3.0.5" />
</ItemGroup>

The package places a native binary named libnserial.so.1 in every runtime asset directory. That exact name is intentional: it matches the library name used by the managed P/Invoke declarations.

Build locally

Initialize the submodule and build for the current machine:

git submodule update --init --recursive
./scripts/build-native.ps1 -RuntimeId linux-x64

Then pack after all desired runtime directories exist below artifacts/native:

dotnet pack src/Darp.DLL.SerialPortStream.Native/Darp.DLL.SerialPortStream.Native.csproj `
  -c Release `
  -o artifacts/packages

The GitHub Actions workflow builds on native Linux x64 and arm64 runners, aggregates both binaries into one package, and tests that package on both architectures. The linked test fixture comes directly from the pinned upstream submodule; the small local support classes only replace upstream test-project dependencies that live in separate repositories.

Publish a package

Push a semantic version tag to build, test, pack, and publish that version to the rosslight GitHub Packages NuGet registry:

git tag v1.2.3
git push origin v1.2.3

The tag must match vMAJOR.MINOR.PATCH. The publishing workflow removes the leading v, passes the resulting version to the existing build workflow, and publishes only after the package tests pass on Linux x64 and arm64. It also uses GitHub's generated release notes to create a GitHub Release and attaches the .nupkg.

Updating upstream

Update the submodule deliberately and run the complete workflow:

git -C native/SerialPortStream fetch --tags
git -C native/SerialPortStream checkout <commit-or-tag>
git add native/SerialPortStream

If upstream changes its native ABI, update NativeLibraryVersion and the build script's expected output names together.

About

Native linux build for RJCP.DLL.SerialPortStream

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages