Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 11 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,17 @@ The build is driven by `Purview.BuildSdk`, imported via `src/Directory.Build.pro
- Package versions are managed centrally in `Directory.Packages.props` (Central Package Management).
- `global.json` pins the `Purview.BuildSdk` MSBuild SDK version.
- Pack layout for all packages is validated by `.config/purview-build.json` (`PackValidation.RequiredContent`).
- **.NET 11 opt-ins.** `Purview.BuildSdk` 2.0 compiles every `net11.0` target with Runtime Async (`runtime-async=on`) and the C# 15 updated memory-safety rules (`MemorySafetyRules=2`). The GA compiler still classifies the latter as a preview feature, so `LangVersion` is `preview`, and `AllowUnsafeBlocks` is on: the STJ generator emits unsafe fast paths, and the two `Unsafe.As` boundaries in the sentinel/required rules use `unsafe` blocks so the audit boundary is visible at the call site. Do not remove either without removing the tier-2 opt-in.
- **.NET 11 opt-ins.** `Purview.BuildSdk` 2.0 compiles every `net11.0` target with Runtime Async (`runtime-async=on`)
unless told otherwise; this repository sets `PurviewRuntimeAsync=false`, because Runtime Async is not supported by
Mono, and Mono is what Blazor WebAssembly runs on
([dotnet/aspnetcore#68067](https://github.com/dotnet/aspnetcore/issues/68067)). A package built with it throws an
empty `InvalidProgramException` at the first async method a wasm consumer runs (`ZodValidator` validation, for
example). Almost every package here is browser-facing — the core package, SystemTextJson, Http and Blazor — so the
opt-out is repository-wide rather than per project; re-enable it only for a project that can never be consumed from
WebAssembly. The C# 15 updated memory-safety rules (`MemorySafetyRules=2`) stay on, and the GA compiler still
classifies them as a preview feature, so `LangVersion` is `preview`, and `AllowUnsafeBlocks` is on: the STJ generator
emits unsafe fast paths, and the two `Unsafe.As` boundaries in the sentinel/required rules use `unsafe` blocks so the
audit boundary is visible at the call site. Do not remove either without removing the tier-2 opt-in.
- **Multithreaded MSBuild is off** (`PurviewMultiThreadedBuild=false`). The .NET 11 GA WebAssembly SDK declares `ReadWasmProps` with a custom `TaskFactory`, which `-mt` refuses to execute out of process, so `Examples.Blazor.Client` cannot build in that mode. Re-enable it once `dotnet/runtime` annotates the task as multithreadable.

Before changing build/SDK configuration or adding/moving projects, consult the SDK's own skills, which are committed under `.agents/skills/` (see [Installed skills](#installed-skills-agentsskills)): `purview-buildsdk-configuration`, `purview-buildsdk-project-detection`, `purview-buildsdk-project-layout`.
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and

Released versions correspond to `v<version>` GitHub releases.

## 3.0.0-prerelease.6

### Fixed

- **Blazor WebAssembly consumers no longer fail with `InvalidProgramException`.** The `net11.0` assemblies were
compiled with Runtime Async, which Mono does not support, so the first async method a WebAssembly consumer ran
(validating a form through `ZodValidator`, for example) threw an empty `InvalidProgramException` before any of its
own code executed. The repository now builds with `PurviewRuntimeAsync=false`; the C# 15 updated memory-safety rules
are unaffected. See [dotnet/aspnetcore#68067](https://github.com/dotnet/aspnetcore/issues/68067).

## 3.0.0-prerelease.5

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zodsharp",
"version": "3.0.0-prerelease.5",
"version": "3.0.0-prerelease.6",
"private": true,
"license": "MIT",
"author": {
Expand Down
12 changes: 12 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
sentinel/required rules use it deliberately (see ZodSharp.csproj).
-->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!--
Runtime Async stays off. Purview.BuildSdk 2.0 turns `runtime-async=on` on for every net11.0 target,
but Runtime Async is not supported by Mono, and Mono is the runtime behind Blazor WebAssembly.
3.0.0-prerelease.5 shipped with it on and a wasm consumer failed at its first validation with an
empty InvalidProgramException raised from the AsyncHelpers.Await IL
(dotnet/aspnetcore#68067: "Runtime async is not supported for Mono"; ASP.NET Core itself
compiles with `runtime-async=off` whenever the target is browser). Almost everything shipped here is
browser-facing - the core package, SystemTextJson, Http and Blazor - so the whole repository opts
out instead of carrying a per-project split that would still leave the core library unusable on
WebAssembly. The C# 15 updated memory-safety rules are independent of this and stay on.
-->
<PurviewRuntimeAsync>false</PurviewRuntimeAsync>
<NamespacePrefix>ZodSharp</NamespacePrefix>
<!-- Set project-by-project -->
<IsPackable>false</IsPackable>
Expand Down
Loading