Skip to content

Releases: peacefulstudio/daml-codegen-csharp

v0.1.8-preview.5

v0.1.8-preview.5 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 24 Jun 17:11
Immutable release. Only release title and notes can be modified.
cc5f33b

This release follows 0.1.8-preview.4. The headline is a codegen serialization-dispatch fix: generated serialization no longer emits a non-compiling .ToRecord() for variant payloads or for fields the type mapper cannot name, so an --include-dependencies tree containing Daml stdlib types like DA.Logic.Types.Formula, DA.Action.State.Type.State and DA.Monoid.Types.Endo now compiles as a single assembly. This release also bumps the default Splice release to 0.6.9 and regenerates both the Splice and Daml Finance C# bindings with the preview.5 emitter.

Changes since 0.1.8-preview.4

Changed

  • Generated code and runtime messages no longer embed internal issue-tracker references; limitation notes (contract-key projection, generic-type serialization) now read as generic, consumer-facing prose.

Fixed

  • Generated serialization no longer emits a non-compiling .ToRecord() for variant payloads or for fields the type mapper cannot name. Variant payloads (including recursive variants such as DA.Logic.Types.Formula and variant payloads nested in lists) now serialize via ToVariant()/FromVariant(), and function-typed / otherwise-unmappable fields (e.g. DA.Action.State.Type.State, DA.Monoid.Types.Endo) emit the GenericStub.NotImplemented stub instead of a missing-method call. Compiling an --include-dependencies tree containing these Daml stdlib types as one assembly no longer fails with CS1061.

What's included

Package Purpose
Daml.Codegen.CSharp the C# emitter library
Daml.Runtime runtime types referenced by generated code
Daml.Ledger.Abstractions transport-agnostic ILedgerClient submission/subscription interface
Daml.Codegen.Testing.Conformance compiled conformance corpus + embedded DAR for live-ledger round-trip tests

The four core packages are versioned in lockstep and published to NuGet.org. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.5 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64); the per-RID bundle tarballs and all .nupkg/.snupkg files are attached below.

Generated DAR bindings (NuGet.org)

Generated C# bindings built with this release are published to NuGet.org and attached here:

  • Daml Finance 2.10.0 — 8 packages (Daml.Finance.*, e.g. Daml.Finance.Util.V4 4.0.0-preview.5). Regenerated with the preview.5 emitter; the keyed-template and DayOfWeek/Period fixes from preview.4 mean the previously-broken keyed and date packages now compile.
  • Splice 0.6.9 — 23 packages (Splice.*, e.g. Splice.Amulet 0.1.20-preview.5). Bumped from 0.6.5; the new 0.6.9 packages (batched-markers, featured-app proxies, token-standard wallet, app-manager) are picked up automatically.

Versioning and stability

This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.

Getting started

Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):

components:
  - oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.5

0.1.8-preview.4 — interface-only read path; Daml Finance + Splice codegen unblocked

Choose a tag to compare

@github-actions github-actions released this 23 Jun 14:06
Immutable release. Only release title and notes can be modified.
9c74471

This release supersedes 0.1.8-preview.3, which was published to NuGet.org and then unlisted before general use because of a mandatory codegen fix. 0.1.8-preview.4 contains everything from preview.3 plus the preview.4 changes below — if you were on preview.2, this is the next release to take.

The headline is the interface-only read path — read-path helpers now accept Daml interface markers, not just templates, and match created contracts by interface view — and the codegen fixes that unblock the generated Daml Finance and Splice C# packages (the Key-accessor revert, the DayOfWeek stdlib mapping, the Period/CS0542 and sibling-version/NU1102 fixes). Generated Daml Finance 2.10.0 (8 packages) and Splice 0.6.5 (22 packages) C# bindings are published to GitHub Packages and attached to this release.

Changes since 0.1.8-preview.2

Added

  • Read-path helpers now accept Daml interface markers, not just templates, and match created contracts by interface view. The generic constraint on TransactionResultExtensions.Single<T>/TrySingle<T>/All<T>, ILedgerClient.TryExerciseForCreatedAsync<TTemplate> and both SubscribeAsync<T> overloads, and ContractStreamEvent<T> is relaxed from ITemplate to IDamlType. When T is a template the match is unchanged (created contract's TemplateId); when T is an interface marker (IDamlInterface), a created contract matches when its InterfaceIds contains T's interface identifier (module + entity, package-id-agnostic). Constraint relaxation is source-compatible. TryCreateAsync<TTemplate> and SubscribeActiveAsync<T> intentionally stay ITemplate-constrained — create paths remain template-only.
  • Daml.Runtime.Contracts.CreatedContract gains an init-only IReadOnlyList<Identifier> InterfaceIds { get; init; } member carrying the interface ids the participant computed for a created event. Non-breaking: it is not a positional parameter, so existing 3-arg construction keeps working and the field defaults to an empty (non-null) list. Enables interface-only consumption, where a contract is known only as an interface and must be matched/dispatched at runtime.
  • A --version-suffix codegen option that appends a SemVer prerelease suffix (e.g. preview.4) to generated package versions, producing versions like 0.1.6.1-preview.4. Mirrors the emitter's own prerelease tag and affects only the generated package <Version>; the Daml.Runtime reference version is unaffected.
  • A generated README.md for each package, plus PackageTags (and PackageProjectUrl/RepositoryUrl/RepositoryType when --repository-url is supplied) in the package <PropertyGroup>, so published packages render on nuget.org without the missing-README warning. The README install hint adds --prerelease for prerelease packages.
  • Generated Splice/Daml.Finance NuGet packages now ship a package icon (PackageIcon), so they render with the project icon on nuget.org.

Changed

  • The contract-key Key accessor on generated keyed templates now emits a non-partial property that throws NotImplementedException, reverting the body-less partial declaration introduced in 0.1.5. Key-bearing packages now compile and publish standalone: the partial required a hand-rolled implementing partial, which the automated DAR publish pipeline has no author for, so every keyed package failed to build with CS9248 (blocking the Daml Finance and Splice publishes). The key type is still generated and serializable for caller-constructed key-based operations, and : IHasKey<TKey> is unchanged — only the body reverts. Generated key-bearing packages consequently no longer pin <LangVersion>13</LangVersion>. Translating the Daml key expression into a real C# projection remains tracked for a future release.
  • Generated code and runtime messages no longer embed internal issue-tracker references; limitation notes (contract-key projection, generic-type serialization) now read as generic, consumer-facing prose.

Fixed

  • Generated C# no longer fails to compile when a record or template references the Daml stdlib enum DA.Date.Types:DayOfWeek. The enum now resolves to a runtime-provided Daml.Runtime.Stdlib.DayOfWeek (with serialization extensions), matching how other daml-stdlib types are handled, instead of emitting a conversion call to a helper class that was never generated (CS0103). Because the runtime enum shares its simple name with System.DayOfWeek, the reference is emitted fully global::-qualified to avoid an ambiguous reference (CS0104). Unblocks the Daml Finance interface-types-date-v3 package.
  • Generated C# no longer fails to compile with CS0542 when a Daml record field PascalCases to the same name as its enclosing type (e.g. Daml Finance Period with field period). The colliding C# member is now disambiguated with a trailing underscore while the Daml record field name used for (de)serialization stays unchanged.
  • Generated .csproj files now reference co-produced sibling packages using the full package version, including the emitter counter and any --version-suffix prerelease tag. Previously sibling <PackageReference> versions dropped the suffix, so a prerelease set (e.g. 3.0.0-preview.4) emitted >= 3.0.0 references that NuGet could not resolve (NU1102).
  • Generated submission-extension XML docs no longer leak an internal issue-tracking reference into consumer output.
  • Choice-argument types that reuse the same simple name across different modules no longer collide: the choice-arg-to-template map is now keyed by the module-qualified (Module:Name) name, so each resolves to its own parent template instead of one silently overwriting the other and emitting unresolvable type references.
  • A choice-argument type mapped by two templates in the same package no longer overwrites silently: the choice-arg-to-template map now warns and keeps the first-seen mapping (in both PackageEmitContext and DarCrossPackageResolver) instead of last-wins, so the clash is surfaced rather than mis-resolving cross-references.

What's included

Package Purpose
Daml.Codegen.CSharp the C# emitter library
Daml.Runtime runtime types referenced by generated code
Daml.Ledger.Abstractions transport-agnostic ILedgerClient submission/subscription interface
Daml.Codegen.Testing.Conformance compiled conformance corpus + embedded DAR for live-ledger round-trip tests

The four core packages are versioned in lockstep and published to NuGet.org. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.4 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64); the per-RID bundle tarballs and all .nupkg/.snupkg files are attached below.

Generated DAR bindings (GitHub Packages)

Generated C# bindings built with this release are published to GitHub Packages (https://nuget.pkg.github.com/peacefulstudio/index.json) and attached here:

  • Daml Finance 2.10.0 — 8 packages (Daml.Finance.*, e.g. Daml.Finance.Util.V4 4.0.0-preview.4)
  • Splice 0.6.5 — 22 packages (Splice.*, e.g. Splice.Amulet 0.1.18.1-preview.4)

Versioning and stability

This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.

Getting started

Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):

components:
  - oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.4

Add the runtime package to your C# project:

dotnet add package Daml.Runtime --prerelease

Then generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.

Full changelog

See CHANGELOG.md for the complete record.

0.1.8-preview.2 — CI-verified OS × arch support matrix, Google.Protobuf 3.35.1 floor

Choose a tag to compare

@monsieurleberre monsieurleberre released this 12 Jun 20:02
Immutable release. Only release title and notes can be modified.
b293344

Cross-platform hardening on top of 0.1.8-preview.1: every shipped package now has CI-verified support across the full OS × architecture matrix — Linux, Windows, and macOS, on both amd64 and arm64. GeneratedFile.RelativePath is now /-separated on every platform (previously \ on Windows), so codegen output layout is identical across operating systems; Google.Protobuf is raised to 3.35.1 for the Daml.Codegen.CSharp emitter package. No other API changes.

What's included

Package Purpose
Daml.Codegen.CSharp the C# emitter library
Daml.Runtime runtime types referenced by generated code
Daml.Ledger.Abstractions transport-agnostic ILedgerClient submission/subscription interface
Daml.Codegen.Testing.Conformance compiled conformance corpus + embedded DAR for live-ledger round-trip tests

The four packages are versioned in lockstep. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.2 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64) — and the .nupkg/.snupkg files for this release are attached below, on NuGet.org, and in the publish run's artifacts.

Versioning and stability

This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.

Getting started

Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):

components:
  - oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.2

Add the runtime package to your C# project:

dotnet add package Daml.Runtime --prerelease

Then generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.

Full changelog

See the 0.1.8-preview.2 section of CHANGELOG.md for the complete record.

0.1.8-preview.1 — first public release

Choose a tag to compare

@monsieurleberre monsieurleberre released this 11 Jun 17:44
Immutable release. Only release title and notes can be modified.
2f2fcae

First public release of the Daml C# code generator: strongly-typed C# from Daml DARs, targeting the Canton JSON Ledger API.

What's included

Package Purpose
Daml.Codegen.CSharp the C# emitter library
Daml.Runtime runtime types referenced by generated code
Daml.Ledger.Abstractions transport-agnostic ILedgerClient submission/subscription interface
Daml.Codegen.Testing.Conformance compiled conformance corpus + embedded DAR for live-ledger round-trip tests

The four packages are versioned in lockstep. The codegen CLI itself ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs (linux/amd64, linux/arm64, darwin/arm64, windows/amd64) — and the .nupkg files built by this release are available from the publish run's artifacts and on NuGet.org.

Versioning and stability

This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. The 0.1.00.1.7 sections in the changelog record internal development milestones whose packages were never published to a public feed — 0.1.8-preview.1 is the first release on NuGet.org.

Getting started

Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):

components:
  - oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.1

Add the runtime package to your C# project:

dotnet add package Daml.Runtime --prerelease

Then generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.

Full changelog

See the 0.1.8-preview.1 section of CHANGELOG.md for the complete record, including the API-freeze breaking changes relative to the internal milestones.