Skip to content

Commit fa05a08

Browse files
Update copilot-instructions.md (#116049)
Some tweaks to the instructions to ensure clarity of the agent's reported status Co-authored-by: Stephen Toub <[email protected]>
1 parent 0a807e8 commit fa05a08

File tree

1 file changed

+66
-25
lines changed

1 file changed

+66
-25
lines changed

.github/copilot-instructions.md

Lines changed: 66 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
Important: **Ensure the code compiles and the tests pass.** Use the "Building & Testing in dotnet/runtime" instructions below.
1+
**Any code you commit SHOULD compile, and new and existing tests related to the change SHOULD pass.**
22

3-
Additionally,
3+
You MUST make your best effort to ensure your changes satisfy those criteria before committing. If for any reason you were unable to build or test the changes, you MUST report that. You MUST NOT claim success unless all builds and tests pass as described above.
4+
5+
You MUST refer to the [Building & Testing in dotnet/runtime](#building--testing-in-dotnetruntime) instructions and use the commands and approaches specified there before attempting your own suggestions.
6+
7+
You MUST follow all code-formatting and naming conventions defined in [`.editorconfig`](/.editorconfig).
8+
9+
In addition to the rules enforced by `.editorconfig`, you SHOULD:
410

5-
- Follow all code-formatting and naming conventions defined in `./.editorconfig`.
611
- Prefer file-scoped namespace declarations and single-line using directives.
712
- Ensure that the final return statement of a method is on its own line.
813
- Use pattern matching and switch expressions wherever possible.
@@ -17,6 +22,22 @@ Additionally,
1722

1823
# Building & Testing in dotnet/runtime
1924

25+
- [1. Prerequisites](#1-prerequisites)
26+
- [1.1. Determine Affected Components](#11-determine-affected-components)
27+
- [1.2. Baseline Setup](#12-baseline-setup)
28+
- [2. Iterative Build and Test Strategy](#2-iterative-build-and-test-strategy)
29+
- [2.1. Success Criteria](#21-success-criteria)
30+
- [3. CoreCLR (CLR) Workflow](#3-coreclr-clr-workflow)
31+
- [4. Mono Runtime Workflow](#4-mono-runtime-workflow)
32+
- [5. Libraries Workflow](#5-libraries-workflow)
33+
- [5.1. How To: Identify Affected Libraries](#51-how-to-identify-affected-libraries)
34+
- [5.2. How To: Build and Test Specific Library](#52-how-to-build-and-test-specific-library)
35+
- [6. WebAssembly (WASM) Libraries Workflow](#6-webassembly-wasm-libraries-workflow)
36+
- [7. Additional Notes](#7-additional-notes)
37+
- [7.1. Troubleshooting](#71-troubleshooting)
38+
- [7.2. Windows Command Equivalents](#72-windows-command-equivalents)
39+
- [7.3. References](#73-references)
40+
2041
## 1. Prerequisites
2142

2243
These steps need to be done **before** applying any changes.
@@ -42,7 +63,7 @@ A change is considered WASM/WASI-relevant if:
4263

4364
### 1.2. Baseline Setup
4465

45-
Ensure you have a full successful build of the needed runtime+libraries as a baseline.
66+
Before applying any changes, ensure you have a full successful build of the needed runtime+libraries as a baseline.
4667

4768
1. Checkout `main` branch
4869

@@ -53,7 +74,7 @@ Ensure you have a full successful build of the needed runtime+libraries as a bas
5374
- **WASM/WASI Libraries:** `./build.sh mono+libs -os browser`
5475

5576
3. Verify the build completed without error.
56-
- _If the build failed, report the failure and don't proceed with the changes._
77+
- _If the baseline build failed, report the failure and don't proceed with the changes._
5778

5879
4. From the repository root:
5980
- Configure PATH: `export PATH="$(pwd)/.dotnet:$PATH"`
@@ -106,14 +127,14 @@ When retrying, attempt different fixes and adjust based on the build/test result
106127
From the repository root:
107128

108129
- Build:
109-
`./build.sh -subset clr`
130+
`./build.sh clr`
110131

111132
- Run tests:
112133
`cd src/tests && ./build.sh && ./run.sh`
113134

114-
- More info:
115-
- [Building CoreCLR Guide](https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/README.md)
116-
- [Building and Running CoreCLR Tests](https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/coreclr/testing.md)
135+
- More info can be found in the dedicated workflow docs:
136+
- [Building CoreCLR Guide](/docs/workflow/building/coreclr/README.md)
137+
- [Building and Running CoreCLR Tests](/docs/workflow/testing/coreclr/testing.md)
117138

118139
---
119140

@@ -122,7 +143,7 @@ From the repository root:
122143
From the repository root:
123144

124145
- Build:
125-
`./build.sh -subset mono+libs`
146+
`./build.sh mono+libs`
126147

127148
- Run tests:
128149

@@ -133,25 +154,31 @@ From the repository root:
133154
./run.sh
134155
```
135156

136-
- More info:
137-
- [Building Mono](https://github.com/dotnet/runtime/blob/main/docs/workflow/building/mono/README.md)
138-
- [Running test suites using Mono](https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/mono/testing.md)
157+
- More info can be found in the dedicated workflow docs:
158+
- [Building Mono](/docs/workflow/building/mono/README.md)
159+
- [Running test suites using Mono](/docs/workflow/testing/mono/testing.md)
139160

140161
---
141162

142163
## 5. Libraries Workflow
143164

144165
From the repository root:
145166

146-
- Build:
147-
`./build.sh -subset libs -rc release`
167+
- Build all libraries:
168+
`./build.sh libs -rc release`
148169

149-
- Run tests:
150-
`./build.sh -subset libs.tests -test -rc release`
170+
- Run all tests for libraries:
171+
`./build.sh libs.tests -test -rc release`
151172

152-
- More info:
153-
- [Build Libraries](https://github.com/dotnet/runtime/blob/main/docs/workflow/building/libraries/README.md)
154-
- [Testing Libraries](https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/libraries/testing.md)
173+
- Build a specific library:
174+
- Refer to the section [5.2. How To: Build and Test Specific Library](#52-how-to-build-and-test-specific-library) below.
175+
176+
- Test a specific library:
177+
- Refer to the sections [5.1. How To: Identify Affected Libraries](#51-how-to-identify-affected-libraries) and [5.2. How To: Build and Test Specific Library](#52-how-to-build-and-test-specific-library) below.
178+
179+
- More info can be found in the dedicated workflow docs:
180+
- [Build Libraries](/docs/workflow/building/libraries/README.md)
181+
- [Testing Libraries](/docs/workflow/testing/libraries/testing.md)
155182

156183
### 5.1. How To: Identify Affected Libraries
157184

@@ -202,9 +229,9 @@ From the repository root:
202229
- Run tests:
203230
`./build.sh libs.tests -test -os browser`
204231

205-
- More info:
206-
- [Build libraries for WebAssembly](https://github.com/dotnet/runtime/blob/main/docs/workflow/building/libraries/webassembly-instructions.md)
207-
- [Testing Libraries on WebAssembly](https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/libraries/testing-wasm.md)
232+
- More info can be found in the dedicated workflow docs:
233+
- [Build libraries for WebAssembly](/docs/workflow/building/libraries/webassembly-instructions.md)
234+
- [Testing Libraries on WebAssembly](/docs/workflow/testing/libraries/testing-wasm.md)
208235

209236
---
210237

@@ -215,7 +242,7 @@ From the repository root:
215242
- **Shared Framework Missing**
216243

217244
- If the build fails with an error "The shared framework must be built before the local targeting pack can be consumed.", build both the runtime (clr or mono) and the libs.
218-
E.g., from the repo root, run `./build.sh clr+libs -rc release` if working on Libraries on CoreCLR. Refer to the section `1.2. Baseline Setup`.
245+
E.g., from the repo root, run `./build.sh clr+libs -rc release` if working on Libraries on CoreCLR. To find the applicable command, refer to the section [1.2. Baseline Setup](#12-baseline-setup).
219246

220247
- **Testhost Is Missing**
221248

@@ -225,7 +252,7 @@ From the repository root:
225252
that means some of the prerequisites were not built.
226253

227254
- To resolve, build both the appropriate runtime (clr or mono) and the libs as a single command before running tests.
228-
E.g., from the repo root, run `./build.sh clr+libs -rc release` before testing Libraries on CoreCLR. Refer to the section `1.2. Baseline Setup`.
255+
E.g., from the repo root, run `./build.sh clr+libs -rc release` before testing Libraries on CoreCLR. To find the applicable command, refer to the section [1.2. Baseline Setup](#12-baseline-setup).
229256

230257
- **Build Timeout**
231258

@@ -247,3 +274,17 @@ From the repository root:
247274
- Use `build.cmd` instead of `build.sh` on Windows.
248275
- Set PATH: `set PATH=%CD%\.dotnet;%PATH%`
249276
- All other commands are similar unless otherwise noted.
277+
278+
---
279+
280+
### 7.3. References
281+
282+
- [`.editorconfig`](/.editorconfig)
283+
- [Building CoreCLR Guide](/docs/workflow/building/coreclr/README.md)
284+
- [Building and Running CoreCLR Tests](/docs/workflow/testing/coreclr/testing.md)
285+
- [Building Mono](/docs/workflow/building/mono/README.md)
286+
- [Running test suites using Mono](/docs/workflow/testing/mono/testing.md)
287+
- [Build Libraries](/docs/workflow/building/libraries/README.md)
288+
- [Testing Libraries](/docs/workflow/testing/libraries/testing.md)
289+
- [Build libraries for WebAssembly](/docs/workflow/building/libraries/webassembly-instructions.md)
290+
- [Testing Libraries on WebAssembly](/docs/workflow/testing/libraries/testing-wasm.md)

0 commit comments

Comments
 (0)