Skip to content

Studio: Consume prebuilt cross-platform natives, ship one net6.0 package STUD-80766#30

Merged
andrei-balint merged 12 commits into
developfrom
feature/ab/pipeline
Jul 7, 2026
Merged

Studio: Consume prebuilt cross-platform natives, ship one net6.0 package STUD-80766#30
andrei-balint merged 12 commits into
developfrom
feature/ab/pipeline

Conversation

@andrei-balint

Copy link
Copy Markdown

Reworks the managed LibGit2Sharp.UiPath package to consume the prebuilt, multi-RID native
binaries produced by the libgit2sharp.nativebinaries pipeline — fetched and SHA256-verified from
natives.lock.json (pinned to natives-1.9.1-v7) — instead of the old NativeBinaries.UiPath
PackageReference. One NuGet, all platforms.

  • Cross-platform net6.0. Retargeted off net6.0-windows via a single NetCoreVersion property in
    Directory.Build.props, so the package is consumable by net6.0/7.0/8.0 apps.
  • Native load fixed on macOS/Linux. The NativeMethods resolver now probes runtimes/<rid>/native
    for .dylib/.so, so source control works cross-platform (unblocks STUD-80708).
  • Single auto version X.Y.Z-v<N> where N = epoch + MinVer height.
  • Packaging fix: corrects the doubled runtimes/<rid>/native/<rid>/native/ path in the packed nupkg.
  • CI: bumped to actions v4, matrix on windows/ubuntu/macos, fetches natives before build/test.
  • Adds the release-libgit2-natives skill (cross-repo release runbook) + its Update-Lockfile.ps1.

STUD-80766 https://uipath.atlassian.net/browse/STUD-80766

🤖 Generated with Claude Code

andrei-balint and others added 11 commits July 6, 2026 17:26
…inaries package

Replace the LibGit2Sharp.NativeBinaries.UiPath PackageReference with a
directly-consumed native payload: natives.lock.json pins the archive
(tag + url + sha256) published by the libgit2sharp.nativebinaries build
workflow; fetch.natives.ps1 downloads, SHA256-verifies, and extracts it
to native/ (git-ignored). Targets/NativeBinaries.props (imported via the
root Directory.Build.props) sets libgit2_filename/libgit2_hash and stages
the multi-RID runtimes into every project's output and into the
LibGit2Sharp.UiPath package. CI runs fetch.natives.ps1 before build/test.

This collapses the two-package layout (managed + NativeBinaries) into a
single LibGit2Sharp.UiPath nupkg that bundles all six RIDs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The library does its OS checks at runtime and ships native binaries for
all six RIDs, so the Windows-only TFM was an unnecessary restriction.
Move the library, the test project, and the native-load probe apps to
net8.0. The net472-only code paths (desktop/**, NativeLibraryLoadTestApp
wiring, #if NETFRAMEWORK) stay dormant under the non-framework branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump the build/test SDK to 8.0.x and run tests on one native runner per
OS (windows-latest, ubuntu-latest, macos-14). Drop the dockerized
multi-distro test-linux job: it pinned .NET 6/7 SDK images and covered
alpine/musl, which the glibc-linked linux natives we ship can't run. The
win-arm64/linux-arm64/osx-x64 natives ship in the package but are not
runtime-tested here (no arm Windows/Linux runners, scarce Intel mac).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
actions/upload-artifact v3 is deprecated and auto-fails runs; move
checkout, setup-dotnet and upload-artifact to v4 (matching the
nativebinaries workflows).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The DllImport resolver only probed runtimes/<rid>/native/lib*.so on
Linux, so on macOS the library was never found (the fork was previously
Windows-only and never exercised macOS resolution) and every test failed
with DllNotFoundException. Extend the probe to macOS (.dylib).

Also exclude CanInspectCertificateOnClone from CI: it is an upstream
network-integration test asserting GitHub's hardcoded SSH host-key MD5,
which is unstable on CI runners and unrelated to native packaging.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PackagePath pointed at a folder (runtimes/<rid>/native/), so NuGet
re-appended each file's recursive path, packing natives at
runtimes/<rid>/native/<rid>/native/. A consumer's loader probes
runtimes/<rid>/native/ and would not find them. Set PackagePath to the
full target path including filename (mirroring Link), so NuGet places
each file exactly once. Build output (via Link) was already correct,
which is why the test runs passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduce the release-libgit2-natives skill (.claude/skills/): an
interactive, cross-repo runbook plus the Update-Lockfile.ps1 atom for
rolling new SHA256 pins through deps.lock.json and natives.lock.json,
each hop gated by a human-reviewed PR. Re-include the skill directory in
.gitignore (its name was caught by the [Rr]elease*/ build-output pattern).

Collapse the package version to a single auto-incrementing X.Y.Z-v<height>
(e.g. 1.9.1-v22) in the AdjustVersions target: the -vN base tag is a
permanent counting anchor, the MinVer height is the version, so releases
need no manual version tagging.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Publishing LibGit2Sharp.UiPath to the UiPath-Internal Azure DevOps feed
is done interactively from the release skill (no CI publish job), matching
the PR-gated, human-driven shape of the rest of the chain. Recommended
auth is a short-lived Azure DevOps token minted via `az account
get-access-token` (no stored PAT); the Azure Artifacts credential provider
is the fallback. Also correct the gates to review + branch + commit + PR,
drop the stale feature-branch names, and fix version-scheme examples.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drive the .NET target from a single NetCoreVersion property in
Directory.Build.props (consumed as net$(NetCoreVersion) by the library,
tests, and both NativeLibraryLoadTestApps) and set it to net6.0, so the
LibGit2Sharp.UiPath package stays consumable by net6.0/7.0/8.0 apps
instead of requiring net8.0. Bumping the one property retargets all
projects.

CI mirrors the target by hand (a workflow matrix can't read an MSBuild
property): matrix tfm is net6.0, and setup-dotnet now installs the 6.0.x
runtime alongside 8.0.x so the tests can run on net6.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve PackageVersion as the base tag's epoch plus the MinVer height
(e.g. tag 1.9.1-v5 + height 9 -> 1.9.1-v14), matching the nativebinaries
repo. The number now continues from the tag instead of restarting at the
height; on the tag itself the height is 0, so the number equals the tag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Point natives.lock.json at the natives-1.9.1-v7 release (epoch+height
versioning) published from libgit2sharp.nativebinaries develop. SHA256
verified via fetch.natives.ps1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@andrei-balint andrei-balint self-assigned this Jul 7, 2026
Update SKILL.md to describe the version as N = base tag epoch + MinVer
height (e.g. 1.9.1-v5 + height 1 -> v6), replacing the earlier height-only
wording. Note that re-tagging at the current v<N> is seamless, and record
why height-only produced v1 after a merge (MinVer height is the shortest
graph distance to the tag).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@andrei-balint andrei-balint merged commit 0e5d77c into develop Jul 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants