Skip to content

Build a template project for each project shape in the image - #68

Open
ihid-assistant[bot] wants to merge 1 commit into
vbnet-direct-xunitfrom
vbnet-project-shapes
Open

ihid-assistant[bot] wants to merge 1 commit into
vbnet-direct-xunitfrom
vbnet-project-shapes

Conversation

@ihid-assistant

@ihid-assistant ihid-assistant Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Hello 🙂 I'm working with Claude to try and get our tooling faster.

This PR prepares the templates used by the next PR. It's the third of four that together make this project around 6x faster. I've run it in production to benchmark things in the real world against the most recent few hundred solutions, so I'm confident that it works robustly. However, I've not written the code. I have tried my hardest to get Claude to write sensible messages and comments that explains stuff, but I'd ask for your patience in the fact I'm sending AI code to you. Everything below here is from your friendly neighbourhood LLM...


This is the third of four PRs. Merge them in order: #66, #67, then this one (#68), then #69.

What changed

  • This PR builds a template project for each project shape when the image is built. The new shapes/ folder holds one template project file for each distinct .vbproj the track has used since it switched to xUnit v3 (5 at the moment). These templates are called shapes. bin/generate-shapes.py writes them from the track repo's history.
  • bin/build-shapes.sh builds each shape with the .NET SDK. It saves the compiler arguments, the source files generated by the SDK and packages, and the resolved dependencies. The script also precompiles the dependencies with ReadyToRun, so the test executable starts faster, because the JIT compiler has less to compile. If a shape fails to build, the script removes it.
  • When MSBuild writes out the captured compiler arguments, it turns every backslash into a slash. That breaks the escaped quotes in /define:"CONFIG=\"release\",...", so the script puts the backslashes back on that line.
  • The runner has a new --prepare-shape option, which the script calls after each build. It reduces the shape's .vbproj to its properties, Import items and package references (see ProjectShape.vb), and saves that as the shape's key. The next PR matches each solution's project file against these keys.
  • The runner itself is now published with ReadyToRun. The Dockerfile restores the ReadyToRun compiler and runtime packs for the runner. The shape build borrows them through a mount, so they don't stay in the image.
  • This PR changes nothing at run time. The runner doesn't use the shapes yet. The next PR (Compile known project shapes with Roslyn, without MSBuild (~6x faster with the whole stack) #69) uses them to compile solutions without MSBuild.
  • The image grows from 1.0 GB to 1.17 GB. Identical files across the shapes are hard-linked to keep this down.

This has been tested in production. It doesn't change the median run, which stays at 8.6s.

🤖 Generated with Claude Code

shapes/ holds one template .vbproj for each distinct project file in the track's history since the switch to xUnit v3. At image build, bin/build-shapes.sh builds each one with the SDK and keeps its compiler arguments, its generated source files and its dependencies precompiled with ReadyToRun. The runner is now published with ReadyToRun too. Nothing uses the shapes at run time yet.

Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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