Skip to content

Commit 7cc425d

Browse files
authored
Merge branch 'main' into spInterrupt
2 parents 8d7264a + 8510651 commit 7cc425d

File tree

416 files changed

+11462
-2634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

416 files changed

+11462
-2634
lines changed

.github/ISSUE_TEMPLATE/04_ci_known_issue.yml

-32
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ contact_links:
1818
- name: Issue with WPF
1919
url: https://github.com/dotnet/wpf/issues/new/choose
2020
about: Please open issues relating to WPF in dotnet/wpf.
21+
- name: CI Known Issue Report
22+
url: https://helix.dot.net/BuildAnalysis/CreateKnownIssues
23+
about: Use the helper to create a Known Issue in CI if failures in your runs are unrelated to your change. See [Failure Analysis](https://github.com/dotnet/runtime/blob/main/docs/workflow/ci/failure-analysis.md#what-to-do-if-you-determine-the-failure-is-unrelated) for triage instructions.

docs/design/features/byreflike-generics.md

+126
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,129 @@ The following are IL sequences involving the `box` instruction. They are used fo
127127
`box` ; `isinst` ; `unbox.any` – The box, `isint`, and unbox target types are all equal.
128128

129129
`box` ; `isinst` ; `br_true/false` &ndash; The box target type is equal to the unboxed target type or the box target type is `Nullable<T>` and target type equalities can be computed.
130+
131+
## Examples
132+
133+
Below are valid and invalid examples of ByRefLike as Generic parameters. All examples use the **not official** syntax, `allows ref struct`, for indicating the Generic permits ByRefLike types.
134+
135+
**1) Valid**
136+
```csharp
137+
class A<T1> where T1: allows ref struct
138+
{
139+
public void M();
140+
}
141+
142+
// The derived class is okay to lack the 'allows'
143+
// because the base permits non-ByRefLike (default)
144+
// _and_ ByRefLike types.
145+
class B<T2> : A<T2>
146+
{
147+
public void N()
148+
=> M(); // Any T2 satisfies the constraints from A<>
149+
}
150+
```
151+
152+
**2) Invalid**
153+
```csharp
154+
class A<T1>
155+
{
156+
public void M();
157+
}
158+
159+
// The derived class cannot push up the allows
160+
// constraint for ByRefLike types.
161+
class B<T2> : A<T2> where T2: allows ref struct
162+
{
163+
public void N()
164+
=> M(); // A<> may not permit a T2
165+
}
166+
```
167+
168+
**3) Valid**
169+
```csharp
170+
interface IA
171+
{
172+
void M();
173+
}
174+
175+
ref struct A : IA
176+
{
177+
public void M() { }
178+
}
179+
180+
class B
181+
{
182+
// This call is permitted because no boxing is needed
183+
// to dispatch to the method - it is implemented on A.
184+
public static void C<T>(T t) where T: IA, allows ref struct
185+
=> t.M();
186+
}
187+
```
188+
189+
**4) Invalid**
190+
```csharp
191+
interface IA
192+
{
193+
public void M() { }
194+
}
195+
196+
ref struct A : IA
197+
{
198+
// Relies on IA::M() implementation.
199+
}
200+
201+
class B
202+
{
203+
// Reliance on a DIM forces the generic parameter
204+
// to be boxed, which is invalid for ByRefLike types.
205+
public static void C<T>(T t) where T: IA, allows ref struct
206+
=> t.M();
207+
}
208+
```
209+
210+
**5) Valid**
211+
```csharp
212+
class A<T1> where T1: allows ref struct
213+
{
214+
}
215+
216+
class B<T2>
217+
{
218+
// The type parameter is okay to lack the 'allows'
219+
// because the field permits non-ByRefLike (default)
220+
// _and_ ByRefLike types.
221+
A<T2> Field;
222+
}
223+
```
224+
225+
**6) Invalid**
226+
```csharp
227+
class A<T1>
228+
{
229+
}
230+
231+
class B<T2> where T2: allows ref struct
232+
{
233+
// The type parameter can be passed to
234+
// the field type, but will fail if
235+
// T2 is a ByRefLike type.
236+
A<T2> Field;
237+
}
238+
```
239+
240+
**7) Invalid**
241+
```csharp
242+
class A
243+
{
244+
virtual void M<T1>() where T1: allows ref struct;
245+
}
246+
247+
class B : A
248+
{
249+
// Override methods need to match be at least
250+
// as restrictive with respect to constraints.
251+
// If a user has an instance of A, they are
252+
// not aware they could be calling B.
253+
override void M<T2>();
254+
}
255+
```

docs/workflow/ci/failure-analysis.md

+24
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@
1212

1313
## Triaging errors seen in CI
1414

15+
## Summary
16+
17+
**Passing Build Analysis is required to merge into the runtime repo**.
18+
19+
To resolve failures, do the following, in order:
20+
21+
1. Fix the problem if your PR is the cause.
22+
2. For all failures not in the "Known test errors" section, [try to file a Known Build Error issue](#what-to-do-if-you-determine-the-failure-is-unrelated).
23+
3. If all else fails, perform a [manual bypass](#bypassing-build-analysis).
24+
25+
26+
## Details
27+
1528
In case of failure, any PR on the runtime will have a failed GitHub check - PR Build Analysis - which has a summary of all failures, including a list of matching known issues as well as any regressions introduced to the build or the tests. This tab should be your first stop for analyzing the PR failures.
1629

1730
![Build analysis check](analysis-check.png)
@@ -78,6 +91,7 @@ If you have considered all the diagnostic artifacts and determined the failure i
7891
````
7992
It already contains most of the essential information, but *it is very important that you fill out the json blob*.
8093
94+
- You can now use the [Build Analysis Known Issue Helper](https://helix.dot.net/BuildAnalysis/CreateKnownIssues) to create an issue. It assists in adding the right set of labels, fill the necessary paths in the json blob, and it will validate that it matches the text presented for the issue found in the logs.
8195
- You can add into the `ErrorMessage` field the string that you found uniquely identifies the issue. In case you need to use a regex, use the `ErrorPattern` field instead. This is a limited to a single-line, non-backtracking regex as described [here](https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssues.md#regex-matching). This regex also needs to be appropriately escaped. Check the [arcade known issues](https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssues.md#filling-out-known-issues-json-blob) documentation for a good guide on proper regex and JSON escaping.
8296
- The field `ExcludeConsoleLog` describes if the execution logs should be considered on top of the individual test results. **For most cases, this should be set to `true` as the failure will happen within a single test**. Setting it to `false` will mean all failures within an xUnit set of tests will also get attributed to this particular error, since there's one log describing all the problems. Due to limitations in Known Issues around rate limiting and xUnit resiliency, setting `ExcludeConsoleLog=false` is necessary in two scenarios:
8397
+ Nested tests as reported to Azure DevOps. Essentially this means theory failures, which look like this when reported in Azure DevOps: ![xUnit theory seen in azure devops](theory-azdo.png).
@@ -95,6 +109,16 @@ After you do this, if the failure is occurring frequently as per the data captur
95109
96110
There are plenty of intermittent failures that won't manifest again on a retry. Therefore these steps should be followed for every iteration of the PR build, e.g. before retrying/rebuilding.
97111
112+
### Bypassing build analysis
113+
114+
To unconditionally bypass the build analysis check (turn it green), you can add a comment to your PR with the following text:
115+
116+
```
117+
/ba-g <reason>
118+
```
119+
120+
For more information, see https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/EscapeMechanismforBuildAnalysis.md
121+
98122
### Examples of Build Analysis
99123
100124
#### Good usage examples

0 commit comments

Comments
 (0)