diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6d3f2efaf848ce..0e5219042b700d 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,19 +3,19 @@ "isRoot": true, "tools": { "coverlet.console": { - "version": "1.7.2", + "version": "3.1.0", "commands": [ "coverlet" ] }, "dotnet-reportgenerator-globaltool": { - "version": "4.5.8", + "version": "5.0.2", "commands": [ "reportgenerator" ] }, "microsoft.dotnet.xharness.cli": { - "version": "1.0.0-prerelease.21622.1", + "version": "1.0.0-prerelease.22067.1", "commands": [ "xharness" ] diff --git a/.github/fabricbot.json b/.github/fabricbot.json index 72acfd8440a06d..723e3f5c493f2f 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -996,7 +996,7 @@ "subCapability": "IssueCommentResponder", "version": "1.0", "config": { - "taskName": "Replace `needs more info` label with `needs further triage` label when the author comments on an issue", + "taskName": "Replace `needs-author-action` label with `needs further triage` label when the author comments on an issue", "conditions": { "operator": "and", "operands": [ @@ -1017,7 +1017,7 @@ { "name": "hasLabel", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } }, { @@ -1036,7 +1036,7 @@ { "name": "removeLabel", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } } ], @@ -1575,7 +1575,7 @@ { "name": "hasLabel", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } }, { @@ -5416,7 +5416,7 @@ { "name": "labelAdded", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } } ] @@ -5426,12 +5426,12 @@ "issues", "project_card" ], - "taskName": "Needs more info notification", + "taskName": "Needs-author-action notification", "actions": [ { "name": "addReply", "parameters": { - "comment": "This issue has been marked `needs more info` since it may be missing important information. Please refer to our [contribution guidelines](https://github.com/dotnet/runtime/blob/main/CONTRIBUTING.md#writing-a-good-bug-report) for tips on how to report issues effectively." + "comment": "This issue has been marked `needs-author-action` since it may be missing important information. Please refer to our [contribution guidelines](https://github.com/dotnet/runtime/blob/main/CONTRIBUTING.md#writing-a-good-bug-report) for tips on how to report issues effectively." } } ] @@ -5951,7 +5951,7 @@ { "name": "labelAdded", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } }, { @@ -6003,25 +6003,7 @@ { "name": "hasLabel", "parameters": { - "label": "area-System.Collections" - } - }, - { - "name": "hasLabel", - "parameters": { - "label": "area-System.Linq" - } - }, - { - "name": "hasLabel", - "parameters": { - "label": "area-System.Text.Json" - } - }, - { - "name": "hasLabel", - "parameters": { - "label": "area-System.Xml" + "label": "area-Meta" } } ] @@ -6032,7 +6014,7 @@ { "name": "isInProject", "parameters": { - "projectName": "Area Pod: Eirik / Krzysztof / Layomi - PRs", + "projectName": "Area Pod: Eric / Jeff - PRs", "isOrgProject": true } } @@ -6046,12 +6028,12 @@ "issues", "project_card" ], - "taskName": "[Area Pod: Eirik / Krzysztof / Layomi - PRs] Add new PR to Board", + "taskName": "[Area Pod: Eric / Jeff - PRs] Add new PR to Board", "actions": [ { "name": "addToProject", "parameters": { - "projectName": "Area Pod: Eirik / Krzysztof / Layomi - PRs", + "projectName": "Area Pod: Eric / Jeff - PRs", "columnName": "Needs Champion", "isOrgProject": true } @@ -6686,7 +6668,7 @@ { "name": "labelAdded", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } }, { @@ -6723,6 +6705,119 @@ ] } }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "operator": "or", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.CodeDom" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Configuration" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Reflection" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Reflection.Emit" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Reflection.Metadata" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Resources" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Runtime.CompilerServices" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Text.RegularExpressions" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Threading.Channels" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Threading.Tasks" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.DirectoryServices" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "isInProject", + "parameters": { + "projectName": "Area Pod: Buyaa / Jose / Steve - PRs", + "isOrgProject": true + } + } + ] + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "taskName": "[Area Pod: Buyaa / Jose / Steve - PRs] Add new PR to Board", + "actions": [ + { + "name": "addToProject", + "parameters": { + "projectName": "Area Pod: Buyaa / Jose / Steve - PRs", + "columnName": "Needs Champion", + "isOrgProject": true + } + } + ] + } + }, { "taskType": "trigger", "capabilityId": "IssueResponder", @@ -7257,7 +7352,7 @@ { "name": "labelAdded", "parameters": { - "label": "needs more info" + "label": "needs-author-action" } }, { @@ -7294,6 +7389,77 @@ ] } }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "operator": "or", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Collections" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Linq" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Text.Json" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Xml" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "isInProject", + "parameters": { + "projectName": "Area Pod: Eirik / Krzysztof / Layomi - PRs", + "isOrgProject": true + } + } + ] + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "taskName": "[Area Pod: Eirik / Krzysztof / Layomi - PRs] Add new PR to Board", + "actions": [ + { + "name": "addToProject", + "parameters": { + "projectName": "Area Pod: Eirik / Krzysztof / Layomi - PRs", + "columnName": "Needs Champion", + "isOrgProject": true + } + } + ] + } + }, { "taskType": "trigger", "capabilityId": "IssueResponder", @@ -7379,5 +7545,984 @@ } ] } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssuesOnlyResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "operator": "or", + "operands": [ + { + "operator": "and", + "operands": [ + { + "operator": "or", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-DependencyModel" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Caching" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Configuration" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-DependencyInjection" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Hosting" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Logging" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Options" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Primitives" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel.Composition" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Composition" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Diagnostics.Activity" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Globalization" + } + } + ] + }, + { + "operator": "or", + "operands": [ + { + "name": "isAction", + "parameters": { + "action": "reopened" + } + }, + { + "operator": "not", + "operands": [ + { + "name": "isInMilestone", + "parameters": {} + } + ] + } + ] + } + ] + }, + { + "operator": "or", + "operands": [ + { + "name": "labelAdded", + "parameters": { + "label": "area-DependencyModel" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-Caching" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-Configuration" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-DependencyInjection" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-Hosting" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-Logging" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-Options" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-Extensions-Primitives" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-System.ComponentModel" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-System.ComponentModel.Composition" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-System.Composition" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-System.Diagnostics.Activity" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "area-System.Globalization" + } + } + ] + } + ] + }, + { + "name": "isOpen", + "parameters": {} + }, + { + "operator": "or", + "operands": [ + { + "operator": "not", + "operands": [ + { + "name": "isInProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "isOrgProject": true + } + } + ] + }, + { + "name": "isInProjectColumn", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "isOrgProject": true, + "columnName": "Triaged" + } + } + ] + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issues", + "project_card" + ], + "taskName": "[Area Pod: Eric / Maryam / Tarek - Issue Triage] Add new issue to Board", + "actions": [ + { + "name": "addToProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "columnName": "Needs Triage", + "isOrgProject": true + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssueCommentResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "operator": "or", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-DependencyModel" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Caching" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Configuration" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-DependencyInjection" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Hosting" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Logging" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Options" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Primitives" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel.Composition" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Composition" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Diagnostics.Activity" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Globalization" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "isCloseAndComment", + "parameters": {} + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "activitySenderHasPermissions", + "parameters": { + "permissions": "write" + } + } + ] + }, + { + "operator": "or", + "operands": [ + { + "operator": "not", + "operands": [ + { + "name": "isInProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "isOrgProject": true + } + } + ] + }, + { + "name": "isInProjectColumn", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "columnName": "Triaged", + "isOrgProject": true + } + } + ] + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issue_comment" + ], + "taskName": "[Area Pod: Eric / Maryam / Tarek - Issue Triage] Needs Further Triage", + "actions": [ + { + "name": "addToProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "columnName": "Needs Triage", + "isOrgProject": true + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssuesOnlyResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "name": "isInProjectColumn", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "columnName": "Needs Triage", + "isOrgProject": true + } + }, + { + "operator": "and", + "operands": [ + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-DependencyModel" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Caching" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Configuration" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-DependencyInjection" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Hosting" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Logging" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Options" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Primitives" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel.Composition" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Composition" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Diagnostics.Activity" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Globalization" + } + } + ] + } + ] + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issues", + "project_card" + ], + "taskName": "[Area Pod: Eric / Maryam / Tarek - Issue Triage] Remove relabeled issues", + "actions": [ + { + "name": "removeFromProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "isOrgProject": true + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssuesOnlyResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "name": "isInProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "isOrgProject": true + } + }, + { + "operator": "not", + "operands": [ + { + "name": "isInProjectColumn", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "columnName": "Triaged" + } + } + ] + }, + { + "operator": "or", + "operands": [ + { + "name": "addedToMilestone", + "parameters": {} + }, + { + "name": "labelAdded", + "parameters": { + "label": "needs more info" + } + }, + { + "name": "labelAdded", + "parameters": { + "label": "api-ready-for-review" + } + }, + { + "name": "isAction", + "parameters": { + "action": "closed" + } + } + ] + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issues", + "project_card" + ], + "taskName": "[Area Pod: Eric / Maryam / Tarek - Issue Triage] Move to Triaged Column", + "actions": [ + { + "name": "addToProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - Issue Triage", + "columnName": "Triaged", + "isOrgProject": true + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "operator": "or", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-DependencyModel" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Caching" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Configuration" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-DependencyInjection" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Hosting" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Logging" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Options" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Primitives" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel.Composition" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Composition" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Diagnostics.Activity" + } + }, + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Globalization" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "isInProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - PRs", + "isOrgProject": true + } + } + ] + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "taskName": "[Area Pod: Eric / Maryam / Tarek - PRs] Add new PR to Board", + "actions": [ + { + "name": "addToProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - PRs", + "columnName": "Needs Champion", + "isOrgProject": true + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "name": "isInProjectColumn", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - PRs", + "columnName": "Needs Champion", + "isOrgProject": true + } + }, + { + "operator": "and", + "operands": [ + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-DependencyModel" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Caching" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Configuration" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-DependencyInjection" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Hosting" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Logging" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Options" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-Extensions-Primitives" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.ComponentModel.Composition" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Composition" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Diagnostics.Activity" + } + } + ] + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "area-System.Globalization" + } + } + ] + } + ] + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "taskName": "[Area Pod: Eric / Maryam / Tarek - PRs] Remove relabeled PRs", + "actions": [ + { + "name": "removeFromProject", + "parameters": { + "projectName": "Area Pod: Eric / Maryam / Tarek - PRs", + "isOrgProject": true + } + } + ] + } } ] \ No newline at end of file diff --git a/.gitignore b/.gitignore index c1a783db2aa7c9..6627d2c2d0a75b 100644 --- a/.gitignore +++ b/.gitignore @@ -187,6 +187,7 @@ node_modules/ *.metaproj.tmp bin.localpkg/ src/mono/wasm/runtime/dotnet.d.ts.sha256 +src/mono/sample/wasm/browser-nextjs/public/ # RIA/Silverlight projects Generated_Code/ diff --git a/Directory.Build.props b/Directory.Build.props index 0983ba4ae36f89..e9e6fc4e362346 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -31,6 +31,7 @@ arm armel arm64 + loongarch64 s390x wasm x64 @@ -157,26 +158,27 @@ - <_toolRuntimeRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)-$(_hostArch) - <_toolRuntimeRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64 - <_toolRuntimeRID Condition="'$(_toolRuntimeRID)' == ''">$(_runtimeOS)-$(_hostArch) + <_toolsRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)-$(_hostArch) + <_toolsRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64 + <_toolsRID Condition="'$(_toolsRID)' == ''">$(_runtimeOS)-$(_hostArch) - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'windows'">win-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'windows'">win-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android'">linux-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'android'">linux-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64 - - linux-$(_hostArch) - $(_toolRuntimeRID) + + linux-$(_hostArch) + $(_toolsRID) + $(ToolsRID) $(_packageOS)-$(TargetArchitecture) diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md index 997aa1fd3772a8..55d4e9ddcae0ab 100644 --- a/docs/coding-guidelines/interop-guidelines.md +++ b/docs/coding-guidelines/interop-guidelines.md @@ -166,6 +166,12 @@ Using enums instead of partial, static classes can lead to needing lots of casts When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices). +The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/DllImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`. + +If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays: + - `System.Memory` + - `System.Runtime.CompilerServices.Unsafe` + ## UNIX shims Often, various UNIX flavors offer the same API from the point-of-view of compatibility with C/C++ source code, but they do not have the same ABI. e.g. Fields can be laid out differently, constants can have different numeric values, exports can be named differently, etc. There are not only differences between operating systems (Mac OS X vs. Ubuntu vs. FreeBSD), but also differences related to the underlying processor architecture (x64 vs. x86 vs. ARM). @@ -174,6 +180,8 @@ This leaves us with a situation where we can't write portable P/Invoke declarati To address this, we're moving to a model where all UNIX interop from dotnet/runtime starts with a P/Invoke to a C++ lib written specifically for dotnet/runtime. These libs -- System.*.Native.so (aka "shims") -- are intended to be very thin layers over underlying platform libraries. Generally, they are not there to add any significant abstraction, but to create a stable ABI such that the same IL assembly can work across UNIX flavors. +The System.Native shims are a private implementation detail of the Microsoft.NETCore.App shared framework and are intended only for use by code inside of the shared framework. Calling into the shims from external to Microsoft.NETCore.App has similar risks to using private reflection, with no guarantees from version to version or even patch to patch of stable exports. Assemblies that ship outside of the shared framework (e.g. Microsoft.Extensions.*) must not directly access the shims. + Guidelines for shim C++ API: - Keep them as "thin"/1:1 as possible. diff --git a/docs/design/features/standalone-gc-loading.md b/docs/design/features/standalone-gc-loading.md index 3373bf5559f553..ed7440002e8da8 100644 --- a/docs/design/features/standalone-gc-loading.md +++ b/docs/design/features/standalone-gc-loading.md @@ -47,7 +47,7 @@ Worth noting is that the JIT (both RyuJIT and the legacy JIT(s) before it) can b and have realized these same benefits. The existence of an interface and an implementation loadable from shared libraries has enabled RyuJIT in particular to be used as the code generator for both the CoreRT compiler and crossgen, while still being flexible enough to be tested using tools that implement -very non-standard execution engines such as [SuperPMI](https://github.com/dotnet/runtime/blob/main/src/coreclr/ToolBox/superpmi/readme.txt). +very non-standard execution engines such as [SuperPMI](https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/superpmi/readme.md). The below loading protocol is inspired directly by the JIT loader and many aspects of the GC loader are identical to what the JIT does when loading dynamic shared libraries. diff --git a/docs/design/libraries/DllImportGenerator/StructMarshalling.md b/docs/design/libraries/DllImportGenerator/StructMarshalling.md index ab332616b74132..63781d6d77dbb2 100644 --- a/docs/design/libraries/DllImportGenerator/StructMarshalling.md +++ b/docs/design/libraries/DllImportGenerator/StructMarshalling.md @@ -6,10 +6,11 @@ These types pose an interesting problem for a number of reasons listed below. Wi ## Problems -- Unmanaged vs Blittable - - The C# language (and Roslyn) do not have a concept of "blittable types". It only has the concept of "unmanaged types", which is similar to blittable, but differs for `bool`s and `char`s. `bool` and `char` types are "unmanaged", but are never (in the case of `bool`), or only sometimes (in the case of `char`) blittable. As a result, we cannot use the "is this type unmanaged" check in Roslyn for structures. +- What types require marshalling and what types can be passed as-is to native code? + - Unmanaged vs Blittable + - The C# language (and Roslyn) do not have a concept of "blittable types". It only has the concept of "unmanaged types", which is similar to blittable, but differs for `bool`s and `char`s. `bool` and `char` types are "unmanaged", but are never (in the case of `bool`), or only sometimes (in the case of `char`) blittable. As a result, we cannot use the "is this type unmanaged" check in Roslyn for structures without an additional mechanism provided by the runtime. - Limited type information in ref assemblies. - - In the ref assemblies generated by dotnet/runtime, we save space and prevent users from relying on private implementation details of structures by emitting limited information about their fields. Structures that have at least one non-object field are given a private `int` field, and structures that have at least one field that transitively contains an object are given one private `object`-typed field. As a result, we do not have full type information at code-generation time for any structures defined in the BCL when compiling a library that uses the ref assemblies. + - In the ref assemblies generated by dotnet/arcade's GenAPI (used in dotnet/runtime), we save space and prevent users from relying on private implementation details of structures by emitting limited information about their fields. Structures that have at least one non-object field are given a private `int` field, and structures that have at least one field that transitively contains an object are given one private `object`-typed field. As a result, we do not have full type information at code-generation time for any structures defined in the BCL when compiling a library that uses the ref assemblies. - Private reflection - Even when we do have information about all of the fields, we can't emit code that references them if they are private, so we would have to emit unsafe code and calculate offsets manually to support marshaling them. @@ -19,16 +20,13 @@ We've been working around another problem for a while in the runtime-integrated I propose an opt-in design where the owner of a struct has to explicitly opt-in to usage for interop. This enables our team to add special support as desired for various types such as `Span` while also avoiding the private reflection and limited type information issues mentioned above. -This design would use these attributes: +All design options would use these attributes: ```csharp [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)] public class GeneratedMarshallingAttribute : Attribute {} -[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)] -public class BlittableTypeAttribute : Attribute {} - [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)] public class NativeMarshallingAttribute : Attribute { @@ -42,7 +40,7 @@ public class MarshalUsingAttribute : Attribute } ``` -The `NativeMarshallingAttribute` and `MarshalUsingAttribute` attributes would require that the provided native type `TNative` is a blittable `struct` and has a subset of three methods with the following names and shapes (with the managed type named TManaged): +The `NativeMarshallingAttribute` and `MarshalUsingAttribute` attributes would require that the provided native type `TNative` is a `struct` that does not require any marshalling and has a subset of three methods with the following names and shapes (with the managed type named TManaged): ```csharp partial struct TNative @@ -59,7 +57,7 @@ The analyzer will report an error if neither the constructor nor the `ToManaged` > :question: Does this API surface and shape work for all marshalling scenarios we plan on supporting? It may have issues with the current "layout class" by-value `[Out]` parameter marshalling where the runtime updates a `class` typed object in place. We already recommend against using classes for interop for performance reasons and a struct value passed via `ref` or `out` with the same members would cover this scenario. -If the native type `TNative` also has a public `Value` property, then the value of the `Value` property will be passed to native code instead of the `TNative` value itself. As a result, the type `TNative` will be allowed to be non-blittable and the type of the `Value` property will be required to be blittable. If the `Value` property is settable, then when marshalling in the native-to-managed direction, a default value of `TNative` will have its `Value` property set to the native value. If `Value` does not have a setter, then marshalling from native to managed is not supported. +If the native type `TNative` also has a public `Value` property, then the value of the `Value` property will be passed to native code instead of the `TNative` value itself. As a result, the type `TNative` will be allowed to require marshalling and the type of the `Value` property will be required be passable to native code without any additional marshalling. If the `Value` property is settable, then when marshalling in the native-to-managed direction, a default value of `TNative` will have its `Value` property set to the native value. If `Value` does not have a setter, then marshalling from native to managed is not supported. If a `Value` property is provided, the developer may also provide a ref-returning or readonly-ref-returning `GetPinnableReference` method. The `GetPinnableReference` method will be called before the `Value` property getter is called. The ref returned by `GetPinnableReference` will be pinned with a `fixed` statement, but the pinned value will not be used (it acts exclusively as a side-effect). @@ -90,7 +88,7 @@ public struct TMarshaler #### Pinning -Since C# 7.3 added a feature to enable custom pinning logic for user types, we should also add support for custom pinning logic. If the user provides a `GetPinnableReference` method on the managed type that matches the requirements to be used in a `fixed` statement and the pointed-to type is blittable, then we will support using pinning to marshal the managed value when possible. The analyzer should issue a warning when the pointed-to type would not match the final native type, accounting for the `Value` property on the native type. Since `MarshalUsingAttribute` is applied at usage time instead of at type authoring time, we will not enable the pinning feature since the implementation of `GetPinnableReference` is likely designed to match the default marshalling rules provided by the type author, not the rules provided by the marshaller provided by the `MarshalUsingAttribute`. +Since C# 7.3 added a feature to enable custom pinning logic for user types, we should also add support for custom pinning logic. If the user provides a `GetPinnableReference` method on the managed type that matches the requirements to be used in a `fixed` statement and the pointed-to type would not require any additional marshalling, then we will support using pinning to marshal the managed value when possible. The analyzer should issue a warning when the pointed-to type would not match the final native type, accounting for the `Value` property on the native type. Since `MarshalUsingAttribute` is applied at usage time instead of at type authoring time, we will not enable the pinning feature since the implementation of `GetPinnableReference` is likely designed to match the default marshalling rules provided by the type author, not the rules provided by the marshaller provided by the `MarshalUsingAttribute`. #### Caller-allocated memory @@ -111,27 +109,18 @@ When these members are present, the source generator will call the two-parameter Type authors can pass down the `buffer` pointer to native code by defining a `Value` property that returns a pointer to the first element, generally through code using `MemoryMarshal.GetReference()` and `Unsafe.AsPointer`. If `RequiresStackBuffer` is not provided or set to `false`, the `buffer` span must be pinned to be used safely. The `buffer` span can be pinned by defining a `GetPinnableReference()` method on the native type that returns a reference to the first element of the span. -### Usage - -There are 2 usage mechanisms of these attributes. - -#### Usage 1, Source-generated interop - -The user can apply the `GeneratedMarshallingAttribute` to their structure `S`. The source generator will determine if the type is blittable. If it is blittable, the source generator will generate a partial definition and apply the `BlittableTypeAttribute` to the struct type `S`. Otherwise, it will generate a blittable representation of the struct with the aformentioned required shape and apply the `NativeMarshallingAttribute` and point it to the blittable representation. The blittable representation can either be generated as a separate top-level type or as a nested type on `S`. +### Determining if a type is doesn't need marshalling -#### Usage 2, Manual interop - -The user may want to manually mark their types as marshalable in this system due to specific restrictions in their code base around marshaling specific types that the source generator does not account for. We could also use this internally to support custom types in source instead of in the code generator. In this scenario, the user would apply either the `BlittableTypeAttribute` or the `NativeMarshallingAttribute` attribute to their struct type. An analyzer would validate that the struct is blittable if the `BlittableTypeAttribute` is applied or validate that the native struct type is blittable and has marshalling methods of the required shape when the `NativeMarshallingAttribute` is applied. - -The P/Invoke source generator (as well as the struct source generator when nested struct types are used) would use the `BlittableTypeAttribute` and `NativeMarshallingAttribute` to determine how to marshal a value type parameter or field instead of looking at the fields of the struct directly. +For this design, we need to decide how to determine a type doesn't need to be marshalled and already has a representation we can pass directly to native code - that is, we need a definition for "does not require marshalling". We have two designs that we have experimented with below, and we have decided to go with design 2. -If a structure type does not have either the `BlittableTypeAttribute` or the `NativeMarshallingAttribute` applied at the type definition, the user can supply a `MarshalUsingAttribute` at the marshalling location (field, parameter, or return value) with a native type matching the same requirements as `NativeMarshallingAttribute`'s native type. - -All generated stubs will be marked with [`SkipLocalsInitAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.compilerservices.skiplocalsinitattribute) on supported frameworks. This does require attention when performing custom marshalling as the state of stub allocated memory will be in an undefined state. +#### Design 1: Introducing `BlittableTypeAttribute` -### Why do we need `BlittableTypeAttribute`? +Traditionally, the concept of "does not require marshalling" is referred to as "blittable". The built-in runtime marshalling system has an issue as mentioned above that the concept of `unmanaged` is not the same as the concept of `blittable`. Additionally, due to the ref assembly issue above, we cannot rely on ref assemblies to have accurate information in terms of fields of a type. To solve these issues in combination with the desire to enable manual interop, we need to provide a way for users to signal that a given type should be blittable and that the source generator should not generate marshalling code. We'll introduce a new attribute, the `BlittableTypeAttribute`: -Based on the design above, it seems that we wouldn't need `BlittableTypeAttribute`. However, due to the ref assembly issue above in combination with the desire to enable manual interop, we need to provide a way for users to signal that a given type should be blittable and that the source generator should not generate marshalling code. +```csharp +[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)] +public class BlittableTypeAttribute : Attribute {} +``` I'll give a specific example for where we need the `BlittableTypeAttribute` below. Let's take a scenario where we don't have `BlittableTypeAttribute`. @@ -210,7 +199,7 @@ When the source generator (either Struct, P/Invoke, Reverse P/Invoke, etc.) enco If someone actively disables the analyzer or writes their types in IL, then they have stepped out of the supported scenarios and marshalling code generated for their types may be inaccurate. -#### Exception: Generics +##### Exception: Generics Because the Roslyn compiler needs to be able to validate that there are not recursive struct definitions, reference assemblies have to contain a field of a type parameter type in the reference assembly if they do in the runtime assembly. As a result, we can inspect private generic fields reliably. @@ -221,6 +210,32 @@ To enable blittable generics support in this struct marshalling model, we extend Since all fields typed with non-parameterized types are validated to be blittable at type definition time, we know that they are all blittable at type usage time. So, we only need to validate that the generic fields are instantiated with blittable types. +#### Design 2: [`DisableRuntimeMarshallingAttribute`](https://github.com/dotnet/runtime/issues/60639) + +As an alternative design, we can use a different definition of "does not require marshalling". This design proposes changing the definition from "the runtime's definition of blittable" to "types considered `unmanaged` in C#". The `DisableRuntimeMarshallingAttribute` attribute helps us solve this problem. When applied to an assembly, this attribute causes the runtime to not do any marshalling for any types that are `unmanaged` types and do not have any auto-layout fields for all P/Invokes in the assembly; this includes when the types do not fit the runtime's definition of "blittable". This definition of "does not require marshalling" will work for all of our scenarios, with one issue listed below. + +For the auto-layout clause, we have one small issue; today, our ref-assemblies do not expose if a value type is marked as `[StructLayout(LayoutKind.Auto)]`, so we'd still have some cases where we might have runtime failures. However, we can update the tooling used in dotnet/runtime, GenAPI, to expose this information if we so desire. Once that case is handled, we have a mechanism that we can safely use to determine, at compile time, which types will not require marshalling. If we decide to not cover this case (as cases where users mark types as `LayoutKind.Auto` manually are exceptionally rare), we still have a solid design as Roslyn will automatically determine for us if a type is `unmanaged`, so we don't need to do any additional work. + +As `unmanaged` is a C# language concept, we can use Roslyn's APIs to determine if a type is `unmanaged` to determine if it does not require marshalling without needing to define any new attributes and reshape the ecosystem. However, to enable this work, the DllImportGenerator, as well as any other source generators that generate calls to native code using the interop team's infrastructure, will need to require that the user applies the `DisableRuntimeMarshallingAttribute` to their assembly when custom user-defined types are used. As we believe that users should be able to move over their assemblies to the new source-generated interop world as a whole assembly, we do not believe that this will cause any serious issues in adoption. To help support users in this case, the interop team will provide a code-fix that will generate the `DisableRuntimeMarshallingAttribute` for users when they use the source generator. + +### Usage + +There are 2 usage mechanisms of these attributes. + +#### Usage 1, Source-generated interop + +The user can apply the `GeneratedMarshallingAttribute` to their structure `S`. The source generator will determine if the type requires marshalling. If it does, it will generate a representation of the struct that does not require marshalling with the aformentioned required shape and apply the `NativeMarshallingAttribute` and point it to that new type. This generated representation can either be generated as a separate top-level type or as a nested type on `S`. + +#### Usage 2, Manual interop + +The user may want to manually mark their types as marshalable with custom marshalling rules in this system due to specific restrictions in their code base around marshaling specific types that the source generator does not account for. We could also use this internally to support custom types in source instead of in the code generator. In this scenario, the user would apply either the `NativeMarshallingAttribute` attribute to their struct type. An analyzer would validate that the native struct type does not require marshalling and has marshalling methods of the required shape when the `NativeMarshallingAttribute` is applied. + +The P/Invoke source generator (as well as the struct source generator when nested struct types are used) would use the `NativeMarshallingAttribute` to determine how to marshal a parameter or field with an unknown type. + +If a structure type does not meet the requirements to not require marshalling or does not have the `NativeMarshallingAttribute` applied at the type definition, the user can supply a `MarshalUsingAttribute` at the marshalling location (field, parameter, or return value) with a native type matching the same requirements as `NativeMarshallingAttribute`'s native type. + +All generated stubs will be marked with [`SkipLocalsInitAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.compilerservices.skiplocalsinitattribute) on supported frameworks. This does require attention when performing custom marshalling as the state of stub allocated memory will be in an undefined state. + ### Special case: Transparent Structures There has been discussion about Transparent Structures, structure types that are treated as their underlying types when passed to native code. The support for a `Value` property on a generated marshalling type supports the transparent struct support. For example, we could support strongly typed `HRESULT` returns with this model as shown below: @@ -250,7 +265,7 @@ struct HRESULT In this case, the underlying native type would actually be an `int`, but the user could use the strongly-typed `HResult` type as the public surface area. -> :question: Should we support transparent structures on manually annotated blittable types? If we do, we should do so in an opt-in manner to make it possible to have a `Value` property on the blittable type. +> :question: Should we support transparent structures on manually annotated types that wouldn't need marshalling otherwise? If we do, we should do so in an opt-in manner to make it possible to have a `Value` property on the type without assuming that it is for interop in all cases. #### Example: ComWrappers marshalling with Transparent Structures diff --git a/docs/design/mono/debugger.md b/docs/design/mono/debugger.md index 3a3a2936b79eb4..2268d81bf1047b 100644 --- a/docs/design/mono/debugger.md +++ b/docs/design/mono/debugger.md @@ -18,4 +18,11 @@ Web Assembly Debugger supports usage of following attributes: - Stepping In/Over: results in an additional stepping need to proceed to the next line.

- __System.Diagnostics.DebuggerDisplay__ - __System.Diagnostics.DebuggerTypeProxy__ -- ... \ No newline at end of file +- __System.Diagnostics.DebuggerBrowsable__ ([doc](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerbrowsableattribute?view=net-6.0)) + - Collapsed - displayed normally. + - RootHidden: + - Simple type - not displayed in the debugger window. + - Collection / Array - the values of a collection are displayed in a flat view, using the naming convention: *rootName[idx]*. + + - Never - not displayed in the debugger window. + diff --git a/docs/pr-builds.md b/docs/pr-builds.md new file mode 100644 index 00000000000000..f5f7555ae7e675 --- /dev/null +++ b/docs/pr-builds.md @@ -0,0 +1,94 @@ +## PR Builds +When submitting a PR to the `dotnet/runtime` repository various builds will run validation in many areas to ensure we keep productivity and quality high. + +The `dotnet/runtime` validation system can become overwhelming as we need to cover a lot of build scenarios and test in all the platforms that we support. In order to try to make this more reliable and spend the least amount of time testing what the PR changes need we have various pipelines, required and optional that are covered in this document. + +Most of the repository pipelines use a custom mechanism to evaluate paths based on the changes contained in the PR to try and build/test the least that we can without compromising quality. This is the initial step on every pipeline that depends on this infrastructure, called "Evalute Paths". In this step you can see the result of the evaluation for each subset of the repository. For more details on which subsets we have based on paths see [here](https://github.com/dotnet/runtime/blob/513fe2863ad5ec6dc453d223d4b60f787a0ffa78/eng/pipelines/common/evaluate-default-paths.yml). Also to understand how this mechanism works you can read this [comment](https://github.com/dotnet/runtime/blob/513fe2863ad5ec6dc453d223d4b60f787a0ffa78/eng/pipelines/evaluate-changed-paths.sh#L3-L12). + +### Runtime pipeline +This is the "main" pipeline for the runtime product. In this pipeline we include the most critical tests and platforms where we have enough test resources in order to deliver test results in a reasonable amount of time. The tests executed in this pipeline for runtime and libraries are considered innerloop, are the tests that are executed locally when one runs tests locally. + +For mobile platforms and wasm we run some smoke tests that aim to protect the quality of these platforms. We had to move to a smoke test approach given the hardware and time limitations that we encountered and contributors were affected by this with unstability and long wait times for their PRs to finish validation. + +### Runtime-dev-innerloop pipeline +This pipeline is also required, and its intent is to cover a developer innerloop scenarios that could be affected by any change, like running a specific build command or running tests inside Visual Studio, etc. + +### Dotnet-linker-tests +This is also a required pipeline. The purpose of this pipeline is to test that the libraries code is linker friendly. Meaning that when we trim our libraries using the ILLink, we don't have any trimming bugs, like a required method on a specific scenario is trimmed away by accident. + +### Runtime-staging +This pipeline runs on every change, however it behaves a little different than the other pipelines. This pipeline, will not fail if there are test failures, however it will fail if there is a timeout or a build failure. The reason why we fail on build failures is because we want to protect the developer innerloop (building the repository) for this platform. + +The tests will not fail because the intent of this platform is to stage new platforms where the test infrastructure is new and we need to test if we have enough capacity to include that new platform on the "main" runtime pipeline without causing flakiness. Once we analyze data and a platform is stable when running on PRs in this pipeline for at least a weak it can be promoted either to the `runtime-extra-platforms` pipeline or to the `runtime` pipeline. + +### Runtime-extra-platforms +This pipeline does not run by default as it is not required for a PR, but it runs twice a day, and it can also be invoked in specific PRs by commenting `/azp run runtime-extra-platforms`. However, this pipeline is still an important part of our testing. + +This pipeline runs innerloop tests on platforms where we don't have enough hardware capacity to run tests (mobile, browser) or on platforms where we believe tests should organically pass based on the coverage we have in the "main" runtime pipeline. For example, in the "main" pipeline we run tests on Ubuntu 21.10 but since we also support Ubuntu 18.04 which is an LTS release, we run tests on Ubuntu 18.04 of this pipeline just to make sure we have healthy tests on those platforms which we are releasing a product for. + +Another concrete scenario would be windows arm64 for libraries tests. Where we don't have enough hardware, but the JIT is the most important piece to test as that is what generates the native code to run on that platform, so we run JIT tests on arm64 in the "main" pipeline, but our libraries tests are only run on the `runtime-extra-platforms` pipeline. + +### Outerloop pipelines +We have various pipelines that their names contain `Outerloop` on them. These pipelines will not run by default on every PR, they can also be invoked using the `/azp run` comment and will run on a daily basis to analyze test results. + +These pipelines will run tests that take very long, that are not very stable (i.e some networking tests), or that modify machine state. Such tests are called `Outerloop` tests rather than `innerloop`. + +## Rerunning Validation + +Validation may fail for several reasons: + +### Option 1: You have a defect in your PR + +* Simply push the fix to your PR branch, and validation will start over. + +### Option 2: There is a flaky test that is not related to your PR + +* Your assumption should be that a failed test indicates a problem in your PR. (If we don't operate this way, chaos ensues.) If the test fails when run again, it is almost surely a failure caused by your PR. However, there are occasions where unrelated failures occur. Here's some ways to know: + * Perhaps you see the same failure in CI results for unrelated active PR's. + * It's a known issue listed in our [big tracking issue](https://github.com/dotnet/runtime/issues/702) or tagged `blocking-clean-ci` [(query here)](https://github.com/dotnet/runtime/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Ablocking-clean-ci+) + * It's otherwise beyond any reasonable doubt that your code changes could not have caused this. + * If the tests pass on rerun, that may suggest it's not related. +* In this situation, you want to re-run but not necessarily rebase on main. + * To rerun just the failed leg(s): + * Click on any leg. Navigate through the Azure DevOps UI, find the "..." button and choose "Retry failed legs" + * Or, on the GitHub Checks tab choose "re-run failed checks". This will not rebase your change. + * To rerun all validation: + * Add a comment `/azp run runtime` + * Or, click on "re-run all checks" in the GitHub Checks tab + * Or, simply close and reopen the PR. +* If you have established that it is an unrelated failure, please ensure we have an active issue for it. See the [unrelated failure](#what-to-do-if-you-determine-the-failure-is-unrelated) section below. +* Whoever merges the PR should be satisfied that the failure is unrelated, is not introduced by the change, and that we are appropriately tracking it. + +### Option 3: The state of the main branch HEAD is bad. + +* This is the very rare case where there was a build break in main, and you got unlucky. Hopefully the break has been fixed, and you want CI to rebase your change and rerun validation. +* To rebase and rerun all validation: + * Add a comment `/azp run runtime` + * Or, click on "re-run all checks" in the GitHub Checks tab + * Or, simply close and reopen the PR. + * Or, ammend your commit with `--amend --no-edit` and force push to your branch. + +### Additional information: + * You can list the available pipelines by adding a comment like `/azp list` or get the available commands by adding a comment like `azp help`. + * In the rare case the license/cla check fails to register a response, it can be rerun by issuing a GET request to `https://cla.dotnetfoundation.org/check/dotnet/runtime?pullRequest={pr_number}`. A successful response may be a redirect to `https://github.com`. + * Reach out to the infrastructure team for assistance on [Teams channel](https://teams.microsoft.com/l/channel/19%3ab27b36ecd10a46398da76b02f0411de7%40thread.skype/Infrastructure?groupId=014ca51d-be57-47fa-9628-a15efcc3c376&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) (for corpnet users) or on [Gitter](https://gitter.im/dotnet/community) in other cases. + +## What to do if you determine the failure is unrelated + +If you have determined the failure is definitely not caused by changes in your PR, please do this: + +* Search for an [existing issue](https://github.com/dotnet/runtime/issues). Usually the test method name or (if a crash/hang) the test assembly name are good search parameters. + * If there's an existing issue, add a comment with + * a) the link to the build + * b) the affected configuration (ie `net6.0-windows-Release-x64-Windows.81.Amd64.Open`) + * c) all console output including the error message and stack trace from the Azure DevOps tab (This is necessary as retention policies are in place that recycle old builds.) + * d) if there's a dump file (see Attachments tab in Azure DevOps) include that + * If the issue is already closed, reopen it and update the labels to reflect the current failure state. + * If there's no existing issue, create an issue with the same information listed above. + * Update the original pull request with a comment linking to the new or existing issue. +* In a follow-up Pull Request, disable the failing test(s) with the corresponding issue link tracking the disable. + * Update the tracking issue with the label `disabled-test`. + * For libraries tests add a [`[ActiveIssue(link)]`](https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.XUnitExtensions/src/Attributes/ActiveIssueAttribute.cs) attribute on the test method. You can narrow the disabling down to runtime variant, flavor, and platform. For an example see [File_AppendAllLinesAsync_Encoded](https://github.com/dotnet/runtime/blob/cf49643711ad8aa4685a8054286c1348cef6e1d8/src/libraries/System.IO.FileSystem/tests/File/AppendAsync.cs#L74) + * For runtime tests found under `src/tests`, please edit [`issues.targets`](https://github.com/dotnet/runtime/blob/main/src/tests/issues.targets). There are several groups for different types of disable (mono vs. coreclr, different platforms, different scenarios). Add the folder containing the test and issue mimicking any of the samples in the file. + +There are plenty of possible bugs, e.g. race conditions, where a failure might highlight a real problem and it 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. \ No newline at end of file diff --git a/docs/pr-guide.md b/docs/pr-guide.md index b250efd6e12dd9..eb7dea7a01ba7e 100644 --- a/docs/pr-guide.md +++ b/docs/pr-guide.md @@ -24,71 +24,10 @@ Anyone with write access can merge a pull request manually or by setting the [au * The PR has been approved by at least one reviewer and any other objections are addressed. * You can request another review from the original reviewer. -* The PR successfully builds and passes all tests in the Continuous Integration (CI) system. - * Depending on your change, you may need to re-run validation. See [rerunning validation](#rerunning-validation) below. +* The PR successfully builds and passes all tests in the Continuous Integration (CI) system. For more information please read to our [PR Builds](pr-builds.md) doc. Typically, PRs are merged as one commit. It creates a simpler history than a Merge Commit. "Special circumstances" are rare, and typically mean that there are a series of cleanly separated changes that will be too hard to understand if squashed together, or for some reason we want to preserve the ability to bisect them. -## Rerunning Validation - -Validation may fail for several reasons: - -### Option 1: You have a defect in your PR - -* Simply push the fix to your PR branch, and validation will start over. - -### Option 2: There is a flaky test that is not related to your PR - -* Your assumption should be that a failed test indicates a problem in your PR. (If we don't operate this way, chaos ensues.) If the test fails when run again, it is almost surely a failure caused by your PR. However, there are occasions where unrelated failures occur. Here's some ways to know: - * Perhaps you see the same failure in CI results for unrelated active PR's. - * It's a known issue listed in our [big tracking issue](https://github.com/dotnet/runtime/issues/702) or tagged `blocking-clean-ci` [(query here)](https://github.com/dotnet/runtime/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Ablocking-clean-ci+) - * Its otherwise beyond any reasonable doubt that your code changes could not have caused this. - * If the tests pass on rerun, that may suggest it's not related. -* In this situation, you want to re-run but not necessarily rebase on main. - * To rerun just the failed leg(s): - * Click on any leg. Navigate through the Azure DevOps UI, find the "..." button and choose "Retry failed legs" - * Or, on the GitHub Checks tab choose "re-run failed checks". This will not rebase your change. - * To rerun all validation: - * Add a comment `/azp run runtime` - * Or, click on "re-run all checks" in the GitHub Checks tab - * Or, simply close and reopen the PR. -* If you have established that it is an unrelated failure, please ensure we have an active issue for it. See the [unrelated failure](#what-to-do-if-you-determine-the-failure-is-unrelated) section below. -* Whoever merges the PR should be satisfied that the failure is unrelated, is not introduced by the change, and that we are appropriately tracking it. - -### Option 3: The state of the main branch HEAD is bad. - -* This is the very rare case where there was a build break in main, and you got unlucky. Hopefully the break has been fixed, and you want CI to rebase your change and rerun validation. -* To rebase and rerun all validation: - * Add a comment `/azp run runtime` - * Or, click on "re-run all checks" in the GitHub Checks tab - * Or, simply close and reopen the PR. - * Or, ammend your commit with `--amend --no-edit` and force push to your branch. - -### Additional information: - * You can list the available pipelines by adding a comment like `/azp list` or get the available commands by adding a comment like `azp help`. - * In the rare case the license/cla check fails to register a response, it can be rerun by issuing a GET request to `https://cla.dotnetfoundation.org/check/dotnet/runtime?pullRequest={pr_number}`. A successful response may be a redirect to `https://github.com`. - * Reach out to the infrastructure team for assistance on [Teams channel](https://teams.microsoft.com/l/channel/19%3ab27b36ecd10a46398da76b02f0411de7%40thread.skype/Infrastructure?groupId=014ca51d-be57-47fa-9628-a15efcc3c376&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) (for corpnet users) or on [Gitter](https://gitter.im/dotnet/community) in other cases. - -## What to do if you determine the failure is unrelated - -If you have determined the failure is definitely not caused by changes in your PR, please do this: - -* Search for an [existing issue](https://github.com/dotnet/runtime/issues). Usually the test method name or (if a crash/hang) the test assembly name are good search parameters. - * If there's an existing issue, add a comment with - * a) the link to the build - * b) the affected configuration (ie `net6.0-windows-Release-x64-Windows.81.Amd64.Open`) - * c) all console output including the error message and stack trace from the Azure DevOps tab (This is necessary as retention policies are in place that recycle old builds.) - * d) if there's a dump file (see Attachments tab in Azure DevOps) include that - * If the issue is already closed, reopen it and update the labels to reflect the current failure state. - * If there's no existing issue, create an issue with the same information listed above. - * Update the original pull request with a comment linking to the new or existing issue. -* In a follow-up Pull Request, disable the failing test(s) with the corresponding issue link tracking the disable. - * Update the tracking issue with the label `disabled-test`. - * For libraries tests add a [`[ActiveIssue(link)]`](https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.XUnitExtensions/src/Attributes/ActiveIssueAttribute.cs) attribute on the test method. You can narrow the disabling down to runtime variant, flavor, and platform. For an example see [File_AppendAllLinesAsync_Encoded](https://github.com/dotnet/runtime/blob/a259ec2e967d502f82163beba6b84da5319c5e08/src/libraries/System.IO.FileSystem/tests/File/AppendAsync.cs#L899) - * For runtime tests found under `src/tests`, please edit [`issues.targets`](https://github.com/dotnet/runtime/blob/main/src/tests/issues.targets). There are several groups for different types of disable (mono vs. coreclr, different platforms, different scenarios). Add the folder containing the test and issue mimicking any of the samples in the file. - -There are plenty of possible bugs, e.g. race conditions, where a failure might highlight a real problem and it 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. - ## Blocking Pull Request Merging If for whatever reason you would like to move your pull request back to an in-progress status to avoid merging it in the current form, you can do that by adding [WIP] prefix to the pull request title. diff --git a/docs/project/glossary.md b/docs/project/glossary.md index cb7e0b21538b8c..9104049e947ec1 100644 --- a/docs/project/glossary.md +++ b/docs/project/glossary.md @@ -43,7 +43,7 @@ terminology. | SDK | Software Development Kit. The [.NET SDK](https://docs.microsoft.com/dotnet/core/sdk) contains the .NET CLI, .NET libraries and runtime, and the dotnet driver. | | SEH | [Structured Exception Handling](https://docs.microsoft.com/windows/win32/debug/structured-exception-handling). Unified mechanism for handling hardware and software exceptions on Windows. | | SOS | [Son of Strike](https://docs.microsoft.com/archive/blogs/jasonz/sos-debugging-of-the-clr-part-1). The debugging extension for DbgEng based debuggers. Uses the DAC as an abstraction layer for its operation. | -| SuperPMI | JIT component test framework (super fast JIT testing - it mocks/replays EE in EE-JIT interface) - see [SuperPMI details](https://github.com/dotnet/runtime/blob/main/src/coreclr/ToolBox/superpmi/readme.txt). | +| SuperPMI | JIT component test framework (super fast JIT testing - it mocks/replays EE in EE-JIT interface) - see [SuperPMI details](https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/superpmi/readme.md). | | SVR | The CLR used to be built as two variants, with one called "mscorsvr.dll", to mean the "server" version. In particular, it contained the server GC implementation, which was intended for multi-threaded apps capable of taking advantage of multiple processors. In the .NET Framework 2 release, the two variants were merged into "mscorwks.dll". The WKS version was the default, however the SVR version remained available. | | TFM | [Target Framework Moniker](https://docs.microsoft.com/dotnet/standard/frameworks) such as `net6.0` or `netstandard2.0`. | | TPA | Trusted Platform Assemblies used to be a special set of assemblies that comprised the platform assemblies, when it was originally designed. As of today, it is simply the set of assemblies known to constitute the application. | diff --git a/docs/workflow/Codespaces.md b/docs/workflow/Codespaces.md index 391cd4087429e6..858da337216f25 100644 --- a/docs/workflow/Codespaces.md +++ b/docs/workflow/Codespaces.md @@ -5,13 +5,11 @@ Codespaces allows you to develop in a Docker container running in the cloud. You dotnet/runtime runs a nightly GitHub Action to build the latest code in the repo. This allows you to immediately start developing and testing after creating a codespace without having to build the whole repo. When the machine is created, it will have built the repo using the code as of 6 AM UTC that morning. -**NOTE**: In order to use a prebuilt codespace, when you create your machine be sure to select an **`8 core`** machine. - 1. From https://github.com/dotnet/runtime, drop-down the `Code` button and select the `Codespaces` tab. ![New codespace button](https://docs.github.com/assets/images/help/codespaces/new-codespace-button.png) -2. Select `8-core` for the Machine type. This will ensure you get a "pre built" image. +2. Select the Machine type. For dotnet/runtime, it is recommended to select at least a `4-core` machine. You can also verify that a "Prebuild" is ready. ![Codespace machine size](./codespace-machine-size.png) diff --git a/docs/workflow/building/coreclr/osx-instructions.md b/docs/workflow/building/coreclr/osx-instructions.md index d8bf4fe604fcb8..41e8d87de1a7ec 100644 --- a/docs/workflow/building/coreclr/osx-instructions.md +++ b/docs/workflow/building/coreclr/osx-instructions.md @@ -1,49 +1,12 @@ -Build CoreCLR on OS X +Build CoreCLR on macOS ===================== -This guide will walk you through building CoreCLR on OS X. We'll start by showing how to set up your environment from scratch. +This guide will walk you through building CoreCLR on macOS. We'll start by showing how to set up your environment from scratch. Environment =========== -These instructions were validated on macOS 10.12. Sierra. On older versions coreFX will fail to build properly because of SSL API changes. - -If your machine has Command Line Tools for XCode 6.3 installed, you'll need to update them to the 6.3.1 version or higher in order to successfully build. There was an issue with the headers that shipped with version 6.3 that was subsequently fixed in 6.3.1. - -Git Setup ---------- - -Clone the CoreCLR and CoreFX repositories (either upstream or a fork). - -```sh -git clone https://github.com/dotnet/runtime -# Cloning into 'runtime'... -``` - -CMake ------ - -CoreCLR has a dependency on CMake for the build. You can install it with [Homebrew](https://brew.sh/). - -```sh -brew install cmake -``` - -ICU ---- -ICU (International Components for Unicode) is also required to build and run. It can be obtained via [Homebrew](https://brew.sh/). - -```sh -brew install icu4c -``` - -pkg-config ----------- -pkg-config is also required to build. It can be obtained via [Homebrew](https://brew.sh/). - -```sh -brew install pkg-config -``` +Ensure you have all of the prerequisites installed from the [macOS Requirements](/docs/workflow/requirements/macos-requirements.md). Build the Runtime and System.Private.CoreLib ============================================ diff --git a/docs/workflow/codespace-machine-size.png b/docs/workflow/codespace-machine-size.png index 07945fb9ff672d..d0687c85b05f36 100644 Binary files a/docs/workflow/codespace-machine-size.png and b/docs/workflow/codespace-machine-size.png differ diff --git a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md index 048d571df45f21..d21fa21a5cb77b 100644 --- a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md +++ b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md @@ -19,7 +19,7 @@ Built in debugging aids in the managed compilers --------------------------------- - When debugging a multi-threaded component of the compiler and not investigating a multi-threading issue itself, it is generally advisable to disable the use of multiple threads. -To do this use the `--parallelism 1` switch (for crossgen2) or `--singlethreaded` (for ILC) to specify that the maximum parallelism of the process shall be 1. +To do this use the `--parallelism 1` switch to specify that the maximum parallelism of the process shall be 1. - When debugging the behavior of compiling a single method, the compiler may be instructed to only compile a single method. This is done via the various --singlemethod options @@ -172,3 +172,7 @@ devenv /debugexe C:\git2\runtime\.dotnet\dotnet.exe "c:\git2\runtime\artifacts\t ``` This will launch the Visual Studio debugger, with a solution setup for debugging the dotnet.exe process. By default this solution will debug the native code of the process only. To debug the managed components, edit the properties on the solution and set the `Debugger Type` to `Managed (.NET Core, .NET 5+)` or `Mixed (.NET Core, .NET 5+)`. + +# Debugging compilation graph + +The AOT compilation is driven by a dependency graph. If you need to troubleshoot the dependency graph (to figure out why something was or wasn't generated) you can follow [this guide](debuging-compiler-dependency-analysis.md) diff --git a/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md b/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md new file mode 100644 index 00000000000000..cc918c391f62a1 --- /dev/null +++ b/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md @@ -0,0 +1,47 @@ +Debugging Compiler Dependency Analysis +============================ + +The general technique is to identify what node is missing from the graph or is erroneously present in the graph, and change the dependency analysis logic to adjust the graph. This document describes the various ways of debugging to identify what's happening. + +Analysis techniques for the dependency graph. +1. Use the DependencyGraphViewer tool (if running on Windows). This tool is located in `src/coreclr/tools/aot/DependencyGraphViewer` + - This is the only convenient way to examine the graph while also simultaneously debugging the compiler. + - While this is currently Windows only due to use of WinForms, it would be fairly straightforward to make a command line based tool. + - Dependency graph does not support multiple simultaneous logging facilities, so make sure that you do not set IlcGenerateDgmlFile or invoke ILCompiler with the DGML generation turned on. +2. Pass command line switches to the compiler to generate a dependency graph dgml file. This will produce the same data as is viewable in the viewer tool, but in a textual xml format. + - Future efforts may make the xml file loadable by the viewer tool. +3. Instrument the compiler dependency analysis. (This may be necessary in cases where the viewer is unable to provide sufficient information about why the graph is structured as it is.) + +DependencyGraphViewer +==================================== + +This application allows viewing the dependency graph produced by the AOT compilation. + +Usage instructions: +1. Launch the process as an administrator +2. Run the compiler +- The compiler can be run to completion, or stopped. +3. Explore through the graph + +# Graphs View # +- Choose one of the graphs that appears in the Dependency Graphs view to explore. As compilers execute, new graphs will automatically appear here. +- The set of graphs loaded into the process is limited by available memory space. To clear the used memory, close all windows of the application. + +# Graph View # +- In the Dependency Graph view, enter a regular expression in the text box, and then press ""Filter"". This will display a list of the nodes in the graph which have names which match the regular expression. +- Commonly, if there is a object file symbol associated with the node it should be used as part of the regular expression. See the various implementations of GetName in the compiler for naming behavior. +- Additionally, the event source marking mode assigns an Id to each node, and that is found as the mark object on the node, so if a specific id is known, just type that in, and it will appear in the window. (This is for use when using this tool in parallel with debugging the compiler. + +# Single Node Exploration # +Once the interesting node(s) have been identified in the dependency graph window, select one of them, and then press Explore. + - In the Node Explorer window, the Dependent nodes (the ones which dependend on the current node are the nodes displayed above, and the Dependee nodes (the nodes that this node depends on) are displayed below. Each node in the list is paired with a textual reason as to why that edge in the graph exists. + - Select a node to explore further and press the corresponding button to make it happen. + +WhyDGML +======= +This tool can be used to visualize paths from a node of interest to the roots. To use it, pass command line option to the compiler to generate the DGML file (`--dgmllog name_of_output_file`) and then use this tool to find the path to the root. If you're looking at an optimized NativeAOT compilation, `--scandgmllog` might be preferable since it will have more details. +The input to the tool is the DGML file and name of a node of interest. The output is the list of reasons why that node was included. + +This tool located in folder `src/coreclr/tools/aot/WhyDgml` + +See https://github.com/dotnet/corert/pull/7962 for example of usage and output. diff --git a/docs/workflow/requirements/freebsd-requirements.md b/docs/workflow/requirements/freebsd-requirements.md index 941b949a252878..c14c1c1a27cf01 100644 --- a/docs/workflow/requirements/freebsd-requirements.md +++ b/docs/workflow/requirements/freebsd-requirements.md @@ -1,13 +1,12 @@ -Requirements to build dotnet/runtime on FreeBSD +Requirements to build and run dotnet/runtime on FreeBSD ===================== -This guide will walk you through the requirements needed to build dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch. +This guide will walk you through the requirements needed to build and run dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch. Since there is no official build and FreeBSD package, native build on FreeBSD is not trivial. There are generally three options, sorted by ease of use: - cross-compile on Linux using Docker - cross-compile on Linux using Toolchain - build on FreeBSD - Environment =========== @@ -65,3 +64,46 @@ sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake openssl nin Additionally, working dotnet cli with SDK is needed. On other platforms this would be downloaded automatically during build but it is not currently available for FreeBSD. It needs to be built once on supported platform or obtained via community resources. +Running on FreeBSD +------------------- +Install the following packages: +- icu +- libunwind +- lttng-ust (optional, debug support) +- krb5 +- openssl (optional, SSL support) +- libinotify +- terminfo-db (optional, terminal colors) + +The lines to install all the packages above using package manager. + +```sh +sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 openssl terminfo-db +``` + +Extract the SDK: +The canonical location for the SDK is `/usr/share/dotnet` + +"VERSION" is the SDK version being unpacked. + +```sh +sudo mkdir /usr/share/dotnet +tar xf /tmp/dotnet-sdk-VERSION-freebsd-x64.tar.gz -C /usr/share/dotnet/ +``` + +NuGet Packages: +The canonical location for the NuGet packages is `/var/cache/nuget` + +"VERSION" is the same version as the SDK from above. + +- Microsoft.NETCore.App.Host.freebsd-x64.VERSION.nupkg +- Microsoft.NETCore.App.Runtime.freebsd-x64.VERSION.nupkg +- Microsoft.AspNetCore.App.Runtime.freebsd-x64.VERSION.nupkg + +Add the following line to any `NuGet.config` you are using under the `` section: + +```xml + +``` + +Finally, either add `/usr/share/dotnet` to your PATH or create a symbolic for `/usr/share/dotnet/dotnet` diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig index 400c8c432c21bf..0fc9bf8e5a7eeb 100644 --- a/eng/CodeAnalysis.src.globalconfig +++ b/eng/CodeAnalysis.src.globalconfig @@ -1444,7 +1444,7 @@ dotnet_diagnostic.IDE0057.severity = suggestion dotnet_diagnostic.IDE0058.severity = silent # IDE0059: Unnecessary assignment of a value -dotnet_diagnostic.IDE0059.severity = suggestion +dotnet_diagnostic.IDE0059.severity = warning # IDE0060: Remove unused parameter dotnet_diagnostic.IDE0060.severity = silent diff --git a/eng/CodeAnalysis.test.globalconfig b/eng/CodeAnalysis.test.globalconfig index 572310d3b86d0a..f56a38cfa707c0 100644 --- a/eng/CodeAnalysis.test.globalconfig +++ b/eng/CodeAnalysis.test.globalconfig @@ -1681,7 +1681,7 @@ dotnet_diagnostic.xUnit2012.severity = warning dotnet_diagnostic.xUnit2013.severity = none # xUnit2014: Do not use throws check to check for asynchronously thrown exception -dotnet_diagnostic.xUnit2014.severity = warning +dotnet_diagnostic.xUnit2014.severity = none # xUnit2015: Do not use typeof expression to check the exception type dotnet_diagnostic.xUnit2015.severity = warning diff --git a/eng/Subsets.props b/eng/Subsets.props index f0bb31a28aea72..5ce54174451364 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -58,7 +58,7 @@
- clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs + clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.spmi clr.iltools+clr.packages @@ -112,6 +112,7 @@ + @@ -206,6 +207,10 @@ $(ClrRuntimeBuildSubsets);ClrNativeAotSubset=true + + $(ClrRuntimeBuildSubsets);ClrSpmiSubset=true + + @@ -243,7 +248,7 @@ - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e3a571f451cdea..af284815b19ecb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/icu - d9371f17932fbf828f1d1e2f21a99b64ba40eba5 + 4170ccfbbcada3e22aa4428a84524fabef006e38 https://github.com/dotnet/msquic @@ -16,239 +16,243 @@ https://github.com/dotnet/wcf 7f504aabb1988e9a093c1e74d8040bd52feb2f01 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + fe77708023f3d8a51c1548b86487a692897227ec - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 https://github.com/microsoft/vstest 140434f7109d357d0158ade9e5164a4861513965 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/llvm-project - 662aff66999c435aec09c58643e9fd703eadc3e0 + 79a6d232058e2c2f1d9e833355b72f07fe342a3b - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + ae2f60c950cc021921fce83c796cbcb5ff96c658 - + https://github.com/dotnet/linker - 41467d340a3345f08cb8ba67c20c1ea40c57682f + e485816b48273d03bd6266a64dad9bea97f861d5 - + https://github.com/dotnet/xharness - 7ad8d01a879af9437a7c33d01409bd761700cdad + 3060cda4543b80824a9238bcd176bb1a5af72044 - + https://github.com/dotnet/xharness - 7ad8d01a879af9437a7c33d01409bd761700cdad + 3060cda4543b80824a9238bcd176bb1a5af72044 - + + https://github.com/dotnet/xharness + 3060cda4543b80824a9238bcd176bb1a5af72044 + + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 9ffc76ac9f5799de9b28ee59f9bfbe0f8844d0d7 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -266,17 +270,17 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-optimization 91d6b3c1f51888d166701510189505f35714665c - + https://github.com/dotnet/hotreload-utils - f0d838421286fed81005fd4ddf6562555b641b3b + b6504c8dca937ff1a59d3283374241eacf26684a - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/roslyn-analyzers - e101c379c6e3c7011562ee3af3e3de066da0048f + f471d3381584f10f9908432e0b2b2b8ef07a0aa6 https://github.com/dotnet/sdk diff --git a/eng/Versions.props b/eng/Versions.props index 47d31b37c8e334..04f7adea4cff9d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,50 +42,50 @@ 3.11.0 - 4.0.0-4.final - 4.0.0-4.final + 4.0.1 + 4.0.1 3.3.2 - 4.0.0-4.final - 4.0.0-4.final - 7.0.0-preview1.21613.1 + 4.0.1 + 4.0.1 + 7.0.0-preview1.22068.2 2.0.0-alpha.1.21525.11 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 2.5.1-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 2.5.1-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 + 7.0.0-beta.22068.3 6.0.0-preview.1.102 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22066.4 + 7.0.0-alpha.1.22066.4 + 7.0.0-alpha.1.22066.4 3.1.0 - 7.0.0-alpha.1.21620.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 + 7.0.0-alpha.1.22066.4 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 + 1.0.0-alpha.1.22070.1 5.0.0 4.3.0 @@ -120,24 +120,24 @@ 5.0.0 5.0.0 4.9.0-rc2.21473.1 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22066.4 + 7.0.0-alpha.1.22066.4 4.5.4 4.5.0 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22066.4 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 1.0.0-prerelease.21577.2 1.0.0-prerelease.21577.2 @@ -160,12 +160,14 @@ 1.0.1-prerelease-00006 16.9.0-preview-20201201-01 - 1.0.0-prerelease.21622.1 - 1.0.0-prerelease.21622.1 - 1.0.2-alpha.0.21620.2 - 2.4.2-pre.9 + 1.0.0-prerelease.22067.1 + 1.0.0-prerelease.22067.1 + 1.0.0-prerelease.22067.1 + 1.0.2-alpha.0.22069.1 + 2.4.2-pre.22 + 0.12.0-pre.20 2.4.2 - 1.3.0 + 3.1.0 12.0.3 2.0.4 4.12.0 @@ -175,21 +177,21 @@ 6.0.0-preview-20211019.1 - 7.0.100-1.21620.1 + 7.0.100-1.22063.2 $(MicrosoftNETILLinkTasksVersion) - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22067.1 7.0.0-alpha.1.21529.3 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 - 11.1.0-alpha.1.21615.1 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 + 11.1.0-alpha.1.22067.2 7.0.0-alpha.1.21601.1 $(MicrosoftNETWorkloadEmscriptenManifest70100Version) diff --git a/eng/build.sh b/eng/build.sh index f1ef5958fdbc92..ea8e3089e95f4d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -17,7 +17,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" usage() { echo "Common settings:" - echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, s390x or wasm." + echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, loongarch64, s390x or wasm." echo " [Default: Your machine's architecture.]" echo " --binaryLog (-bl) Output binary log." echo " --cross Optional argument to signify cross compilation." @@ -206,12 +206,12 @@ while [[ $# > 0 ]]; do fi passedArch="$(echo "$2" | tr "[:upper:]" "[:lower:]")" case "$passedArch" in - x64|x86|arm|armel|arm64|s390x|wasm) + x64|x86|arm|armel|arm64|loongarch64|s390x|wasm) arch=$passedArch ;; *) echo "Unsupported target architecture '$2'." - echo "The allowed values are x86, x64, arm, armel, arm64, s390x, and wasm." + echo "The allowed values are x86, x64, arm, armel, arm64, loongarch64, s390x, and wasm." exit 1 ;; esac diff --git a/eng/common/cross/arm/tizen-build-rootfs.sh b/eng/common/cross/arm/tizen-build-rootfs.sh new file mode 100644 index 00000000000000..9fdb32e920e22c --- /dev/null +++ b/eng/common/cross/arm/tizen-build-rootfs.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -e + +__ARM_HARDFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +__TIZEN_CROSSDIR="$__ARM_HARDFP_CrossDir/tizen" + +if [[ -z "$ROOTFS_DIR" ]]; then + echo "ROOTFS_DIR is not defined." + exit 1; +fi + +TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp +mkdir -p $TIZEN_TMP_DIR + +# Download files +echo ">>Start downloading files" +VERBOSE=1 $__ARM_HARDFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR +echo "<>Start constructing Tizen rootfs" +TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` +cd $ROOTFS_DIR +for f in $TIZEN_RPM_FILES; do + rpm2cpio $f | cpio -idm --quiet +done +echo "<>Start configuring Tizen rootfs" +ln -sfn asm-arm ./usr/include/asm +patch -p1 < $__TIZEN_CROSSDIR/tizen.patch +echo "</dev/null; then + VERBOSE=0 +fi + +Log() +{ + if [ $VERBOSE -ge $1 ]; then + echo ${@:2} + fi +} + +Inform() +{ + Log 1 -e "\x1B[0;34m$@\x1B[m" +} + +Debug() +{ + Log 2 -e "\x1B[0;32m$@\x1B[m" +} + +Error() +{ + >&2 Log 0 -e "\x1B[0;31m$@\x1B[m" +} + +Fetch() +{ + URL=$1 + FILE=$2 + PROGRESS=$3 + if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then + CURL_OPT="--progress-bar" + else + CURL_OPT="--silent" + fi + curl $CURL_OPT $URL > $FILE +} + +hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; } +hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; } +hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; } + +TMPDIR=$1 +if [ ! -d $TMPDIR ]; then + TMPDIR=./tizen_tmp + Debug "Create temporary directory : $TMPDIR" + mkdir -p $TMPDIR +fi + +TIZEN_URL=http://download.tizen.org/snapshots/tizen +BUILD_XML=build.xml +REPOMD_XML=repomd.xml +PRIMARY_XML=primary.xml +TARGET_URL="http://__not_initialized" + +Xpath_get() +{ + XPATH_RESULT='' + XPATH=$1 + XML_FILE=$2 + RESULT=$(xmllint --xpath $XPATH $XML_FILE) + if [[ -z ${RESULT// } ]]; then + Error "Can not find target from $XML_FILE" + Debug "Xpath = $XPATH" + exit 1 + fi + XPATH_RESULT=$RESULT +} + +fetch_tizen_pkgs_init() +{ + TARGET=$1 + PROFILE=$2 + Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE" + + TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs + if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi + mkdir -p $TMP_PKG_DIR + + PKG_URL=$TIZEN_URL/$PROFILE/latest + + BUILD_XML_URL=$PKG_URL/$BUILD_XML + TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML + TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML + TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML + TMP_PRIMARYGZ=${TMP_PRIMARY}.gz + + Fetch $BUILD_XML_URL $TMP_BUILD + + Debug "fetch $BUILD_XML_URL to $TMP_BUILD" + + TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()" + Xpath_get $TARGET_XPATH $TMP_BUILD + TARGET_PATH=$XPATH_RESULT + TARGET_URL=$PKG_URL/$TARGET_PATH + + REPOMD_URL=$TARGET_URL/repodata/repomd.xml + PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)' + + Fetch $REPOMD_URL $TMP_REPOMD + + Debug "fetch $REPOMD_URL to $TMP_REPOMD" + + Xpath_get $PRIMARY_XPATH $TMP_REPOMD + PRIMARY_XML_PATH=$XPATH_RESULT + PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH + + Fetch $PRIMARY_URL $TMP_PRIMARYGZ + + Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ" + + gunzip $TMP_PRIMARYGZ + + Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY" +} + +fetch_tizen_pkgs() +{ + ARCH=$1 + PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)' + + PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())' + + for pkg in ${@:2} + do + Inform "Fetching... $pkg" + XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg} + XPATH=${XPATH/_ARCH_/$ARCH} + Xpath_get $XPATH $TMP_PRIMARY + PKG_PATH=$XPATH_RESULT + + XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg} + XPATH=${XPATH/_ARCH_/$ARCH} + Xpath_get $XPATH $TMP_PRIMARY + CHECKSUM=$XPATH_RESULT + + PKG_URL=$TARGET_URL/$PKG_PATH + PKG_FILE=$(basename $PKG_PATH) + PKG_PATH=$TMPDIR/$PKG_FILE + + Debug "Download $PKG_URL to $PKG_PATH" + Fetch $PKG_URL $PKG_PATH true + + echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null + if [ $? -ne 0 ]; then + Error "Fail to fetch $PKG_URL to $PKG_PATH" + Debug "Checksum = $CHECKSUM" + exit 1 + fi + done +} + +Inform "Initialize arm base" +fetch_tizen_pkgs_init standard base +Inform "fetch common packages" +fetch_tizen_pkgs armv7hl gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils +Inform "fetch coreclr packages" +fetch_tizen_pkgs armv7hl lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu +Inform "fetch corefx packages" +fetch_tizen_pkgs armv7hl libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel + +Inform "Initialize standard unified" +fetch_tizen_pkgs_init standard unified +Inform "fetch corefx packages" +fetch_tizen_pkgs armv7hl gssdp gssdp-devel tizen-release + diff --git a/eng/common/cross/arm/tizen/tizen.patch b/eng/common/cross/arm/tizen/tizen.patch new file mode 100644 index 00000000000000..fb12ade7250ae9 --- /dev/null +++ b/eng/common/cross/arm/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 5102245b7b5e3f..e94d13d62ef64d 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -185,8 +185,8 @@ while :; do __LLDB_Package="liblldb-6.0-dev" ;; tizen) - if [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then - echo "Tizen is available only for armel and arm64." + if [ "$__BuildArch" != "arm" ] && [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then + echo "Tizen is available only for arm, armel and arm64." usage; exit 1; fi diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 9d22fc92693031..fba2afda438b66 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -34,6 +34,16 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm") else() set(TOOLCHAIN "arm-linux-gnueabihf") endif() + if(TIZEN) + set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0") + endif() +elseif(TARGET_ARCH_NAME STREQUAL "armv6") + set(CMAKE_SYSTEM_PROCESSOR armv6l) + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf) + set(TOOLCHAIN "armv6-alpine-linux-musleabihf") + else() + set(TOOLCHAIN "arm-linux-gnueabihf") + endif() elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) @@ -57,7 +67,7 @@ elseif (ILLUMOS) set(CMAKE_SYSTEM_PROCESSOR "x86_64") set(TOOLCHAIN "x86_64-illumos") else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, s390x and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, s390x and x86 are supported!") endif() if(DEFINED ENV{TOOLCHAIN}) @@ -66,6 +76,10 @@ endif() # Specify include paths if(TIZEN) + if(TARGET_ARCH_NAME STREQUAL "arm") + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7hl-tizen-linux-gnueabihf) + endif() if(TARGET_ARCH_NAME STREQUAL "armel") include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi) @@ -160,7 +174,7 @@ if(LINUX) add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}") endif() -if(TARGET_ARCH_NAME STREQUAL "armel") +if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") if(TIZEN) add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib") @@ -187,7 +201,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64|s390x)$" AND NOT ANDROID) OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|s390x)$" AND NOT ANDROID) OR ILLUMOS) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) @@ -215,7 +229,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") endif() if(TIZEN) - if(TARGET_ARCH_NAME MATCHES "^(armel|arm64)$") + if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$") add_compile_options(-Wno-deprecated-declarations) # compile-time option add_compile_options(-D__extern_always_inline=inline) # compile-time option endif() diff --git a/eng/common/generate-graph-files.ps1 b/eng/common/generate-graph-files.ps1 deleted file mode 100644 index 0728b1a8b570d6..00000000000000 --- a/eng/common/generate-graph-files.ps1 +++ /dev/null @@ -1,86 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $barToken, # Token generated at https://maestro-prod.westus2.cloudapp.azure.com/Account/Tokens - [Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed) - [Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed) - [Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created - [string] $darcVersion, # darc's version - [string] $graphvizVersion = '2.38', # GraphViz version - [switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about - # toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies -) - -function CheckExitCode ([string]$stage) -{ - $exitCode = $LASTEXITCODE - if ($exitCode -ne 0) { - Write-PipelineTelemetryError -Category 'Arcade' -Message "Something failed in stage: '$stage'. Check for errors above. Exiting now..." - ExitWithExitCode $exitCode - } -} - -try { - $ErrorActionPreference = 'Stop' - . $PSScriptRoot\tools.ps1 - - Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') - - Push-Location $PSScriptRoot - - Write-Host 'Installing darc...' - . .\darc-init.ps1 -darcVersion $darcVersion - CheckExitCode 'Running darc-init' - - $engCommonBaseDir = Join-Path $PSScriptRoot 'native\' - $graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory - $nativeToolBaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external' - $installBin = Join-Path $graphvizInstallDir 'bin' - - Write-Host 'Installing dot...' - .\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose - - $darcExe = "$env:USERPROFILE\.dotnet\tools" - $darcExe = Resolve-Path "$darcExe\darc.exe" - - Create-Directory $outputFolder - - # Generate 3 graph descriptions: - # 1. Flat with coherency information - # 2. Graphviz (dot) file - # 3. Standard dependency graph - $graphVizFilePath = "$outputFolder\graphviz.txt" - $graphVizImageFilePath = "$outputFolder\graph.png" - $normalGraphFilePath = "$outputFolder\graph-full.txt" - $flatGraphFilePath = "$outputFolder\graph-flat.txt" - $baseOptions = @( '--github-pat', "$gitHubPat", '--azdev-pat', "$azdoPat", '--password', "$barToken" ) - - if ($includeToolset) { - Write-Host 'Toolsets will be included in the graph...' - $baseOptions += @( '--include-toolset' ) - } - - Write-Host 'Generating standard dependency graph...' - & "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath - CheckExitCode 'Generating normal dependency graph' - - Write-Host 'Generating flat dependency graph and graphviz file...' - & "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath - CheckExitCode 'Generating flat and graphviz dependency graph' - - Write-Host "Generating graph image $graphVizFilePath" - $dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe" - & "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath" - CheckExitCode 'Generating graphviz image' - - Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!" -} -catch { - if (!$includeToolset) { - Write-Host 'This might be a toolset repo which includes only toolset dependencies. ' -NoNewline -ForegroundColor Yellow - Write-Host 'Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again...' -ForegroundColor Yellow - } - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'Arcade' -Message $_ - ExitWithExitCode 1 -} finally { - Pop-Location -} \ No newline at end of file diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 2427ca6b6aec74..8508397d77640e 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -5,13 +5,8 @@ param( [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, - [Parameter(Mandatory=$false)][string] $EnableSourceLinkValidation, - [Parameter(Mandatory=$false)][string] $EnableSigningValidation, - [Parameter(Mandatory=$false)][string] $EnableNugetValidation, - [Parameter(Mandatory=$false)][string] $PublishInstallersAndChecksums, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, - [Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters, - [Parameter(Mandatory=$false)][string] $SigningValidationAdditionalParameters + [Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters ) try { @@ -35,27 +30,6 @@ try { $optionalParams.Add("--no-wait") | Out-Null } - if ("false" -ne $PublishInstallersAndChecksums) { - $optionalParams.Add("--publish-installers-and-checksums") | Out-Null - } - - if ("true" -eq $EnableNugetValidation) { - $optionalParams.Add("--validate-nuget") | Out-Null - } - - if ("true" -eq $EnableSourceLinkValidation) { - $optionalParams.Add("--validate-sourcelinkchecksums") | Out-Null - } - - if ("true" -eq $EnableSigningValidation) { - $optionalParams.Add("--validate-signingchecksums") | Out-Null - - if ("" -ne $SigningValidationAdditionalParameters) { - $optionalParams.Add("--signing-validation-parameters") | Out-Null - $optionalParams.Add($SigningValidationAdditionalParameters) | Out-Null - } - } - & $darc add-build-to-channel ` --id $buildId ` --publishing-infra-version $PublishingInfraVersion ` diff --git a/eng/common/sdl/configure-sdl-tool.ps1 b/eng/common/sdl/configure-sdl-tool.ps1 index 8a68fc24b11b0d..bdbf49e6c71de8 100644 --- a/eng/common/sdl/configure-sdl-tool.ps1 +++ b/eng/common/sdl/configure-sdl-tool.ps1 @@ -15,7 +15,9 @@ Param( # Optional: Additional params to add to any tool using CredScan. [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional params to add to any tool using PoliCheck. - [string[]] $PoliCheckAdditionalRunConfigParams + [string[]] $PoliCheckAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using CodeQL/Semmle. + [string[]] $CodeQLAdditionalRunConfigParams ) $ErrorActionPreference = 'Stop' @@ -78,6 +80,11 @@ try { $tool.Args += "`"Target < $TargetDirectory`"" } $tool.Args += $PoliCheckAdditionalRunConfigParams + } elseif ($tool.Name -eq 'semmle' -or $tool.Name -eq 'codeql') { + if ($targetDirectory) { + $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`"" + } + $tool.Args += $CodeQLAdditionalRunConfigParams } # Create variable pointing to the args array directly so we can use splat syntax later. diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 index e5bef8ebd3a3b4..4797e012c7d2f7 100644 --- a/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -34,6 +34,7 @@ Param( [string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") [string[]] $PoliCheckAdditionalRunConfigParams, # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") + [string[]] $CodeQLAdditionalRunConfigParams, # Optional: Additional Params to custom build a Semmle/CodeQL run config in the format @("xyz < abc","sdf < 1") [bool] $BreakOnFailure=$False # Optional: Fail the build if there were errors during the run ) @@ -105,7 +106,8 @@ try { -AzureDevOpsAccessToken $AzureDevOpsAccessToken ` -GuardianLoggerLevel $GuardianLoggerLevel ` -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams ` - -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams + -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams ` + -CodeQLAdditionalRunConfigParams $CodeQLAdditionalRunConfigParams if ($BreakOnFailure) { Exit-IfNZEC "Sdl" } diff --git a/eng/common/templates/job/generate-graph-files.yml b/eng/common/templates/job/generate-graph-files.yml deleted file mode 100644 index e54ce956f9088e..00000000000000 --- a/eng/common/templates/job/generate-graph-files.yml +++ /dev/null @@ -1,48 +0,0 @@ -parameters: - # Optional: dependencies of the job - dependsOn: '' - - # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool - pool: {} - - # Optional: Include toolset dependencies in the generated graph files - includeToolset: false - -jobs: -- job: Generate_Graph_Files - - dependsOn: ${{ parameters.dependsOn }} - - displayName: Generate Graph Files - - pool: ${{ parameters.pool }} - - variables: - # Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT - # DotNet-AllOrgs-Darc-Pats provides: dn-bot-devdiv-dnceng-rw-code-pat - - group: Publish-Build-Assets - - group: DotNet-AllOrgs-Darc-Pats - - name: _GraphArguments - value: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) - -azdoPat $(dn-bot-devdiv-dnceng-rw-code-pat) - -barToken $(MaestroAccessToken) - -outputFolder '$(Build.StagingDirectory)/GraphFiles/' - - ${{ if ne(parameters.includeToolset, 'false') }}: - - name: _GraphArguments - value: ${{ variables._GraphArguments }} -includeToolset - - steps: - - task: PowerShell@2 - displayName: Generate Graph Files - inputs: - filePath: eng\common\generate-graph-files.ps1 - arguments: $(_GraphArguments) - continueOnError: true - - task: PublishBuildArtifacts@1 - displayName: Publish Graph to Artifacts - inputs: - PathtoPublish: '$(Build.StagingDirectory)/GraphFiles' - PublishLocation: Container - ArtifactName: GraphFiles - continueOnError: true - condition: always() diff --git a/eng/common/templates/jobs/codeql-build.yml b/eng/common/templates/jobs/codeql-build.yml new file mode 100644 index 00000000000000..f7dc5ea4aaa63c --- /dev/null +++ b/eng/common/templates/jobs/codeql-build.yml @@ -0,0 +1,31 @@ +parameters: + # See schema documentation in /Documentation/AzureDevOps/TemplateSchema.md + continueOnError: false + # Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job + jobs: [] + # Optional: if specified, restore and use this version of Guardian instead of the default. + overrideGuardianVersion: '' + +jobs: +- template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: false + enablePublishBuildArtifacts: false + enablePublishTestResults: false + enablePublishBuildAssets: false + enablePublishUsingPipelines: false + enableTelemetry: true + + variables: + - group: Publish-Build-Assets + # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in + # sync with the packages.config file. + - name: DefaultGuardianVersion + value: 0.109.0 + - name: GuardianPackagesConfigFile + value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config + - name: GuardianVersion + value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }} + + jobs: ${{ parameters.jobs }} + diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 8dd1fdbd144a06..ff4ab75c886dc7 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -87,13 +87,3 @@ jobs: runAsPublic: ${{ parameters.runAsPublic }} publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} - - - ${{ if eq(parameters.graphFileGeneration.enabled, true) }}: - - template: ../job/generate-graph-files.yml - parameters: - continueOnError: ${{ parameters.continueOnError }} - includeToolset: ${{ parameters.graphFileGeneration.includeToolset }} - dependsOn: - - Asset_Registry_Publish - pool: - vmImage: 'windows-2019' diff --git a/eng/common/templates/post-build/channels/generic-internal-channel.yml b/eng/common/templates/post-build/channels/generic-internal-channel.yml deleted file mode 100644 index 8990dfc8c87cc3..00000000000000 --- a/eng/common/templates/post-build/channels/generic-internal-channel.yml +++ /dev/null @@ -1,190 +0,0 @@ -parameters: - BARBuildId: '' - PromoteToChannelIds: '' - artifactsPublishingAdditionalParameters: '' - dependsOn: - - Validate - publishInstallersAndChecksums: true - symbolPublishingAdditionalParameters: '' - stageName: '' - channelName: '' - channelId: '' - transportFeed: '' - shippingFeed: '' - symbolsFeed: '' - -stages: -- stage: ${{ parameters.stageName }} - dependsOn: ${{ parameters.dependsOn }} - variables: - - template: ../common-variables.yml - displayName: ${{ parameters.channelName }} Publishing - jobs: - - template: ../setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - job: publish_symbols - displayName: Symbol Publishing - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) - variables: - - group: DotNet-Symbol-Server-Pats - - name: AzDOProjectName - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - - name: AzDOPipelineId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - - name: AzDOBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] - pool: - vmImage: 'windows-2019' - steps: - - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." - displayName: Warn about v2 Arcade Publishing Usage - - # This is necessary whenever we want to publish/restore to an AzDO private feed - - task: NuGetAuthenticate@0 - displayName: 'Authenticate to AzDO Feeds' - - - task: DownloadBuildArtifacts@0 - displayName: Download Build Assets - continueOnError: true - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - downloadType: 'specific' - itemPattern: | - PdbArtifacts/** - BlobArtifacts/** - downloadPath: '$(Build.ArtifactStagingDirectory)' - checkDownloadedFiles: true - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@0 - displayName: 'Authenticate to AzDO Feeds' - - - task: PowerShell@2 - displayName: Enable cross-org publishing - inputs: - filePath: eng\common\enable-cross-org-publishing.ps1 - arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - - - task: PowerShell@2 - displayName: Publish - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' - /p:Configuration=Release - /p:PublishToMSDL=false - ${{ parameters.symbolPublishingAdditionalParameters }} - - - template: ../../steps/publish-logs.yml - parameters: - StageLabel: '${{ parameters.stageName }}' - JobLabel: 'SymbolPublishing' - - - job: publish_assets - displayName: Publish Assets - dependsOn: setupMaestroVars - timeoutInMinutes: 120 - variables: - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - - name: IsStableBuild - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - - name: AzDOProjectName - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - - name: AzDOPipelineId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - - name: AzDOBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) - pool: - vmImage: 'windows-2019' - steps: - - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." - displayName: Warn about v2 Arcade Publishing Usage - - - task: DownloadBuildArtifacts@0 - displayName: Download Build Assets - continueOnError: true - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - downloadType: 'specific' - itemPattern: | - PackageArtifacts/** - BlobArtifacts/** - AssetManifests/** - downloadPath: '$(Build.ArtifactStagingDirectory)' - checkDownloadedFiles: true - - - task: NuGetToolInstaller@1 - displayName: 'Install NuGet.exe' - - # This is necessary whenever we want to publish/restore to an AzDO private feed - - task: NuGetAuthenticate@0 - displayName: 'Authenticate to AzDO Feeds' - - - task: PowerShell@2 - displayName: Enable cross-org publishing - inputs: - filePath: eng\common\enable-cross-org-publishing.ps1 - arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - - - task: PowerShell@2 - displayName: Publish Assets - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:PublishingInfraVersion=2 - /p:IsStableBuild=$(IsStableBuild) - /p:IsInternalBuild=$(IsInternalBuild) - /p:RepositoryName=$(Build.Repository.Name) - /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(NuGetExeToolPath) - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:Configuration=Release - /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} - /p:ChecksumsTargetStaticFeed=$(InternalChecksumsBlobFeedUrl) - /p:ChecksumsAzureAccountKey=$(InternalChecksumsBlobFeedKey) - /p:InstallersTargetStaticFeed=$(InternalInstallersBlobFeedUrl) - /p:InstallersAzureAccountKey=$(InternalInstallersBlobFeedKey) - /p:AzureDevOpsStaticShippingFeed='${{ parameters.shippingFeed }}' - /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' - /p:AzureDevOpsStaticTransportFeed='${{ parameters.transportFeed }}' - /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' - /p:AzureDevOpsStaticSymbolsFeed='${{ parameters.symbolsFeed }}' - /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' - /p:PublishToMSDL=false - ${{ parameters.artifactsPublishingAdditionalParameters }} - - - template: ../../steps/publish-logs.yml - parameters: - StageLabel: '${{ parameters.stageName }}' - JobLabel: 'AssetsPublishing' - - - template: ../../steps/add-build-to-channel.yml - parameters: - ChannelId: ${{ parameters.channelId }} diff --git a/eng/common/templates/post-build/channels/generic-public-channel.yml b/eng/common/templates/post-build/channels/generic-public-channel.yml deleted file mode 100644 index 3220c6a4f92ffb..00000000000000 --- a/eng/common/templates/post-build/channels/generic-public-channel.yml +++ /dev/null @@ -1,192 +0,0 @@ -parameters: - BARBuildId: '' - PromoteToChannelIds: '' - artifactsPublishingAdditionalParameters: '' - dependsOn: - - Validate - publishInstallersAndChecksums: true - symbolPublishingAdditionalParameters: '' - stageName: '' - channelName: '' - channelId: '' - transportFeed: '' - shippingFeed: '' - symbolsFeed: '' - # If the channel name is empty, no links will be generated - akaMSChannelName: '' - -stages: -- stage: ${{ parameters.stageName }} - dependsOn: ${{ parameters.dependsOn }} - variables: - - template: ../common-variables.yml - displayName: ${{ parameters.channelName }} Publishing - jobs: - - template: ../setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - job: publish_symbols - displayName: Symbol Publishing - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) - variables: - - group: DotNet-Symbol-Server-Pats - - name: AzDOProjectName - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - - name: AzDOPipelineId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - - name: AzDOBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] - pool: - vmImage: 'windows-2019' - steps: - - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." - displayName: Warn about v2 Arcade Publishing Usage - - - task: DownloadBuildArtifacts@0 - displayName: Download Build Assets - continueOnError: true - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - downloadType: 'specific' - itemPattern: | - PdbArtifacts/** - BlobArtifacts/** - downloadPath: '$(Build.ArtifactStagingDirectory)' - checkDownloadedFiles: true - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@0 - displayName: 'Authenticate to AzDO Feeds' - - - task: PowerShell@2 - displayName: Enable cross-org publishing - inputs: - filePath: eng\common\enable-cross-org-publishing.ps1 - arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - - - task: PowerShell@2 - displayName: Publish - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' - /p:Configuration=Release - ${{ parameters.symbolPublishingAdditionalParameters }} - - - template: ../../steps/publish-logs.yml - parameters: - StageLabel: '${{ parameters.stageName }}' - JobLabel: 'SymbolPublishing' - - - job: publish_assets - displayName: Publish Assets - dependsOn: setupMaestroVars - timeoutInMinutes: 120 - variables: - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - - name: IsStableBuild - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - - name: AzDOProjectName - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] - - name: AzDOPipelineId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] - - name: AzDOBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] - - name: ArtifactsCategory - value: ${{ coalesce(variables._DotNetArtifactsCategory, '.NETCore') }} - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'], format('[{0}]', ${{ parameters.channelId }} )) - pool: - vmImage: 'windows-2019' - steps: - - script: echo "##vso[task.logissue type=warning]Going forward, v2 Arcade publishing is no longer supported. Please read https://github.com/dotnet/arcade/blob/main/Documentation/CorePackages/Publishing.md for details, then contact dnceng if you have further questions." - displayName: Warn about v2 Arcade Publishing Usage - - - task: DownloadBuildArtifacts@0 - displayName: Download Build Assets - continueOnError: true - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - downloadType: 'specific' - itemPattern: | - PackageArtifacts/** - BlobArtifacts/** - AssetManifests/** - downloadPath: '$(Build.ArtifactStagingDirectory)' - checkDownloadedFiles: true - - - task: NuGetToolInstaller@1 - displayName: 'Install NuGet.exe' - - # This is necessary whenever we want to publish/restore to an AzDO private feed - - task: NuGetAuthenticate@0 - displayName: 'Authenticate to AzDO Feeds' - - - task: PowerShell@2 - displayName: Enable cross-org publishing - inputs: - filePath: eng\common\enable-cross-org-publishing.ps1 - arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) - - - task: PowerShell@2 - displayName: Publish Assets - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:PublishingInfraVersion=2 - /p:ArtifactsCategory=$(ArtifactsCategory) - /p:IsStableBuild=$(IsStableBuild) - /p:IsInternalBuild=$(IsInternalBuild) - /p:RepositoryName=$(Build.Repository.Name) - /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(NuGetExeToolPath) - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:Configuration=Release - /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} - /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) - /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) - /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) - /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) - /p:AzureDevOpsStaticShippingFeed='${{ parameters.shippingFeed }}' - /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' - /p:AzureDevOpsStaticTransportFeed='${{ parameters.transportFeed }}' - /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' - /p:AzureDevOpsStaticSymbolsFeed='${{ parameters.symbolsFeed }}' - /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' - /p:LatestLinkShortUrlPrefix=dotnet/'${{ parameters.akaMSChannelName }}' - /p:AkaMSClientId=$(akams-client-id) - /p:AkaMSClientSecret=$(akams-client-secret) - ${{ parameters.artifactsPublishingAdditionalParameters }} - - - template: ../../steps/publish-logs.yml - parameters: - StageLabel: '${{ parameters.stageName }}' - JobLabel: 'AssetsPublishing' - - - template: ../../steps/add-build-to-channel.yml - parameters: - ChannelId: ${{ parameters.channelId }} diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 4f79cf0f33703f..8985b429c85437 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -1,71 +1,89 @@ parameters: - # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. - # Publishing V2 accepts optionally outlining the publishing stages - default is inline. - # Publishing V3 DOES NOT accept inlining the publishing stages. - publishingInfraVersion: 2 - # When set to true the publishing templates from the repo will be used - # otherwise Darc add-build-to-channel will be used to trigger the promotion pipeline - inline: true - - # Only used if inline==false. When set to true will stall the current build until - # the Promotion Pipeline build finishes. Otherwise, the current build will continue - # execution concurrently with the promotion build. - waitPublishingFinish: true - - BARBuildId: '' - PromoteToChannelIds: '' - - enableSourceLinkValidation: false - enableSigningValidation: true - enableSymbolValidation: false - enableNugetValidation: true - publishInstallersAndChecksums: true - SDLValidationParameters: - enable: false - continueOnError: false - params: '' - artifactNames: '' - downloadArtifacts: true + # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. + # Publishing V1 is no longer supported + # Publishing V2 is no longer supported + # Publishing V3 is the default + - name: publishingInfraVersion + displayName: Which version of publishing should be used to promote the build definition? + type: number + default: 3 + values: + - 3 + + - name: BARBuildId + displayName: BAR Build Id + type: number + default: 0 + + - name: PromoteToChannelIds + displayName: Channel to promote BARBuildId to + type: string + default: '' + + - name: enableSourceLinkValidation + displayName: Enable SourceLink validation + type: boolean + default: false + + - name: enableSigningValidation + displayName: Enable signing validation + type: boolean + default: true + + - name: enableSymbolValidation + displayName: Enable symbol validation + type: boolean + default: false + + - name: enableNugetValidation + displayName: Enable NuGet validation + type: boolean + default: true + + - name: publishInstallersAndChecksums + displayName: Publish installers and checksums + type: boolean + default: true + + - name: SDLValidationParameters + type: object + default: + enable: false + continueOnError: false + params: '' + artifactNames: '' + downloadArtifacts: true # These parameters let the user customize the call to sdk-task.ps1 for publishing # symbols & general artifacts as well as for signing validation - symbolPublishingAdditionalParameters: '' - artifactsPublishingAdditionalParameters: '' - signingValidationAdditionalParameters: '' + - name: symbolPublishingAdditionalParameters + displayName: Symbol publishing additional parameters + type: string + default: '' + + - name: artifactsPublishingAdditionalParameters + displayName: Artifact publishing additional parameters + type: string + default: '' + + - name: signingValidationAdditionalParameters + displayName: Signing validation additional parameters + type: string + default: '' # Which stages should finish execution before post-build stages start - validateDependsOn: - - build - publishDependsOn: - - Validate + - name: validateDependsOn + type: object + default: + - build - # Channel ID's instantiated in this file. - # When adding a new channel implementation the call to `check-channel-consistency.ps1` - # needs to be updated with the new channel ID - NetEngLatestChannelId: 2 - NetEngValidationChannelId: 9 - NetDev5ChannelId: 131 - NetDev6ChannelId: 1296 - GeneralTestingChannelId: 529 - NETCoreToolingDevChannelId: 548 - NETCoreToolingReleaseChannelId: 549 - NETInternalToolingChannelId: 551 - NETCoreExperimentalChannelId: 562 - NetEngServicesIntChannelId: 678 - NetEngServicesProdChannelId: 679 - NetCoreSDK313xxChannelId: 759 - NetCoreSDK313xxInternalChannelId: 760 - NetCoreSDK314xxChannelId: 921 - NetCoreSDK314xxInternalChannelId: 922 - VS166ChannelId: 1010 - VS167ChannelId: 1011 - VS168ChannelId: 1154 - VSMasterChannelId: 1012 - VS169ChannelId: 1473 - VS1610ChannelId: 1692 + - name: publishDependsOn + type: object + default: + - Validate stages: -- ${{ if or(and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')), eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: +- ${{ if or(eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - stage: Validate dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate Build Assets @@ -77,23 +95,6 @@ stages: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - - job: - displayName: Post-build Checks - dependsOn: setupMaestroVars - variables: - - name: TargetChannels - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ] - pool: - vmImage: 'windows-2019' - steps: - - task: PowerShell@2 - displayName: Maestro Channels Consistency - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1 - arguments: -PromoteToChannels "$(TargetChannels)" - -AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.NetDev6ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}},${{parameters.VS169ChannelId}},${{parameters.VS1610ChannelId}} - - job: displayName: NuGet Validation dependsOn: setupMaestroVars @@ -229,361 +230,38 @@ stages: artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} -- ${{ if or(ge(parameters.publishingInfraVersion, 3), eq(parameters.inline, 'false')) }}: - - stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.publishDependsOn }} - ${{ if and(ne(parameters.enableNugetValidation, 'true'), ne(parameters.enableSigningValidation, 'true'), ne(parameters.enableSourceLinkValidation, 'true'), ne(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - jobs: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - job: - displayName: Publish Using Darc - dependsOn: setupMaestroVars - timeoutInMinutes: 120 - variables: - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - pool: - vmImage: 'windows-2019' - steps: - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.PublishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' - -WaitPublishingFinish ${{ parameters.waitPublishingFinish }} - -PublishInstallersAndChecksums ${{ parameters.publishInstallersAndChecksums }} - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - -- ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NetCore_Dev5_Publish' - channelName: '.NET 5 Dev' - akaMSChannelName: 'net5/dev' - channelId: ${{ parameters.NetDev5ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NetCore_Dev6_Publish' - channelName: '.NET 6 Dev' - akaMSChannelName: 'net6/dev' - channelId: ${{ parameters.NetDev6ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml +- stage: publish_using_darc + ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: + dependsOn: ${{ parameters.publishDependsOn }} + ${{ if and(ne(parameters.enableNugetValidation, 'true'), ne(parameters.enableSigningValidation, 'true'), ne(parameters.enableSourceLinkValidation, 'true'), ne(parameters.SDLValidationParameters.enable, 'true')) }}: + dependsOn: ${{ parameters.validateDependsOn }} + displayName: Publish using Darc + variables: + - template: common-variables.yml + jobs: + - template: setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'Net_Eng_Latest_Publish' - channelName: '.NET Eng - Latest' - akaMSChannelName: 'eng/daily' - channelId: ${{ parameters.NetEngLatestChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'Net_Eng_Validation_Publish' - channelName: '.NET Eng - Validation' - akaMSChannelName: 'eng/validation' - channelId: ${{ parameters.NetEngValidationChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'General_Testing_Publish' - channelName: 'General Testing' - akaMSChannelName: 'generaltesting' - channelId: ${{ parameters.GeneralTestingChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/general-testing-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_Tooling_Dev_Publishing' - channelName: '.NET Core Tooling Dev' - channelId: ${{ parameters.NETCoreToolingDevChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_Tooling_Release_Publishing' - channelName: '.NET Core Tooling Release' - channelId: ${{ parameters.NETCoreToolingReleaseChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NET_Internal_Tooling_Publishing' - channelName: '.NET Internal Tooling' - channelId: ${{ parameters.NETInternalToolingChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_Experimental_Publishing' - channelName: '.NET Core Experimental' - channelId: ${{ parameters.NETCoreExperimentalChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'Net_Eng_Services_Int_Publish' - channelName: '.NET Eng Services - Int' - channelId: ${{ parameters.NetEngServicesIntChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'Net_Eng_Services_Prod_Publish' - channelName: '.NET Eng Services - Prod' - channelId: ${{ parameters.NetEngServicesProdChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_SDK_314xx_Publishing' - channelName: '.NET Core SDK 3.1.4xx' - channelId: ${{ parameters.NetCoreSDK314xxChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_SDK_314xx_Internal_Publishing' - channelName: '.NET Core SDK 3.1.4xx Internal' - channelId: ${{ parameters.NetCoreSDK314xxInternalChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_SDK_313xx_Publishing' - channelName: '.NET Core SDK 3.1.3xx' - channelId: ${{ parameters.NetCoreSDK313xxChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'NETCore_SDK_313xx_Internal_Publishing' - channelName: '.NET Core SDK 3.1.3xx Internal' - channelId: ${{ parameters.NetCoreSDK313xxInternalChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'VS16_6_Publishing' - channelName: 'VS 16.6' - channelId: ${{ parameters.VS166ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'VS16_7_Publishing' - channelName: 'VS 16.7' - channelId: ${{ parameters.VS167ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'VS16_8_Publishing' - channelName: 'VS 16.8' - channelId: ${{ parameters.VS168ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'VS_Master_Publishing' - channelName: 'VS Master' - channelId: ${{ parameters.VSMasterChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'VS_16_9_Publishing' - channelName: 'VS 16.9' - channelId: ${{ parameters.VS169ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' - - - template: \eng\common\templates\post-build\channels\generic-public-channel.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} - dependsOn: ${{ parameters.publishDependsOn }} - publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} - symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'VS_16_10_Publishing' - channelName: 'VS 16.10' - channelId: ${{ parameters.VS1610ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' + - job: + displayName: Publish Using Darc + dependsOn: setupMaestroVars + timeoutInMinutes: 120 + variables: + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Publish Using Darc + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: -BuildId $(BARBuildId) + -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} + -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -MaestroToken '$(MaestroApiAccessToken)' + -WaitPublishingFinish true + -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' + -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' \ No newline at end of file diff --git a/eng/common/templates/steps/execute-codeql.yml b/eng/common/templates/steps/execute-codeql.yml new file mode 100644 index 00000000000000..3930b1630214b3 --- /dev/null +++ b/eng/common/templates/steps/execute-codeql.yml @@ -0,0 +1,32 @@ +parameters: + # Language that should be analyzed. Defaults to csharp + language: csharp + # Build Commands + buildCommands: '' + overrideParameters: '' # Optional: to override values for parameters. + additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' + # Optional: if specified, restore and use this version of Guardian instead of the default. + overrideGuardianVersion: '' + # Optional: if true, publish the '.gdn' folder as a pipeline artifact. This can help with in-depth + # diagnosis of problems with specific tool configurations. + publishGuardianDirectoryToPipeline: false + # The script to run to execute all SDL tools. Use this if you want to use a script to define SDL + # parameters rather than relying on YAML. It may be better to use a local script, because you can + # reproduce results locally without piecing together a command based on the YAML. + executeAllSdlToolsScript: 'eng/common/sdl/execute-all-sdl-tools.ps1' + # There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named + # 'continueOnError', the parameter value is not correctly picked up. + # This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter + # optional: determines whether to continue the build if the step errors; + sdlContinueOnError: false + +steps: +- template: /eng/common/templates/steps/execute-sdl.yml + parameters: + overrideGuardianVersion: ${{ parameters.overrideGuardianVersion }} + executeAllSdlToolsScript: ${{ parameters.executeAllSdlToolsScript }} + overrideParameters: ${{ parameters.overrideParameters }} + additionalParameters: '${{ parameters.additionalParameters }} + -CodeQLAdditionalRunConfigParams @("BuildCommands < ${{ parameters.buildCommands }}", "Language < ${{ parameters.language }}")' + publishGuardianDirectoryToPipeline: ${{ parameters.publishGuardianDirectoryToPipeline }} + sdlContinueOnError: ${{ parameters.sdlContinueOnError }} \ No newline at end of file diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml index ba40dc82f1411b..d85d6d07d5c7b0 100644 --- a/eng/common/templates/steps/source-build.yml +++ b/eng/common/templates/steps/source-build.yml @@ -23,7 +23,7 @@ steps: # In addition, add an msbuild argument to copy the WIP from the repo to the target build location. # This is because SetupNuGetSources.sh will alter the current NuGet.config file, and we need to preserve those # changes. - $internalRestoreArgs= + internalRestoreArgs= if [ '$(dn-bot-dnceng-artifact-feeds-rw)' != '$''(dn-bot-dnceng-artifact-feeds-rw)' ]; then # Temporarily work around https://github.com/dotnet/arcade/issues/7709 chmod +x $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh diff --git a/eng/formatting/format.sh b/eng/formatting/format.sh old mode 100644 new mode 100755 diff --git a/eng/generators.targets b/eng/generators.targets index 4c32554b5e2195..843842937ef3f7 100644 --- a/eng/generators.targets +++ b/eng/generators.targets @@ -84,10 +84,6 @@ true $(DefineConstants);DLLIMPORTGENERATOR_INTERNALUNSAFE - - - $(DefineConstants);DLLIMPORTGENERATOR_ENABLED - diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index bc2e7e5dff9a01..aab934c42ae6b6 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -24,6 +24,9 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'aotsdk')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'build')) $([MSBuild]::NormalizeDirectory('$(MonoArtifactsPath)', 'cross', $(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant()))) diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 8f1a746752a347..373091b13a0014 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -197,7 +197,7 @@ usage() echo "" echo "Common Options:" echo "" - echo "BuildArch can be: -arm, -armel, -arm64, -s390x, x64, x86, -wasm" + echo "BuildArch can be: -arm, -armel, -arm64, -loongarch64, -s390x, x64, x86, -wasm" echo "BuildType can be: -debug, -checked, -release" echo "-os: target OS (defaults to running OS)" echo "-bindir: output directory (defaults to $__ProjectRoot/artifacts)" @@ -377,6 +377,10 @@ while :; do __BuildArch=x64 ;; + loongarch64|-loongarch64) + __BuildArch=loongarch64 + ;; + s390x|-s390x) __BuildArch=s390x ;; diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 5a20591cc025bb..fad1ac58d39c88 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -216,6 +216,9 @@ elseif (CLR_CMAKE_HOST_ARCH_ARM) elseif (CLR_CMAKE_HOST_ARCH_ARM64) set(ARCH_HOST_NAME arm64) add_definitions(-DHOST_ARM64 -DHOST_64BIT) +elseif (CLR_CMAKE_HOST_ARCH_LOONGARCH64) + set(ARCH_HOST_NAME loongarch64) + add_definitions(-DHOST_LOONGARCH64 -DHOST_64BIT) elseif (CLR_CMAKE_HOST_ARCH_S390X) set(ARCH_HOST_NAME s390x) add_definitions(-DHOST_S390X -DHOST_64BIT -DBIGENDIAN) @@ -237,6 +240,8 @@ if (CLR_CMAKE_HOST_UNIX) message("Detected Linux ARM") elseif(CLR_CMAKE_HOST_UNIX_ARM64) message("Detected Linux ARM64") + elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64) + message("Detected Linux LOONGARCH64") elseif(CLR_CMAKE_HOST_UNIX_X86) message("Detected Linux i686") elseif(CLR_CMAKE_HOST_UNIX_S390X) @@ -301,6 +306,11 @@ elseif (CLR_CMAKE_TARGET_ARCH_I386) set(ARCH_SOURCES_DIR i386) add_compile_definitions($<$>>:TARGET_X86>) add_compile_definitions($<$>>:TARGET_32BIT>) +elseif (CLR_CMAKE_TARGET_ARCH_LOONGARCH64) + set(ARCH_TARGET_NAME loongarch64) + set(ARCH_SOURCES_DIR loongarch64) + add_compile_definitions($<$>>:TARGET_LOONGARCH64>) + add_compile_definitions($<$>>:TARGET_64BIT>) elseif (CLR_CMAKE_TARGET_ARCH_S390X) set(ARCH_TARGET_NAME s390x) set(ARCH_SOURCES_DIR s390x) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index f5c8abe66991a0..cdf33430b49f11 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -43,6 +43,8 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux) set(CLR_CMAKE_HOST_UNIX_ARM 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) set(CLR_CMAKE_HOST_UNIX_ARM64 1) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64) + set(CLR_CMAKE_HOST_UNIX_LOONGARCH64 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i686 OR CMAKE_SYSTEM_PROCESSOR STREQUAL x86) set(CLR_CMAKE_HOST_UNIX_X86 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL s390x) @@ -218,6 +220,9 @@ if(CLR_CMAKE_HOST_UNIX_ARM) elseif(CLR_CMAKE_HOST_UNIX_ARM64) set(CLR_CMAKE_HOST_ARCH_ARM64 1) set(CLR_CMAKE_HOST_ARCH "arm64") +elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64) + set(CLR_CMAKE_HOST_ARCH_LOONGARCH64 1) + set(CLR_CMAKE_HOST_ARCH "loongarch64") elseif(CLR_CMAKE_HOST_UNIX_AMD64) set(CLR_CMAKE_HOST_ARCH_AMD64 1) set(CLR_CMAKE_HOST_ARCH "x64") @@ -268,6 +273,8 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64) set(CLR_CMAKE_TARGET_ARCH_I386 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64) set(CLR_CMAKE_TARGET_ARCH_ARM64 1) + elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64) + set(CLR_CMAKE_TARGET_ARCH_LOONGARCH64 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm) set(CLR_CMAKE_TARGET_ARCH_ARM 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel) @@ -374,6 +381,8 @@ if(CLR_CMAKE_TARGET_UNIX) set(CLR_CMAKE_TARGET_UNIX_ARM 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64) set(CLR_CMAKE_TARGET_UNIX_ARM64 1) + elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64) + set(CLR_CMAKE_TARGET_UNIX_LOONGARCH64 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL x86) set(CLR_CMAKE_TARGET_UNIX_X86 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL s390x) diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index 87b4d15734bf69..c4af68ba7dc610 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -4,10 +4,75 @@ function(clr_unknown_arch) elseif(CLR_CROSS_COMPONENTS_BUILD) message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}") else() - message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}") + message(FATAL_ERROR "Only AMD64, ARM64, LOONGARCH64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}") endif() endfunction() +# C to MASM include file translator +# This is replacement for the deprecated h2inc tool that used to be part of VS. +function(h2inc filename output) + file(STRINGS ${filename} lines) + get_filename_component(path "${filename}" DIRECTORY) + file(RELATIVE_PATH relative_filename "${CLR_REPO_ROOT_DIR}" "${filename}") + + file(APPEND "${output}" "// File start: ${relative_filename}\n") + + # Use of NEWLINE_CONSUME is needed for lines with trailing backslash + file(STRINGS ${filename} contents NEWLINE_CONSUME) + string(REGEX REPLACE "\\\\\n" "\\\\\\\\ \n" contents "${contents}") + string(REGEX REPLACE "\n" ";" lines "${contents}") + + foreach(line IN LISTS lines) + string(REGEX REPLACE "\\\\\\\\ " "\\\\" line "${line}") + + if(line MATCHES "^ *# pragma") + # Ignore pragmas + continue() + endif() + + if(line MATCHES "^ *# *include *\"(.*)\"") + # Expand includes. + h2inc("${path}/${CMAKE_MATCH_1}" "${output}") + continue() + endif() + + if(line MATCHES "^ *#define +([0-9A-Za-z_()]+) *(.*)") + # Augment #defines with their MASM equivalent + set(name "${CMAKE_MATCH_1}") + set(value "${CMAKE_MATCH_2}") + + # Note that we do not handle multiline constants + + # Strip comments from value + string(REGEX REPLACE "//.*" "" value "${value}") + string(REGEX REPLACE "/\\*.*\\*/" "" value "${value}") + + # Strip whitespaces from value + string(REPLACE " +$" "" value "${value}") + + # ignore #defines with arguments + if(NOT "${name}" MATCHES "\\(") + set(HEX_NUMBER_PATTERN "0x([0-9A-Fa-f]+)") + set(DECIMAL_NUMBER_PATTERN "(-?[0-9]+)") + + if("${value}" MATCHES "${HEX_NUMBER_PATTERN}") + string(REGEX REPLACE "${HEX_NUMBER_PATTERN}" "0\\1h" value "${value}") # Convert hex constants + file(APPEND "${output}" "${name} EQU ${value}\n") + elseif("${value}" MATCHES "${DECIMAL_NUMBER_PATTERN}" AND (NOT "${value}" MATCHES "[G-Zg-z]+" OR "${value}" MATCHES "\\(")) + string(REGEX REPLACE "${DECIMAL_NUMBER_PATTERN}" "\\1t" value "${value}") # Convert dec constants + file(APPEND "${output}" "${name} EQU ${value}\n") + else() + file(APPEND "${output}" "${name} TEXTEQU <${value}>\n") + endif() + endif() + endif() + + file(APPEND "${output}" "${line}\n") + endforeach() + + file(APPEND "${output}" "// File end: ${relative_filename}\n") +endfunction() + # Build a list of compiler definitions by putting -D in front of each define. function(get_compile_definitions DefinitionName) # Get the current list of definitions @@ -94,6 +159,10 @@ function(find_unwind_libs UnwindLibs) find_library(UNWIND_ARCH NAMES unwind-aarch64) endif() + if(CLR_CMAKE_HOST_ARCH_LOONGARCH64) + find_library(UNWIND_ARCH NAMES unwind-loongarch64) + endif() + if(CLR_CMAKE_HOST_ARCH_AMD64) find_library(UNWIND_ARCH NAMES unwind-x86_64) endif() diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index fc4078fa3a9aa4..586534be1c8aa9 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -37,6 +37,10 @@ case "$CPUName" in arch=arm64 ;; + loongarch64) + arch=loongarch64 + ;; + amd64|x86_64) arch=x64 ;; diff --git a/eng/native/tryrun.cmake b/eng/native/tryrun.cmake index 96199969da69c9..e8a04c5698ad35 100644 --- a/eng/native/tryrun.cmake +++ b/eng/native/tryrun.cmake @@ -68,7 +68,7 @@ if(DARWIN) else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!") endif() -elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|s390x|x86)$" OR FREEBSD OR ILLUMOS) +elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|loongarch64|s390x|x86)$" OR FREEBSD OR ILLUMOS) set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1) set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0) set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0) @@ -146,9 +146,9 @@ elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|s390x|x86)$" OR FREEBSD OR IL set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) endif() else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, s390x and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, loongarch64, s390x and x86 are supported!") endif() -if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x") +if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "loongarch64") set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) endif() diff --git a/eng/packaging.targets b/eng/packaging.targets index 6d2bbce10da346..667837fbff1067 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -23,6 +23,10 @@ '$(PreReleaseVersionLabel)' != 'servicing' and '$(GitHubRepositoryName)' != 'runtimelab'">true false + + true $(XmlDocFileRoot)1033\$(AssemblyName).xml true @@ -259,7 +263,7 @@ diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index cf30d702dda60d..c9015681d1e17c 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -3,6 +3,7 @@ parameters: nameSuffix: '' buildArgs: '' archType: '' + hostedOs: '' osGroup: '' osSubgroup: '' container: '' @@ -35,8 +36,12 @@ parameters: jobs: - template: /eng/common/templates/job/job.yml parameters: - name: ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }} - displayName: ${{ format('Build {0}{1} {2} {3} {4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }} + ${{ if eq(parameters.hostedOs, '') }}: + name: ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }} + displayName: ${{ format('Build {0}{1} {2} {3} {4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }} + ${{ if ne(parameters.hostedOs, '') }}: + name: ${{ format('build_{0}{1}_{2}_{3}_{4}_{5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix) }} + displayName: ${{ format('Build {0}{1} {2} {3} {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix) }} pool: ${{ parameters.pool }} container: ${{ parameters.container }} condition: and(succeeded(), ${{ parameters.condition }}) @@ -136,7 +141,7 @@ jobs: df -h displayName: Disk Usage before Build - - ${{ if contains(parameters.nameSuffix, 'Windows_wasm') }}: + - ${{ if eq(parameters.platform, 'Browser_wasm_win') }}: # Update machine certs - task: PowerShell@2 displayName: Update machine certs diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index ade8c7aab981b6..282fa567550812 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -273,7 +273,6 @@ jobs: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} variables: ${{ parameters.variables }} - hostedOs: Linux osGroup: Browser archType: wasm targetRid: browser-wasm @@ -282,6 +281,7 @@ jobs: image: ubuntu-18.04-webassembly-20210707133424-12f133e registry: mcr jobParameters: + hostedOs: Linux runtimeFlavor: ${{ parameters.runtimeFlavor }} stagedBuild: ${{ parameters.stagedBuild }} buildConfig: ${{ parameters.buildConfig }} @@ -297,12 +297,12 @@ jobs: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} variables: ${{ parameters.variables }} - hostedOs: windows osGroup: Browser archType: wasm targetRid: browser-wasm platform: Browser_wasm_win jobParameters: + hostedOs: windows runtimeFlavor: ${{ parameters.runtimeFlavor }} stagedBuild: ${{ parameters.stagedBuild }} buildConfig: ${{ parameters.buildConfig }} diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 04399d26a6a22e..6aa8a54f24c0f8 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -73,7 +73,7 @@ jobs: - ${{ if not(or(eq(parameters.runtimeVariant, 'minijit'), eq(parameters.runtimeVariant, 'monointerpreter'))) }}: - ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}: - ${{ format('{0}_llvmaot_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - - ${{ if not(eq(parameters.runtimeVariant, 'llvmfullaot')) }}: + - ${{ if ne(parameters.runtimeVariant, 'llvmfullaot') }}: - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} @@ -109,7 +109,7 @@ jobs: - name: runtimeVariantArg value: '' - - ${{ if not(eq(parameters.runtimeVariant, '')) }}: + - ${{ if ne(parameters.runtimeVariant, '') }}: - name: runtimeVariantArg value: '/p:RuntimeVariant=${{ parameters.runtimeVariant }}' @@ -546,6 +546,7 @@ jobs: - jitosr - jitosr_stress - jitosr_pgo + - jitosr_stress_random - jitpartialcompilation - jitpartialcompilation_osr - jitpartialcompilation_osr_pgo diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index d6b84f837c3276..6e378369aa4fc6 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -11,19 +11,17 @@ variables: - name: isOfficialBuild value: ${{ and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }} -- name: isFullMatrix +- name: isRollingBuild value: ${{ and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }} -- name: isNotFullMatrix - value: ${{ and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }} -- name: isNotManualAndIsPR - value: ${{ and(not(in(variables['Build.DefinitionName'], 'runtime-staging-manual', 'runtime-manual')), eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }} -- name: isManualOrIsNotPR - value: ${{ or(in(variables['Build.DefinitionName'], 'runtime-staging-manual', 'runtime-manual'), and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest'))) }} +- name: isExtraPlatformsBuild + value: ${{ eq(variables['Build.DefinitionName'], 'runtime-extra-platforms') }} +- name: isNotExtraPlatformsBuild + value: ${{ ne(variables['Build.DefinitionName'], 'runtime-extra-platforms') }} # We only run evaluate paths on runtime, runtime-staging and runtime-community pipelines on PRs # keep in sync with /eng/pipelines/common/xplat-setup.yml - name: dependOnEvaluatePaths - value: ${{ and(eq(variables['Build.Reason'], 'PullRequest'), in(variables['Build.DefinitionName'], 'runtime', 'runtime-staging', 'runtime-community')) }} + value: ${{ and(eq(variables['Build.Reason'], 'PullRequest'), in(variables['Build.DefinitionName'], 'runtime', 'runtime-staging', 'runtime-community', 'runtime-extra-platforms')) }} - name: debugOnPrReleaseOnRolling ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: value: Release diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index 05a6bc7c4a63c4..e397bcdd456a60 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -22,8 +22,7 @@ jobs: shouldContinueOnError: ${{ and(endsWith(variables['Build.DefinitionName'], 'staging'), eq(variables['Build.Reason'], 'PullRequest')) }} # keep in sync with /eng/pipelines/common/variables.yml - nonPRBuild: ${{ and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }} - dependOnEvaluatePaths: ${{ and(eq(variables['Build.Reason'], 'PullRequest'), in(variables['Build.DefinitionName'], 'runtime', 'runtime-staging', 'runtime-community')) }} + dependOnEvaluatePaths: ${{ and(eq(variables['Build.Reason'], 'PullRequest'), in(variables['Build.DefinitionName'], 'runtime', 'runtime-staging', 'runtime-community', 'runtime-extra-platforms')) }} variables: # Disable component governance in our CI builds. These builds are not shipping nor @@ -50,8 +49,12 @@ jobs: value: $(buildConfigUpper) - name: _runSmokeTestsOnlyArg - value: '/p:RunSmokeTestsOnly=$(isNotManualAndIsPR)' - - ${{ if or(eq(parameters.osGroup, 'windows'), eq(parameters.hostedOs, 'windows')) }}: + value: '/p:RunSmokeTestsOnly=$(isNotExtraPlatformsBuild)' + + - name: _hostedOs + value: ${{ parameters.jobParameters.hostedOs }} + + - ${{ if or(eq(parameters.osGroup, 'windows'), eq(parameters.jobParameters.hostedOs, 'windows')) }}: - name: archiveExtension value: '.zip' - name: archiveType @@ -69,7 +72,7 @@ jobs: - name: logRootNameArg value: 'log ' - - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.hostedOs, 'windows')) }}: + - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.jobParameters.hostedOs, 'windows')) }}: - name: archiveExtension value: '.tar.gz' - name: archiveType @@ -117,12 +120,12 @@ jobs: ${{ if eq(parameters.jobParameters.pool, '') }}: pool: # Public Linux Build Pool - ${{ if and(or(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Android', 'Tizen'), eq(parameters.hostedOs, 'Linux')), eq(variables['System.TeamProject'], 'public')) }}: + ${{ if and(or(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Android', 'Tizen'), eq(parameters.jobParameters.hostedOs, 'Linux')), eq(variables['System.TeamProject'], 'public')) }}: name: NetCore1ESPool-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open # Official Build Linux Pool - ${{ if and(or(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser', 'Android', 'Tizen'), eq(parameters.hostedOs, 'Linux')), ne(variables['System.TeamProject'], 'public')) }}: + ${{ if and(or(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser', 'Android', 'Tizen'), eq(parameters.jobParameters.hostedOs, 'Linux')), ne(variables['System.TeamProject'], 'public')) }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 @@ -136,7 +139,7 @@ jobs: demands: ImageOverride -equals Build.Windows.10.Amd64.VS2019 # Public Windows Build Pool - ${{ if and(or(eq(parameters.osGroup, 'windows'), eq(parameters.hostedOs, 'windows')), eq(variables['System.TeamProject'], 'public')) }}: + ${{ if and(or(eq(parameters.osGroup, 'windows'), eq(parameters.jobParameters.hostedOs, 'windows')), eq(variables['System.TeamProject'], 'public')) }}: name: NetCore1ESPool-Public demands: ImageOverride -equals Build.Windows.10.Amd64.VS2019.Open diff --git a/eng/pipelines/coreclr/perf_slow.yml b/eng/pipelines/coreclr/perf_slow.yml index e8410af6d361f9..04994eac96a44b 100644 --- a/eng/pipelines/coreclr/perf_slow.yml +++ b/eng/pipelines/coreclr/perf_slow.yml @@ -137,10 +137,11 @@ jobs: buildConfig: release container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 runtimeFlavor: mono + runtimeVariant: 'llvmaot' platforms: - Linux_arm64 jobParameters: - buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) + buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true nameSuffix: AOT isOfficialBuild: false extraStepsTemplate: /eng/pipelines/common/upload-artifact-step.yml diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index 0d41f151d6b554..8918ee8cbfcd39 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -30,8 +30,7 @@ jobs: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: checked platforms: - # Linux tests are built on the OSX machines. - # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -46,6 +45,16 @@ jobs: - Linux_x64 - windows_x64 +# superpmi-collect-job that targets macOS/arm64 depends on coreclr binaries produced by the macOS/x64 job +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml + buildConfig: checked + platforms: + - OSX_x64 + jobParameters: + testGroup: outerloop + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -62,6 +71,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -83,6 +93,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -105,6 +116,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -127,6 +139,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -148,6 +161,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 #TODO: Need special handling of running "benchmark build" from inside TMP folder on helix machine. # - Linux_arm # - Linux_arm64 diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml index c251c06f286793..2022a8c53a24fd 100644 --- a/eng/pipelines/coreclr/templates/build-jit-job.yml +++ b/eng/pipelines/coreclr/templates/build-jit-job.yml @@ -107,10 +107,10 @@ jobs: # Build CoreCLR JIT - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -component alljits + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -component alljits -component spmi displayName: Build CoreCLR JIT - ${{ if eq(parameters.osGroup, 'windows') }}: - - script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -component alljits + - script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -component alljits -component spmi displayName: Build CoreCLR JIT - ${{ if eq(parameters.uploadAs, 'azureBlob') }}: diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index b89cd621eda1ee..713882250e627a 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -132,10 +132,10 @@ jobs: value: '' - ${{ if ne(parameters.testGroup, 'innerloop') }}: - name: clrRuntimeComponentsBuildArg - value: '-component runtime -component alljits -component paltests -component nativeaot ' + value: '-component runtime -component alljits -component paltests -component nativeaot -component spmi ' - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.archType, 'x86')) }}: - name: clrRuntimeComponentsBuildArg - value: '-component runtime -component jit -component iltools ' + value: '-component runtime -component jit -component iltools -component spmi ' - name: pgoInstrumentArg value: '' diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index 1a5a3467587025..0b2e6f7f80ed2a 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -21,6 +21,7 @@ jobs: archType: ${{ parameters.archType }} container: ${{ parameters.container }} pool: ${{ parameters.pool }} + platform: ${{ parameters.platform }} shouldContinueOnError: ${{ parameters.shouldContinueOnError }} dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths}} runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml index dd1ff0ebd3b242..627d42fd7add18 100644 --- a/eng/pipelines/coreclr/templates/perf-job.yml +++ b/eng/pipelines/coreclr/templates/perf-job.yml @@ -57,7 +57,7 @@ jobs: - ${{ if and(eq(parameters.runtimeType, 'mono'), ne(parameters.codeGenType, 'AOT')) }}: - ${{ format('mono_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - ${{ if eq(parameters.runtimeType, 'wasm')}}: - - ${{ format('build_{0}{1}_{2}_{3}_{4}', 'Browser', '', 'wasm', parameters.buildConfig, parameters.runtimeType) }} + - ${{ format('build_{0}{1}_{2}_{3}_{4}_{5}', 'Browser', '', 'wasm', 'Linux', parameters.buildConfig, parameters.runtimeType) }} - ${{ if and(eq(parameters.codeGenType, 'AOT'), ne(parameters.runtimeType, 'wasm'))}}: - ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.codeGenType) }} - ${{ if eq(parameters.runtimeType, 'AndroidMono')}}: diff --git a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml index 1ac235f6f6d08e..be05b52b6b1859 100644 --- a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml +++ b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml @@ -106,7 +106,7 @@ jobs: steps: - ${{ parameters.steps }} - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -platform $(osGroup) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }} # Create required directories for merged mch collection and superpmi logs @@ -159,6 +159,10 @@ jobs: artifactName: 'SuperPMI_Collection_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' displayName: ${{ format('Upload artifacts SuperPMI {0}-{1} collection', parameters.collectionName, parameters.collectionType) }} + # Ensure the Python azure-storage-blob package is installed before doing the upload. + - script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall + displayName: Upgrade Pip to latest and install azure-storage-blob Python package + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) displayName: ${{ format('Upload SuperPMI {0}-{1} collection to Azure Storage', parameters.collectionName, parameters.collectionType) }} env: diff --git a/eng/pipelines/coreclr/templates/superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/superpmi-collect-job.yml index 6c990a25ff4aa3..652d17af08eba5 100644 --- a/eng/pipelines/coreclr/templates/superpmi-collect-job.yml +++ b/eng/pipelines/coreclr/templates/superpmi-collect-job.yml @@ -84,8 +84,8 @@ jobs: - template: /eng/pipelines/common/download-artifact-step.yml parameters: unpackFolder: '$(Build.SourcesDirectory)/artifacts/tests/libraries_zipped/$(osGroup).$(archType).$(buildConfigUpper)' - artifactFileName: 'libraries_test_assets_${{ parameters.osGroup }}_x64_Release$(archiveExtension)' - artifactName: ${{ format('libraries_test_assets_{0}_x64_Release', parameters.osGroup) }} + artifactFileName: 'libraries_test_assets_${{ parameters.osGroup }}_$(archType)_Release$(archiveExtension)' + artifactName: ${{ format('libraries_test_assets_{0}_$(archType)_Release', parameters.osGroup) }} displayName: 'generic libraries test artifacts' # Unzip individual test projects diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index ac074ab9903f8f..dec87138ed4563 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -21,6 +21,7 @@ jobs: archType: ${{ parameters.archType }} container: ${{ parameters.container }} pool: ${{ parameters.pool }} + platform: ${{ parameters.platform }} shouldContinueOnError: ${{ parameters.shouldContinueOnError }} dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths}} runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} @@ -28,26 +29,26 @@ jobs: # Linux arm - ${{ if eq(parameters.platform, 'Linux_arm') }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - (Debian.10.Arm32.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-arm32v7-20210304164340-6616c63 - (Debian.11.Arm32.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-helix-arm32v7-20210304164347-5a7c380 # Linux arm64 - ${{ if eq(parameters.platform, 'Linux_arm64') }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - - (Ubuntu.1804.ArmArch.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-helix-arm64v8-20210106155927-56c6673 + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - (Ubuntu.2110.Arm64.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-21.10-helix-arm64v8-20211116135000-0f8d97e - - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: + - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - (Ubuntu.1804.ArmArch.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-helix-arm64v8-20210106155927-56c6673 # Linux musl x64 - ${{ if eq(parameters.platform, 'Linux_musl_x64') }}: - - (Alpine.314.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64-20210910135833-1848e19 - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: + - (Alpine.314.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64-20210910135833-1848e19 + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - (Alpine.313.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-helix-amd64-20210910135845-8a6f4f3 # Linux musl arm64 - - ${{ if and(eq(parameters.platform, 'Linux_musl_arm64'), eq(parameters.jobParameters.isFullMatrix, true)) }}: + - ${{ if and(eq(parameters.platform, 'Linux_musl_arm64'), or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true))) }}: - (Alpine.313.Arm64.Open)ubuntu.1804.armarch.open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-helix-arm64v8-20210910135808-8a6f4f3 - (Alpine.314.Arm64.Open)ubuntu.1804.armarch.open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-arm64v8-20210910135810-8a6f4f3 @@ -62,21 +63,16 @@ jobs: - (Ubuntu.2110.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-21.10-helix-amd64-20211116135132-0f8d97e - (Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-bfcd90a-20200121150006 - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - - (Centos.7.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix-20210714125435-dde38af - - (Centos.8.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-helix-20201229003624-c1bf759 - - RedHat.7.Amd64.Open - - Ubuntu.1804.Amd64.Open - - SLES.12.Amd64.Open + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: + - (Centos.8.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-helix-20201229003624-c1bf759 - SLES.15.Amd64.Open - - (Fedora.34.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-34-helix-20210913123654-4f64125 - - (Ubuntu.2110.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-21.10-helix-amd64-20211116135132-0f8d97e - - (Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-20210304164434-56c6673 + - (Fedora.34.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-34-helix-20210913123654-4f64125 + - (Ubuntu.2110.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-21.04-helix-amd64-20210922170909-34a2d72 - (Debian.11.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-helix-amd64-20210304164428-5a7c380 - - (Mariner.1.0.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-1.0-helix-20210528192219-92bf620 - - (openSUSE.15.2.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64-20211018152525-9cc02fe - - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: - - (Centos.7.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix-20210714125435-dde38af + - (Mariner.1.0.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-1.0-helix-20210528192219-92bf620 + - (openSUSE.15.2.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64-20211018152525-9cc02fe + - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: + - (Centos.7.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix-20210714125435-dde38af - RedHat.7.Amd64.Open - (Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-20210304164434-56c6673 - Ubuntu.1804.Amd64.Open @@ -94,10 +90,9 @@ jobs: # OSX x64 - ${{ if eq(parameters.platform, 'OSX_x64') }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - OSX.1014.Amd64.Open - - OSX.1015.Amd64.Open - - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: + - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - OSX.1015.Amd64.Open # Android @@ -126,18 +121,18 @@ jobs: - ${{ if eq(parameters.platform, 'windows_x64') }}: # netcoreapp - ${{ if notIn(parameters.jobParameters.framework, 'net48') }}: + # libraries on mono outerloop - ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - Windows.81.Amd64.Open - Windows.10.Amd64.Server19H1.Open + # libraries on coreclr (outerloop and innerloop), or libraries on mono innerloop - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - - Windows.81.Amd64.Open + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - Windows.10.Amd64.ServerRS5.Open - - Windows.10.Amd64.Server19H1.Open - - ${{ if ne(parameters.jobParameters.runtimeFlavor, 'mono') }}: - - (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64-08e8e40-20200107182504 + - ${{ if ne(parameters.jobParameters.testScope, 'outerloop') }}: + - Windows.10.Amd64.Server19H1.Open - (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-amd64-20200904200251-272704c - - ${{ if ne(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - Windows.81.Amd64.Open - Windows.10.Amd64.Server19H1.ES.Open - Windows.11.Amd64.ClientPre.Open @@ -154,20 +149,18 @@ jobs: - ${{ if eq(parameters.platform, 'windows_x86') }}: # netcoreapp - ${{ if notIn(parameters.jobParameters.framework, 'net48') }}: + # mono outerloop - ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - Windows.7.Amd64.Open - Windows.10.Amd64.ServerRS5.Open + # libraries on coreclr (outerloop and innerloop), or libraries on mono innerloop - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - - Windows.7.Amd64.Open + - ${{ if or(eq(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - Windows.10.Amd64.ServerRS5.Open - Windows.10.Amd64.Server19H1.Open - - ${{ if ne(parameters.jobParameters.isFullMatrix, true) }}: - - ${{ if eq(parameters.jobParameters.buildConfig, 'Release') }}: - - Windows.10.Amd64.Server19H1.ES.Open - - ${{ if eq(parameters.jobParameters.buildConfig, 'Debug') }}: - - Windows.7.Amd64.Open - - Windows.10.Amd64.Server19H1.Open + - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: + - Windows.10.Amd64.Server19H1.ES.Open + - Windows.7.Amd64.Open # .NETFramework - ${{ if eq(parameters.jobParameters.framework, 'net48') }}: diff --git a/eng/pipelines/libraries/outerloop-mono.yml b/eng/pipelines/libraries/outerloop-mono.yml index 1267cf72a62dea..17a7101e26004a 100644 --- a/eng/pipelines/libraries/outerloop-mono.yml +++ b/eng/pipelines/libraries/outerloop-mono.yml @@ -23,7 +23,7 @@ jobs: platforms: - windows_x86 - Browser_wasm - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - windows_x64 - Linux_x64 - Linux_arm @@ -34,7 +34,7 @@ jobs: nameSuffix: AllSubsets_Mono buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true timeoutInMinutes: 180 - isFullMatrix: ${{ variables['isFullMatrix'] }} + includeAllPlatforms: ${{ variables['isRollingBuild'] }} # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -44,7 +44,7 @@ jobs: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) - - ${{ if eq(variables['isFullMatrix'], false) }}: + - ${{ if eq(variables['isRollingBuild'], false) }}: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml @@ -61,7 +61,7 @@ jobs: nameSuffix: AllSubsets_Mono buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true timeoutInMinutes: 180 - isFullMatrix: ${{ variables['isFullMatrix'] }} + includeAllPlatforms: ${{ variables['isRollingBuild'] }} # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml index 28932a0baff3ce..72c2de49363a25 100644 --- a/eng/pipelines/libraries/outerloop.yml +++ b/eng/pipelines/libraries/outerloop.yml @@ -27,7 +27,7 @@ jobs: - ${{ if eq(variables['includeLinuxOuterloop'], true) }}: - Linux_x64 - Linux_musl_x64 - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - Linux_arm - Linux_arm64 - Linux_musl_arm64 @@ -46,27 +46,27 @@ jobs: platforms: - ${{ if eq(variables['includeWindowsOuterloop'], true) }}: - windows_x86 - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - windows_x64 - ${{ if eq(variables['includeLinuxOuterloop'], true) }}: - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - Linux_x64 - Linux_arm - Linux_arm64 - Linux_musl_x64 - Linux_musl_arm64 - - ${{ if and(eq(variables['includeOsxOuterloop'], true), eq(variables['isFullMatrix'], true)) }}: + - ${{ if and(eq(variables['includeOsxOuterloop'], true), eq(variables['isRollingBuild'], true)) }}: - OSX_arm64 - OSX_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: ${{ variables['isOfficialBuild'] }} - isFullMatrix: ${{ variables['isFullMatrix'] }} + includeAllPlatforms: ${{ variables['isRollingBuild'] }} runTests: true testScope: outerloop liveRuntimeBuildConfig: release - - ${{ if eq(variables['isFullMatrix'], false) }}: + - ${{ if eq(variables['isRollingBuild'], false) }}: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/libraries/build-job.yml @@ -83,7 +83,7 @@ jobs: helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: ${{ variables['isOfficialBuild'] }} - isFullMatrix: ${{ variables['isFullMatrix'] }} + includeAllPlatforms: ${{ variables['isRollingBuild'] }} runTests: true testScope: outerloop liveRuntimeBuildConfig: release @@ -95,12 +95,12 @@ jobs: buildConfig: Release platforms: - windows_x86 - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - windows_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: ${{ variables['isOfficialBuild'] }} - isFullMatrix: ${{ variables['isFullMatrix'] }} + includeAllPlatforms: ${{ variables['isRollingBuild'] }} framework: net48 runTests: true testScope: outerloop diff --git a/eng/pipelines/libraries/variables.yml b/eng/pipelines/libraries/variables.yml index 9bb89d7d493847..2abd5adabe2c9f 100644 --- a/eng/pipelines/libraries/variables.yml +++ b/eng/pipelines/libraries/variables.yml @@ -6,7 +6,7 @@ variables: value: $(Build.SourcesDirectory)/src/libraries - name: pipelinesPath value: /eng/pipelines/libraries - - name: isFullMatrix + - name: isRollingBuild value: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} - name: includeWindowsOuterloop value: ${{ or(endsWith(variables['Build.DefinitionName'], 'windows'), endsWith(variables['Build.DefinitionName'], 'outerloop')) }} diff --git a/eng/pipelines/runtime-community.yml b/eng/pipelines/runtime-community.yml index 5bebcc00a2663e..f588ad52b0f330 100644 --- a/eng/pipelines/runtime-community.yml +++ b/eng/pipelines/runtime-community.yml @@ -46,7 +46,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -56,4 +56,4 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) diff --git a/eng/pipelines/runtime-manual.yml b/eng/pipelines/runtime-extra-platforms.yml similarity index 61% rename from eng/pipelines/runtime-manual.yml rename to eng/pipelines/runtime-extra-platforms.yml index a4391cff70da59..d9121f4b8027a0 100644 --- a/eng/pipelines/runtime-manual.yml +++ b/eng/pipelines/runtime-extra-platforms.yml @@ -1,161 +1,125 @@ +# This pipeline includes the platforms that we don't have resources to run on every PR but that we want +# to still have test coverage, we run this pipeline on a schedule and also developers can run it +# via /azp run command on PRs. This pipeline permits us to have the main runtime pipeline run the same +# platforms in PRs and Scheduled builds. + +# Setting batch to true, triggers one build at a time. +# if there is a push while a build in progress, it will wait, +# until the running build finishes, and produce a build with all the changes +# that happened during the last build. trigger: none +schedules: + - cron: "0 9,21 * * *" # run at 9:00 and 21:00 (UTC) which is 1:00 and 13:00 (PST). + displayName: Runtime extra main schedule + branches: + include: + - main + always: false # run only if there were changes since the last successful scheduled run. + - cron: "0 6,18 * * *" # run at 6:00 and 18:00 (UTC) which is 22:00 and 10:00 (PST). + displayName: Runtime extra release schedule + branches: + include: + - release/* + always: false # run only if there were changes since the last successful scheduled run. + variables: - template: /eng/pipelines/common/variables.yml jobs: # -# iOS/tvOS interp - requires AOT Compilation and Interp flags -# Build the whole product using Mono and run libraries tests +# Evaluate paths # -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - iOSSimulator_x64 - - tvOSSimulator_x64 - - iOSSimulator_arm64 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true - timeoutInMinutes: 180 - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - interpreter: true - testRunNamePrefixSuffix: Mono_$(_BuildConfig) +- ${{ if eq(variables.dependOnEvaluatePaths, true) }}: + - template: /eng/pipelines/common/evaluate-default-paths.yml # -# MacCatalyst interp - requires AOT Compilation and Interp flags -# Build the whole product using Mono and run libraries tests +# Build CoreCLR release +# Always as they are needed by Installer and we always build and test the Installer. # - template: /eng/pipelines/common/platform-matrix.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml + buildConfig: release platforms: - - MacCatalyst_x64 - # don't run tests on arm64 PRs until we can get significantly more devices - - ${{ if eq(variables['isFullMatrix'], true) }}: - - MacCatalyst_arm64 + - Linux_x64 + - Linux_arm + - Linux_arm64 + - Linux_musl_x64 + - OSX_x64 + - windows_x64 + - windows_x86 + - windows_arm64 jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true - timeoutInMinutes: 180 - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - interpreter: true - testRunNamePrefixSuffix: Mono_$(_BuildConfig) # -# MacCatalyst interp - requires AOT Compilation and Interp flags -# Build the whole product using Mono and run libraries tests -# The test app is built with the App Sandbox entitlement +# Build libraries using live CoreLib # - template: /eng/pipelines/common/platform-matrix.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + jobTemplate: /eng/pipelines/libraries/build-job.yml buildConfig: Release - runtimeFlavor: mono platforms: - - MacCatalyst_x64 - # don't run tests on arm64 PRs until we can get significantly more devices - - ${{ if eq(variables['isFullMatrix'], true) }}: - - MacCatalyst_arm64 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono_AppSandbox - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true /p:EnableAppSandbox=true - timeoutInMinutes: 180 - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - interpreter: true - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + - Linux_x64 + - Linux_arm + - Linux_arm64 + - Linux_musl_x64 + - OSX_x64 + - windows_x64 + - windows_x86 + - windows_arm64 # -# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size -# Build the whole product using Mono and run libraries tests +# Libraries Release Test Execution against a release coreclr runtime +# Only when the PR contains a libraries change # - template: /eng/pipelines/common/platform-matrix.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + jobTemplate: /eng/pipelines/libraries/run-test-job.yml buildConfig: Release - runtimeFlavor: mono platforms: - - iOS_arm64 - - tvOS_arm64 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true - timeoutInMinutes: 180 - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true - -# -# Build the whole product using Mono and run libraries tests -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml + - Linux_x64 + - Linux_arm + - Linux_arm64 + - Linux_musl_x64 + - OSX_x64 + - windows_x64 + - windows_x86 + - windows_arm64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Android_x86 - - Android_x64 jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) - timeoutInMinutes: 180 - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + isOfficialBuild: false + isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }} + testScope: innerloop + liveRuntimeBuildConfig: release + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(variables['isRollingBuild'], true)) +# Run net48 tests on win-x64 - template: /eng/pipelines/common/platform-matrix.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + jobTemplate: /eng/pipelines/libraries/build-job.yml buildConfig: Release - runtimeFlavor: mono platforms: - - Android_arm - - Android_arm64 + - windows_x64 + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) - timeoutInMinutes: 180 - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + framework: net48 + runTests: true + testScope: innerloop + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(variables['isRollingBuild'], true)) + +#### MONO LEGS # -# Build the whole product using Mono and run libraries tests +# Build the whole product using Mono and run libraries tests, for Wasm.Build.Tests # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -164,131 +128,133 @@ jobs: buildConfig: Release runtimeFlavor: mono platforms: - - Windows_x64 + # BuildWasmApps should only happen on the extra platforms build as we already have coverage for this build on PRs. + - Browser_wasm + - Browser_wasm_win + variables: + # map dependencies variables to local variables + - name: wasmbuildtestsContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ] jobParameters: - testScope: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true - timeoutInMinutes: 120 + isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }} + testGroup: innerloop + nameSuffix: WasmBuildTests + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmBuildTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs) + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + testRunNamePrefixSuffix: Mono_$(_BuildConfig)_$(_hostedOs) + extraHelixArguments: /p:BrowserHost=$(_hostedOs) + scenarios: + - buildwasmapps + condition: >- + or( + eq(variables['wasmbuildtestsContainsChange'], true), + eq(variables['isRollingBuild'], true)) # -# Build the whole product using Mono for Android and run runtime tests with interpreter +# Build Browser_wasm, on windows, run console and browser tests # - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: release runtimeFlavor: mono platforms: - - Android_x64 + - Browser_wasm_win variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests_Interp - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 240 - runtimeVariant: monointerpreter + nameSuffix: ConsoleBrowserTests + buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isRollingBuild'], true)) # extra steps, run tests - extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + testRunNamePrefixSuffix: Windows_wasm_$(_BuildConfig) + extraHelixArguments: /p:BrowserHost=windows + scenarios: + - normal + - wasmtestonbrowser + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) # -# Build the whole product using Mono and run runtime tests with the JIT. +# Build for Browser/wasm, with EnableAggressiveTrimming=true # - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml buildConfig: Release runtimeFlavor: mono platforms: - - iOSSimulator_x64 + - Browser_wasm variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: + isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }} testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 240 + nameSuffix: AllSubsets_Mono_EAT + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=false + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isRollingBuild'], true)) # extra steps, run tests - extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) + scenarios: + - normal + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) # -# Build the whole product using Mono for Android and run runtime tests with Android devices -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Android_arm64 - variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 240 - # don't run tests on PRs until we can get significantly more devices - # Turn off the testing for now, until https://github.com/dotnet/xharness/issues/663 gets resolved - # ${{ if eq(variables['isFullMatrix'], true) }}: - # # extra steps, run tests - # extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml - # extraStepsParameters: - # creator: dotnet-bot - # testRunNamePrefixSuffix: Mono_$(_BuildConfig) - -# -# Build Browser_wasm, on windows, run console and browser tests +# Build for Browser/wasm with RunAOTCompilation=true # - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: release + buildConfig: Release runtimeFlavor: mono platforms: + - Browser_wasm - Browser_wasm_win variables: # map dependencies variables to local variables @@ -297,78 +263,79 @@ jobs: - name: monoContainsChange value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: + isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }} testGroup: innerloop - nameSuffix: Windows_wasm - buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows + nameSuffix: AllSubsets_Mono_AOT + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true /p:BrowserHost=$(_hostedOs) timeoutInMinutes: 180 condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows + testRunNamePrefixSuffix: Mono_AOT_$(_BuildConfig)_$(_hostedOs) + extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) /p:BrowserHost=$(_hostedOs) scenarios: - normal - - WasmTestOnBrowser - - WasmTestOnNodeJs condition: >- or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) +# +# Build the whole product using Mono and run runtime tests +# - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: release + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release runtimeFlavor: mono platforms: - - Browser_wasm_win + - Browser_wasm variables: - # map dependencies variables to local variables - - name: wasmbuildtestsContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ] + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 10 + - name: timeoutPerTestCollectionInMinutes + value: 200 jobParameters: testGroup: innerloop - nameSuffix: Windows_wasm_WBT - buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:TestWasmBuildTests=true /p:TestAssemblies=false + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) timeoutInMinutes: 180 condition: >- or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows - scenarios: - - buildwasmapps - condition: >- - or( - eq(variables['wasmbuildtestsContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) +# +# Build the whole product using Mono and run libraries tests +# - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: release + buildConfig: Release runtimeFlavor: mono platforms: - - Browser_wasm_win + - Windows_x64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -376,34 +343,30 @@ jobs: - name: monoContainsChange value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: - testGroup: innerloop - nameSuffix: Windows_wasm_AOT - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) - timeoutInMinutes: 180 + testScope: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true + timeoutInMinutes: 120 condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) - scenarios: - - normal condition: >- or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # -# Build for Browser/wasm, with EnableAggressiveTrimming=true +# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size +# Build the whole product using Mono and run libraries tests # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -412,7 +375,8 @@ jobs: buildConfig: Release runtimeFlavor: mono platforms: - - Browser_wasm + - iOS_arm64 + - tvOS_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -421,21 +385,26 @@ jobs: value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_Mono_EAT - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=false /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=false + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true /p:RunSmokeTestsOnly=false - scenarios: - - normal + extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) -# -# Build for Browser/wasm with RunAOTCompilation=true -# - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml @@ -443,7 +412,8 @@ jobs: buildConfig: Release runtimeFlavor: mono platforms: - - Browser_wasm + - Android_arm + - Android_arm64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -452,20 +422,27 @@ jobs: value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_Mono_AOT - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=false /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true /p:RunSmokeTestsOnly=false - scenarios: - - normal + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) # -# Build for Browser/wasm and test it on NodeJS +# Build for Browser/wasm and test it on v8, browser, and nodejs # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -477,8 +454,6 @@ jobs: - Browser_wasm variables: # map dependencies variables to local variables - - name: librariesContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - name: monoContainsChange value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: @@ -488,57 +463,59 @@ jobs: timeoutInMinutes: 180 condition: >- or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) scenarios: + - normal + - WasmTestOnBrowser - WasmTestOnNodeJs condition: >- or( - eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono and run runtime tests +# Build Mono release +# Only when libraries, mono, or the runtime tests changed +# Currently only these architectures are needed for the runtime tests. +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/mono/templates/build-job.yml + runtimeFlavor: mono + buildConfig: release + platforms: + - Linux_arm64 + jobParameters: + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isRollingBuild'], true)) + # +# Mono Test builds with CoreCLR runtime tests using live libraries debug build +# Only when Mono is changed - template: /eng/pipelines/common/platform-matrix.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release + jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml + buildConfig: release runtimeFlavor: mono platforms: - - Browser_wasm - variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 10 - - name: timeoutPerTestCollectionInMinutes - value: 200 + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 180 - # NOTE: Per PR test execution is not recommended for mobile runtime tests - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) # Wasm debugger tests - template: /eng/pipelines/common/platform-matrix.yml @@ -561,8 +538,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -592,8 +568,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -630,9 +605,100 @@ jobs: nameSuffix: AllSubsets_Mono_RuntimeTests buildArgs: -s mono+libs -c $(_BuildConfig) timeoutInMinutes: 240 - # NOTE: Per PR test execution is not recommended for mobile runtime tests + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml extraStepsParameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono for Android and run runtime tests with interpreter +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_x64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests_Interp + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + runtimeVariant: monointerpreter + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isRollingBuild'], true)) + # NOTE: Per PR test execution is not recommended for runtime tests + ${{ if eq(variables['isRollingBuild'], true) }}: + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Mono CoreCLR runtime Test executions using live libraries in jit mode +# Only when Mono is changed +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Linux_arm64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + liveRuntimeBuildConfig: release + runtimeVariant: minijit + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) + +# +# Mono CoreCLR runtime Test executions using live libraries in interpreter mode +# Only when Mono is changed +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Linux_arm64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + liveRuntimeBuildConfig: release + runtimeVariant: monointerpreter + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 34b0ae68c78e25..1ad7ad72d31716 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -416,7 +416,7 @@ stages: - Build_Android_arm64_release_AllSubsets_Mono - Build_Android_x86_release_AllSubsets_Mono - Build_Android_x64_release_AllSubsets_Mono - - Build_Browser_wasm_release_AllSubsets_Mono + - Build_Browser_wasm_Linux_release_AllSubsets_Mono - Build_iOS_arm_release_AllSubsets_Mono - Build_iOS_arm64_release_AllSubsets_Mono - Build_iOSSimulator_x64_release_AllSubsets_Mono diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 4288d372433df7..42803677d00371 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -75,7 +75,7 @@ jobs: - iOSSimulator_x64 - tvOSSimulator_x64 # don't run tests on arm64 PRs until we can get significantly more devices - - ${{ if eq(variables['isManualOrIsNotPR'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - iOSSimulator_arm64 variables: # map dependencies variables to local variables @@ -93,8 +93,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -105,8 +104,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # MacCatalyst interp - requires AOT Compilation and Interp flags @@ -121,7 +119,7 @@ jobs: platforms: - MacCatalyst_x64 # don't run tests on arm64 PRs until we can get significantly more devices - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - MacCatalyst_arm64 variables: # map dependencies variables to local variables @@ -139,8 +137,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -149,10 +146,9 @@ jobs: testRunNamePrefixSuffix: Mono_$(_BuildConfig) condition: >- or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) # # MacCatalyst interp - requires AOT Compilation and Interp flags @@ -168,7 +164,7 @@ jobs: platforms: - MacCatalyst_x64 # don't run tests on arm64 PRs until we can get significantly more devices - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - MacCatalyst_arm64 variables: # map dependencies variables to local variables @@ -185,8 +181,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -195,53 +190,9 @@ jobs: testRunNamePrefixSuffix: Mono_$(_BuildConfig) condition: >- or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) - -# -# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size -# Build the whole product using Mono and run libraries tests -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - iOS_arm64 - - tvOS_arm64 - variables: - # map dependencies variables to local variables - - name: librariesContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono and run libraries tests @@ -271,88 +222,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Android_arm - - Android_arm64 - variables: - # map dependencies variables to local variables - - name: librariesContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - -# -# Build the whole product using Mono and run libraries tests -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Windows_x64 - variables: - # map dependencies variables to local variables - - name: librariesContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] - jobParameters: - testScope: innerloop - nameSuffix: AllSubsets_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true - timeoutInMinutes: 120 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -362,50 +232,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - -# -# Build the whole product using Mono for Android and run runtime tests with interpreter -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Android_x64 - variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests_Interp - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 240 - runtimeVariant: monointerpreter - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # NOTE: Per PR test execution is not recommended for runtime tests - ${{ if eq(variables['isManualOrIsNotPR'], true) }}: - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) + eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono and run runtime tests with the JIT. @@ -438,9 +265,8 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - ${{ if eq(variables['isManualOrIsNotPR'], true) }}: + eq(variables['isRollingBuild'], true)) + ${{ if eq(variables['isRollingBuild'], true) }}: # extra steps, run tests extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml extraStepsParameters: @@ -478,205 +304,16 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # don't run tests on PRs until we can get significantly more devices # Turn off the testing for now, until https://github.com/dotnet/runtime/issues/60128 gets resolved - # ${{ if eq(variables['isFullMatrix'], true) }}: + # ${{ if eq(variables['isRollingBuild'], true) }}: # # extra steps, run tests # extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml # extraStepsParameters: # creator: dotnet-bot # testRunNamePrefixSuffix: Mono_$(_BuildConfig) -# -# Build Browser_wasm, on windows, run console and browser tests -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: release - runtimeFlavor: mono - platforms: - - Browser_wasm_win - variables: - # map dependencies variables to local variables - - name: librariesContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: Windows_wasm - buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows $(_runSmokeTestsOnlyArg) - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows $(_runSmokeTestsOnlyArg) - scenarios: - - normal - - WasmTestOnBrowser - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - -# -# Build Browser_wasm, on windows, and run tests with AOT -# -# Disabled due to https://github.com/dotnet/runtime/issues/61721 -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: release - runtimeFlavor: mono - platforms: - - Browser_wasm_win - variables: - # map dependencies variables to local variables - - name: librariesContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] - - name: monoContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: Windows_wasm_AOT - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) - scenarios: - - normal - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) - -# -# Build Browser_wasm, on windows, and run Wasm.Build.Tests -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: release - runtimeFlavor: mono - platforms: - - Browser_wasm_win - variables: - # map dependencies variables to local variables - - name: wasmbuildtestsContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: Windows_wasm_WBT - buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:TestWasmBuildTests=true /p:TestAssemblies=false - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows - scenarios: - - buildwasmapps - condition: >- - or( - eq(variables['wasmbuildtestsContainsChange'], true), - eq(variables['isManualOrIsNotPR'], true), - eq(variables['isFullMatrix'], true)) - -# Wasm debugger tests -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Browser_wasm - variables: - # map dependencies variables to local variables - - name: wasmdebuggertestsContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: Mono_DebuggerTests - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - scenarios: - - wasmdebuggertests - -# Wasm debugger tests - windows -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Browser_wasm_win - variables: - # map dependencies variables to local variables - - name: wasmdebuggertestsContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'] ] - jobParameters: - testGroup: innerloop - nameSuffix: Windows_wasm_DebuggerTests - buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=windows - timeoutInMinutes: 180 - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmdebuggertests.containsChange'], true), - eq(variables['isFullMatrix'], true)) - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows - scenarios: - - wasmdebuggertests - # # CoreCLR Build for running Apple Silicon libraries-innerloop # @@ -685,7 +322,7 @@ jobs: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: release platforms: - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - OSX_arm64 jobParameters: testGroup: innerloop @@ -697,12 +334,11 @@ jobs: jobTemplate: /eng/pipelines/libraries/build-job.yml buildConfig: Release platforms: - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isRollingBuild'], true) }}: - OSX_arm64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: ${{ variables['isOfficialBuild'] }} - isFullMatrix: ${{ variables['isFullMatrix'] }} runTests: true testScope: innerloop liveRuntimeBuildConfig: release diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 5d7f3ffde2f81b..cfc899e8d808de 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -91,7 +91,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build the whole product using GNU compiler toolchain @@ -114,7 +114,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build CoreCLR OSX_x64 checked @@ -133,7 +133,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build CoreCLR release @@ -178,7 +178,7 @@ jobs: # # Build CoreCLR Formatting Job # Only when CoreCLR is changed, and only in the 'main' branch (no release branches; -# both CI and PR builds). +# both Rolling and PR builds). # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -194,7 +194,7 @@ jobs: eq(variables['System.PullRequest.TargetBranch'], 'main')), or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr_jit.containsChange'], true), - eq(variables['isFullMatrix'], true))) + eq(variables['isRollingBuild'], true))) # # CoreCLR NativeAOT debug build and smoke tests @@ -277,7 +277,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # Build Mono AOT offset headers once, for consumption elsewhere # Only when mono changed @@ -297,7 +297,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # Build the whole product using Mono runtime # Only when libraries, mono or installer are changed @@ -323,7 +323,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -343,7 +343,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono and run libraries tests, multi-scenario @@ -372,7 +372,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -385,7 +385,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build the whole product using Mono and run libraries tests, for Wasm.Build.Tests @@ -410,7 +410,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -420,8 +420,8 @@ jobs: - buildwasmapps condition: >- or( - eq(variables['wasmbuildtestsContainsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['wasmbuildtestsContainsChange'], true), + eq(variables['isRollingBuild'], true)) # # Build for Browser/wasm, with EnableAggressiveTrimming=true @@ -450,7 +450,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -463,7 +463,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build for Browser/wasm with RunAOTCompilation=true @@ -492,7 +492,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml extraStepsParameters: @@ -505,7 +505,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # Build and test libraries under single-file publishing - template: /eng/pipelines/common/platform-matrix.yml @@ -518,7 +518,6 @@ jobs: - Linux_x64 jobParameters: testGroup: innerloop - isFullMatrix: ${{ variables.isFullMatrix }} isSingleFile: true nameSuffix: SingleFile buildArgs: -s clr+libs+libs.tests -c $(_BuildConfig) /p:TestSingleFile=true /p:ArchiveTests=true @@ -529,78 +528,6 @@ jobs: creator: dotnet-bot testRunNamePrefixSuffix: SingleFile_$(_BuildConfig) -# -# Build the whole product using Mono and run runtime tests -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Browser_wasm - variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 10 - - name: timeoutPerTestCollectionInMinutes - value: 200 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 180 - condition: >- - eq(variables['isFullMatrix'], true) - # NOTE: Per PR test execution is not recommended for mobile runtime tests - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - -# -# Build the whole product using Mono for Android and run runtime tests with Android emulator -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - runtimeFlavor: mono - platforms: - - Android_x64 - variables: - - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: pr/dotnet/runtime/$(Build.SourceBranch) - - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - name: _HelixSource - value: ci/dotnet/runtime/$(Build.SourceBranch) - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: innerloop - nameSuffix: AllSubsets_Mono_RuntimeTests - buildArgs: -s mono+libs -c $(_BuildConfig) - timeoutInMinutes: 240 - condition: >- - eq(variables['isFullMatrix'], true) - # NOTE: Per PR test execution is not recommended for mobile runtime tests - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - # # Build Mono and Installer on LLVMJIT mode # @@ -621,7 +548,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -641,7 +568,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build Mono and Installer on LLVMAOT mode @@ -664,7 +591,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -683,7 +610,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build Mono debug @@ -709,7 +636,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build Mono release AOT cross-compilers @@ -740,7 +667,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -767,7 +694,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build Mono release @@ -790,7 +717,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build Mono release @@ -810,7 +737,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build Mono release with LLVM AOT @@ -830,7 +757,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Build libraries using live CoreLib @@ -849,8 +776,6 @@ jobs: - windows_arm - windows_arm64 - windows_x86 - jobParameters: - liveRuntimeBuildConfig: release - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -864,9 +789,12 @@ jobs: - OSX_x64 - windows_x64 - FreeBSD_x64 + - ${{ if eq(variables['isRollingBuild'], false) }}: + # we need to build windows_x86 for debug on PRs in order to test + # against a checked runtime when the PR contains coreclr changes + - windows_x86 jobParameters: testScope: innerloop - liveRuntimeBuildConfig: release # # Libraries Build that only run when coreclr is changed @@ -874,7 +802,7 @@ jobs: # and those are already built above # -- ${{ if eq(variables['isFullMatrix'], false) }}: +- ${{ if eq(variables['isRollingBuild'], false) }}: - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/libraries/build-job.yml @@ -884,45 +812,24 @@ jobs: - Linux_musl_arm - Linux_musl_arm64 jobParameters: - liveRuntimeBuildConfig: release condition: >- eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true) -# -# Libraries Build that only run when libraries is changed -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-job.yml - buildConfig: ${{ variables.debugOnPrReleaseOnRolling }} - platforms: - - ${{ if eq(variables['isFullMatrix'], false) }}: - - windows_x86 - jobParameters: - liveRuntimeBuildConfig: release - condition: >- - or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) - - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/libraries/build-job.yml buildConfig: Release platforms: - windows_x86 - - ${{ if eq(variables['isFullMatrix'], true) }}: - - windows_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: - isFullMatrix: ${{ variables.isFullMatrix }} framework: net48 runTests: true testScope: innerloop condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -931,14 +838,13 @@ jobs: platforms: - windows_x64 jobParameters: - isFullMatrix: ${{ variables.isFullMatrix }} framework: allConfigurations runTests: true useHelix: false condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Installer Build and Test @@ -1006,7 +912,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # CoreCLR Test executions using live libraries @@ -1029,7 +935,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1049,7 +955,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1065,7 +971,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr_AppleSilicon.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Mono Test builds with CoreCLR runtime tests using live libraries debug build @@ -1083,7 +989,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Mono CoreCLR runtime Test executions using live libraries in jit mode @@ -1095,8 +1001,6 @@ jobs: runtimeFlavor: mono platforms: - OSX_x64 - - ${{ if eq(variables['isFullMatrix'], true) }}: - - Linux_arm64 helixQueueGroup: pr helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml jobParameters: @@ -1108,7 +1012,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Mono CoreCLR runtime Test executions using live libraries in interpreter mode @@ -1120,8 +1024,6 @@ jobs: runtimeFlavor: mono platforms: - OSX_x64 - - ${{ if eq(variables['isFullMatrix'], true) }}: - - Linux_arm64 helixQueueGroup: pr helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml jobParameters: @@ -1133,7 +1035,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Mono CoreCLR runtime Test executions using live libraries and LLVM AOT # Only when Mono is changed @@ -1158,7 +1060,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Mono CoreCLR runtime Test executions using live libraries and LLVM Full AOT @@ -1184,7 +1086,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Libraries Release Test Execution against a release mono runtime. @@ -1203,7 +1105,6 @@ jobs: helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: false - isFullMatrix: ${{ variables.isFullMatrix }} runtimeDisplayName: mono testScope: innerloop liveRuntimeBuildConfig: release @@ -1211,7 +1112,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Libraries Release Test Execution against a release mono interpreter runtime. @@ -1229,7 +1130,6 @@ jobs: helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: false - isFullMatrix: ${{ variables.isFullMatrix }} interpreter: true runtimeDisplayName: mono_interpreter testScope: innerloop @@ -1238,7 +1138,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Libraries Release Test Execution against a release coreclr runtime @@ -1250,18 +1150,15 @@ jobs: buildConfig: Release platforms: - windows_x86 - - ${{ if eq(variables['isFullMatrix'], true) }}: - - windows_arm64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: false - isFullMatrix: ${{ variables.isFullMatrix }} testScope: innerloop liveRuntimeBuildConfig: release condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Libraries Debug Test Execution against a release coreclr runtime @@ -1276,20 +1173,15 @@ jobs: - OSX_x64 - Linux_x64 - Linux_musl_x64 - - ${{ if eq(variables['isFullMatrix'], true) }}: - - Linux_arm64 - - ${{ if eq(variables['isFullMatrix'], false) }}: - - windows_x86 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isOfficialBuild: false - isFullMatrix: ${{ variables.isFullMatrix }} testScope: innerloop liveRuntimeBuildConfig: release condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Libraries Test Execution against a checked runtime @@ -1313,7 +1205,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) # # Libraries Test Execution against a checked runtime @@ -1335,7 +1227,7 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1352,4 +1244,4 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) + eq(variables['isRollingBuild'], true)) diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 9f1cd90822e832..27e954a9a70267 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -190,7 +190,7 @@ stages: - Linux_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: - isFullMatrix: false + isRollingBuild: false isOfficialBuild: false testScope: innerloop liveRuntimeBuildConfig: Release @@ -207,7 +207,7 @@ stages: - windows_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: - isFullMatrix: false + isRollingBuild: false isOfficialBuild: false testScope: innerloop liveRuntimeBuildConfig: Release diff --git a/eng/run-test.sh b/eng/run-test.sh index 64474cc435af16..0475cff40cd839 100644 --- a/eng/run-test.sh +++ b/eng/run-test.sh @@ -31,7 +31,7 @@ usage() echo " default: Debug" echo " --os OS to run (FreeBSD, Linux, NetBSD, illumos or Solaris)" echo " default: detect current OS" - echo " --arch Architecture to run (x64, arm, armel, x86, arm64)" + echo " --arch Architecture to run (x64, arm, armel, x86, arm64, loongarch64)" echo " default: detect current architecture" echo echo "Execution options:" diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets index 9dd37bef8fa1c3..4213c84e709d9c 100644 --- a/eng/targetingpacks.targets +++ b/eng/targetingpacks.targets @@ -33,7 +33,7 @@ LatestRuntimeFrameworkVersion="$(ProductVersion)" RuntimeFrameworkName="$(LocalFrameworkOverrideName)" RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**" - RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64" + RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64" TargetFramework="$(NetCoreAppCurrent)" TargetingPackName="$(LocalFrameworkOverrideName).Ref" TargetingPackVersion="$(ProductVersion)" @@ -43,13 +43,13 @@ RuntimeFrameworkName="$(LocalFrameworkOverrideName)" LatestRuntimeFrameworkVersion="$(ProductVersion)" RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**" - RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86" + RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86" RuntimePackLabels="Mono" Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 8c7a6a44a5d22f..c41a0d28e03375 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -130,7 +130,6 @@ - @@ -169,6 +168,7 @@ + diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 192363c4b170a1..da8da1d2f4bfa9 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -198,7 +198,8 @@ + AfterTargets="ComputeResolvedFilesToPublishList" + Condition="'$(TestFramework)' == 'xunit'"> <_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'Android'" /> <_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'" /> diff --git a/eng/testing/tests.props b/eng/testing/tests.props index a6a9034a8099d2..3025ab62335049 100644 --- a/eng/testing/tests.props +++ b/eng/testing/tests.props @@ -7,6 +7,7 @@ $(TestDependsOn);GenerateRunScript;RunTests true $(MSBuildThisFileDirectory)ILLinkDescriptors\ + true @@ -38,6 +39,10 @@ + + + + + true + + + + + + + + + + + + + + diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 6706d6e6d64529..5874fa58f8a5ec 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -110,13 +110,18 @@ - + "$(RunScriptOutputPath)" $(RunTestsCommand) --runtime-path "$(NetCoreAppCurrentTestHostPath.TrimEnd('\/'))" $(RunTestsCommand) --rsp-file "$(TestRspFile)" - "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName) $(AdditionalXHarnessArguments) + + + + "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName) + $(RunTestsCommand) $(Configuration) $(AdditionalXHarnessArguments) + $(RunTestsCommand) $(AdditionalXHarnessArguments) "$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(Scenario) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 273ab76ef90a3f..bed571a3064021 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -29,13 +29,13 @@ See also eng\testing\WasmRunnerTemplate.sh --> - + - + @@ -47,7 +47,8 @@ <_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode) <_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs) - <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll + <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps' and '$(WasmMainAssemblyFileName)' == ''">--run WasmTestRunner.dll $(AssemblyName).dll + <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName) <_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll <_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs) diff --git a/eng/testing/xunit/xunit.props b/eng/testing/xunit/xunit.props index 3f9c4b67141a2f..a2ed68f1ecbc96 100644 --- a/eng/testing/xunit/xunit.props +++ b/eng/testing/xunit/xunit.props @@ -10,6 +10,7 @@ + diff --git a/global.json b/global.json index e2c9f881274f55..6e753c749b04a4 100644 --- a/global.json +++ b/global.json @@ -12,12 +12,12 @@ "python3": "3.7.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.21621.3", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21621.3", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21621.3", - "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.21621.3", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.22068.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22068.3", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22068.3", + "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22068.3", "Microsoft.Build.NoTargets": "3.1.0", "Microsoft.Build.Traversal": "3.0.23", - "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.21620.1" + "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.22066.4" } } diff --git a/src/coreclr/.nuget/Microsoft.ILVerification/Microsoft.ILVerification.pkgproj b/src/coreclr/.nuget/Microsoft.ILVerification/Microsoft.ILVerification.pkgproj index db820d395a1256..685f9415101950 100644 --- a/src/coreclr/.nuget/Microsoft.ILVerification/Microsoft.ILVerification.pkgproj +++ b/src/coreclr/.nuget/Microsoft.ILVerification/Microsoft.ILVerification.pkgproj @@ -15,7 +15,7 @@ lib\netstandard2.0\ILVerification.dll - 1.8.1 + $(SystemReflectionMetadataVersion) netstandard2.0 Build,Analyzers diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 2440f6ca999cad..38e5488938b6d7 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -247,7 +247,6 @@ add_subdirectory(debug) add_subdirectory(binder) add_subdirectory(classlibnative) add_subdirectory(dlls) -add_subdirectory(ToolBox) add_subdirectory(tools) add_subdirectory(unwinder) add_subdirectory(interop) diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj index f62c8b95b7c143..e1230d59401d86 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -78,6 +78,10 @@ AnyCPU $(DefineConstants);TARGET_ARM64 + + AnyCPU + $(DefineConstants);TARGET_LOONGARCH64 + diff --git a/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs index c86aa1b2e62bfe..a619dc4b1ca795 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs @@ -16,14 +16,6 @@ namespace System { public static partial class Math { - [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Abs(double value); - - [Intrinsic] - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Abs(float value); - [Intrinsic] [MethodImpl(MethodImplOptions.InternalCall)] public static extern double Acos(double d); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs index 44884c129e2374..fe5da8367cdd43 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -46,7 +46,7 @@ internal static string UnmangleTypeName(string typeName) while (true) { i = typeName.LastIndexOf('+', i); - if (i == -1) + if (i < 0) { break; } @@ -626,7 +626,7 @@ internal Type[] GetTypesNoLock() { // Are there any possible special characters left? int i = className.AsSpan(startIndex).IndexOfAny('[', '*', '&'); - if (i == -1) + if (i < 0) { // No, type name is simple. baseName = className; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs index 36fe011d10d4f5..6d9b8121fa6b42 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs @@ -527,7 +527,7 @@ internal TypeBuilder( } int iLast = fullname.LastIndexOf('.'); - if (iLast == -1 || iLast == 0) + if (iLast <= 0) { // no name space m_strNameSpace = string.Empty; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs index dd9c22987203a8..cba7d80fa15b09 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs @@ -523,7 +523,7 @@ public override string Name int i = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar); - if (i == -1) + if (i < 0) return s; return s.Substring(i + 1); diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index 240a78ecfdde75..977d73e5c3b990 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -15,7 +15,7 @@ namespace System { [NonVersionable] - public unsafe partial struct RuntimeTypeHandle : ISerializable + public unsafe partial struct RuntimeTypeHandle : IEquatable, ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. internal RuntimeTypeHandle GetNativeHandle() @@ -814,7 +814,7 @@ RuntimeMethodHandleInternal Value } [NonVersionable] - public unsafe partial struct RuntimeMethodHandle : ISerializable + public unsafe partial struct RuntimeMethodHandle : IEquatable, ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. internal static IRuntimeMethodInfo EnsureNonNullMethodInfo(IRuntimeMethodInfo method) @@ -1139,7 +1139,7 @@ internal sealed class RuntimeFieldInfoStub : IRuntimeFieldInfo } [NonVersionable] - public unsafe struct RuntimeFieldHandle : ISerializable + public unsafe struct RuntimeFieldHandle : IEquatable, ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. internal RuntimeFieldHandle GetNativeHandle() diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index 2c7bb900641aaf..a0d7026b544078 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -1992,8 +1992,8 @@ private static void SplitName(string? fullname, out string? name, out string? ns return; // Get namespace - int nsDelimiter = fullname.LastIndexOf(".", StringComparison.Ordinal); - if (nsDelimiter != -1) + int nsDelimiter = fullname.LastIndexOf('.'); + if (nsDelimiter >= 0) { ns = fullname.Substring(0, nsDelimiter); int nameLength = fullname.Length - ns.Length - 1; diff --git a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs index 406e1dc8c533da..d51fca9673e39c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs @@ -184,7 +184,7 @@ internal static unsafe void ConvertFixedToNative(int flags, string strManaged, I internal static unsafe string ConvertFixedToManaged(IntPtr cstr, int length) { int end = SpanHelpers.IndexOf(ref *(byte*)cstr, 0, length); - if (end != -1) + if (end >= 0) { length = end; } @@ -512,7 +512,7 @@ internal static unsafe void ConvertToNative(string? strManaged, IntPtr nativeHom internal static unsafe string ConvertToManaged(IntPtr nativeHome, int length) { int end = SpanHelpers.IndexOf(ref *(char*)nativeHome, '\0', length); - if (end != -1) + if (end >= 0) { length = end; } diff --git a/src/coreclr/ToolBox/CMakeLists.txt b/src/coreclr/ToolBox/CMakeLists.txt deleted file mode 100644 index 4e7f4368681d1d..00000000000000 --- a/src/coreclr/ToolBox/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(SOS) -add_subdirectory(superpmi) diff --git a/src/coreclr/binder/assemblybindercommon.cpp b/src/coreclr/binder/assemblybindercommon.cpp index 830c673ea06a63..7b48a0a90ce831 100644 --- a/src/coreclr/binder/assemblybindercommon.cpp +++ b/src/coreclr/binder/assemblybindercommon.cpp @@ -972,7 +972,7 @@ namespace BINDER_SPACE { // Search Assembly.ni.dll, then Assembly.dll // The Assembly.ni.dll paths are rare, and intended for supporting managed C++ R2R assemblies. - SString candidates[] = { W(".ni.dll"), W(".dll") }; + const WCHAR* const candidates[] = { W(".ni.dll"), W(".dll") }; // Loop through the binding paths looking for a matching assembly for (int i = 0; i < 2; i++) diff --git a/src/coreclr/binder/bindertracing.cpp b/src/coreclr/binder/bindertracing.cpp index 499e20d928887f..e349b99b3c14e0 100644 --- a/src/coreclr/binder/bindertracing.cpp +++ b/src/coreclr/binder/bindertracing.cpp @@ -176,8 +176,8 @@ namespace BinderTracing { static thread_local bool t_AssemblyLoadStartInProgress = false; - AssemblyBindOperation::AssemblyBindOperation(AssemblySpec *assemblySpec, const WCHAR *assemblyPath) - : m_bindRequest { assemblySpec, nullptr, assemblyPath } + AssemblyBindOperation::AssemblyBindOperation(AssemblySpec *assemblySpec, const SString& assemblyPath) + : m_bindRequest { assemblySpec, SString::Empty(), assemblyPath } , m_populatedBindRequest { false } , m_checkedIgnoreBind { false } , m_ignoreBind { false } diff --git a/src/coreclr/binder/inc/bindertracing.h b/src/coreclr/binder/inc/bindertracing.h index 75d8270b8eee51..ca28c045196388 100644 --- a/src/coreclr/binder/inc/bindertracing.h +++ b/src/coreclr/binder/inc/bindertracing.h @@ -27,7 +27,7 @@ namespace BinderTracing { public: // This class assumes the assembly spec will have a longer lifetime than itself - AssemblyBindOperation(AssemblySpec *assemblySpec, const WCHAR *assemblyPath = nullptr); + AssemblyBindOperation(AssemblySpec *assemblySpec, const SString& assemblyPath = SString::Empty()); ~AssemblyBindOperation(); void SetResult(PEAssembly *assembly, bool cached = false); diff --git a/src/coreclr/binder/textualidentityparser.cpp b/src/coreclr/binder/textualidentityparser.cpp index 5d85a0a71cf377..f69e0bf66b202b 100644 --- a/src/coreclr/binder/textualidentityparser.cpp +++ b/src/coreclr/binder/textualidentityparser.cpp @@ -77,7 +77,7 @@ namespace BINDER_SPACE } } - inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, __out_ecount(2*cSrc) LPWSTR pDst) + inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, _Out_writes_(2*cSrc) LPWSTR pDst) { UINT x; UINT y; diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index ed9d735a7d4285..30cd7d2785267a 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -345,6 +345,9 @@ for /f "delims=" %%a in ("-%__RequestedBuildComponents%-") do ( if not "!string:-nativeaot-=!"=="!string!" ( set __CMakeTarget=!__CMakeTarget! nativeaot ) + if not "!string:-spmi-=!"=="!string!" ( + set __CMakeTarget=!__CMakeTarget! spmi + ) ) if [!__CMakeTarget!] == [] ( set __CMakeTarget=install @@ -745,7 +748,7 @@ echo -all: Builds all configurations and platforms. echo Build architecture: one of -x64, -x86, -arm, -arm64 ^(default: -x64^). echo Build type: one of -Debug, -Checked, -Release ^(default: -Debug^). echo -component ^ : specify this option one or more times to limit components built to those specified. -echo Allowed ^: hosts jit alljits runtime paltests iltools +echo Allowed ^: hosts jit alljits runtime paltests iltools nativeaot spmi echo -enforcepgo: verify after the build that PGO was used for key DLLs, and fail the build if not echo -pgoinstrument: generate instrumented code for profile guided optimization enabled binaries. echo -cmakeargs: user-settable additional arguments passed to CMake. diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index 09529929492821..a1e03198ac6dff 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -22,7 +22,7 @@ usage_list+=("-pgodatapath: path to profile guided optimization data.") usage_list+=("-pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.") usage_list+=("-skipcrossarchnative: Skip building cross-architecture native binaries.") usage_list+=("-staticanalyzer: use scan_build static analyzer.") -usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', 'iltools', and 'nativeaot'. Can be specified multiple times.") +usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', 'iltools', 'nativeaot', and 'spmi'. Can be specified multiple times.") setup_dirs_local() { @@ -50,6 +50,8 @@ build_cross_architecture_components() __SkipCrossArchBuild=0 elif [[ "$__BuildArch" == "arm64" && "$__CrossArch" == "x64" ]]; then __SkipCrossArchBuild=0 + elif [[ "$__BuildArch" == "loongarch64" && "$__CrossArch" == "x64" ]]; then + __SkipCrossArchBuild=0 else # not supported return diff --git a/src/coreclr/classlibnative/bcltype/arraynative.cpp b/src/coreclr/classlibnative/bcltype/arraynative.cpp index 738fd98c7f9e76..ca60fa978a626c 100644 --- a/src/coreclr/classlibnative/bcltype/arraynative.cpp +++ b/src/coreclr/classlibnative/bcltype/arraynative.cpp @@ -1154,23 +1154,25 @@ FCIMPL2_IV(void, ArrayNative::InitializeArray, ArrayBase* pArrayRef, FCALLRuntim } FCIMPLEND -FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count) +FCIMPL3_VVI(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count) { FCALL_CONTRACT; struct { REFLECTFIELDREF refField; + REFLECTCLASSBASEREF refClass; } gc; gc.refField = (REFLECTFIELDREF)ObjectToOBJECTREF(FCALL_RFH_TO_REFLECTFIELD(structField)); + gc.refClass = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(FCALL_RTH_TO_REFLECTCLASS(targetTypeUnsafe)); void* data; - HELPER_METHOD_FRAME_BEGIN_RET_1(gc); + HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); FieldDesc* pField = (FieldDesc*)gc.refField->GetField(); if (!pField->IsRVA()) COMPlusThrow(kArgumentException); - TypeHandle targetTypeHandle = FCALL_RTH_TO_REFLECTCLASS(targetType)->GetType(); + TypeHandle targetTypeHandle = gc.refClass->GetType(); if (!CorTypeInfo::IsPrimitiveType(targetTypeHandle.GetSignatureCorElementType()) && !targetTypeHandle.IsEnum()) COMPlusThrow(kArgumentException); @@ -1180,8 +1182,9 @@ FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField // Report the RVA field to the logger. g_IBCLogger.LogRVADataAccess(pField); - _ASSERTE(data != NULL && count != NULL); data = pField->GetStaticAddressHandle(NULL); + _ASSERTE(data != NULL); + _ASSERTE(count != NULL); if (AlignUp((UINT_PTR)data, targetTypeSize) != (UINT_PTR)data) COMPlusThrow(kArgumentException); diff --git a/src/coreclr/classlibnative/bcltype/arraynative.h b/src/coreclr/classlibnative/bcltype/arraynative.h index 6a1c8979525cdb..bd74be3d3ea6ac 100644 --- a/src/coreclr/classlibnative/bcltype/arraynative.h +++ b/src/coreclr/classlibnative/bcltype/arraynative.h @@ -48,7 +48,7 @@ class ArrayNative // This method will acquire data to create a span from a TypeHandle // to a field. - static FCDECL3(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count); + static FCDECL3_VVI(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count); private: // Helper for CreateInstance diff --git a/src/coreclr/classlibnative/float/floatdouble.cpp b/src/coreclr/classlibnative/float/floatdouble.cpp index 67aceb60ea13e6..d20b772eb2207c 100644 --- a/src/coreclr/classlibnative/float/floatdouble.cpp +++ b/src/coreclr/classlibnative/float/floatdouble.cpp @@ -42,15 +42,6 @@ #pragma float_control(precise, off) #endif -/*=====================================Abs====================================== -** -==============================================================================*/ -FCIMPL1_V(double, COMDouble::Abs, double x) - FCALL_CONTRACT; - - return fabs(x); -FCIMPLEND - /*=====================================Acos===================================== ** ==============================================================================*/ diff --git a/src/coreclr/classlibnative/float/floatsingle.cpp b/src/coreclr/classlibnative/float/floatsingle.cpp index 965998fbaa2ba3..1694fd78cb8467 100644 --- a/src/coreclr/classlibnative/float/floatsingle.cpp +++ b/src/coreclr/classlibnative/float/floatsingle.cpp @@ -8,18 +8,6 @@ #include "floatsingle.h" -// Windows x86 and Windows ARM/ARM64 may not define _isnanf() or _copysignf() but they do -// define _isnan() and _copysign(). We will redirect the macros to these other functions if -// the macro is not defined for the platform. This has the side effect of a possible implicit -// upcasting for arguments passed in and an explicit downcasting for the _copysign() call. -#if (defined(TARGET_X86) || defined(TARGET_ARM) || defined(TARGET_ARM64)) && !defined(TARGET_UNIX) - -#if !defined(_copysignf) -#define _copysignf (float)_copysign -#endif - -#endif - // The default compilation mode is /fp:precise, which disables floating-point intrinsics. This // default compilation mode has previously caused performance regressions in floating-point code. // We enable /fp:fast semantics for the majority of the math functions, as it will speed up performance @@ -40,15 +28,6 @@ #pragma float_control(precise, off) #endif -/*=====================================Abs===================================== -** -==============================================================================*/ -FCIMPL1_V(float, COMSingle::Abs, float x) - FCALL_CONTRACT; - - return fabsf(x); -FCIMPLEND - /*=====================================Acos===================================== ** ==============================================================================*/ diff --git a/src/coreclr/classlibnative/inc/floatdouble.h b/src/coreclr/classlibnative/inc/floatdouble.h index 9163349127ca14..43fecbd47431f3 100644 --- a/src/coreclr/classlibnative/inc/floatdouble.h +++ b/src/coreclr/classlibnative/inc/floatdouble.h @@ -9,7 +9,6 @@ class COMDouble { public: - FCDECL1_V(static double, Abs, double x); FCDECL1_V(static double, Acos, double x); FCDECL1_V(static double, Acosh, double x); FCDECL1_V(static double, Asin, double x); diff --git a/src/coreclr/classlibnative/inc/floatsingle.h b/src/coreclr/classlibnative/inc/floatsingle.h index 09a0512b230dbd..765032ce6371e4 100644 --- a/src/coreclr/classlibnative/inc/floatsingle.h +++ b/src/coreclr/classlibnative/inc/floatsingle.h @@ -9,7 +9,6 @@ class COMSingle { public: - FCDECL1_V(static float, Abs, float x); FCDECL1_V(static float, Acos, float x); FCDECL1_V(static float, Acosh, float x); FCDECL1_V(static float, Asin, float x); diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 50aab221c8032e..d5fc9f5e1ee8e5 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -191,12 +191,12 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64) add_definitions(-DUNIX_AMD64_ABI_ITF) endif (CLR_CMAKE_TARGET_ARCH_AMD64) add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS) -if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP) -endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) -if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES) -endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) if(NOT CLR_CMAKE_TARGET_UNIX) add_definitions(-DFEATURE_WIN32_REGISTRY) @@ -240,6 +240,7 @@ function(set_target_definitions_to_custom_os_and_arch) elseif (TARGETDETAILS_ARCH STREQUAL "x86") target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_X86_ABI) elseif (TARGETDETAILS_ARCH STREQUAL "arm64") + elseif (TARGETDETAILS_ARCH STREQUAL "loongarch64") endif() if ((TARGETDETAILS_ARCH STREQUAL "arm64") AND (TARGETDETAILS_OS STREQUAL "unix_osx")) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE OSX_ARM64_ABI) @@ -260,6 +261,10 @@ function(set_target_definitions_to_custom_os_and_arch) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM64) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif(TARGETDETAILS_ARCH STREQUAL "loongarch64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_LOONGARCH64) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) elseif((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel")) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM) endif() diff --git a/src/coreclr/components.cmake b/src/coreclr/components.cmake index c23a38539247e9..3eaa2c966bf32e 100644 --- a/src/coreclr/components.cmake +++ b/src/coreclr/components.cmake @@ -6,6 +6,7 @@ add_component(runtime) add_component(paltests paltests_install) add_component(iltools) add_component(nativeaot) +add_component(spmi) # Define coreclr_all as the fallback component and make every component depend on this component. # iltools and paltests should be minimal subsets, so don't add a dependency on coreclr_misc diff --git a/src/coreclr/debug/createdump/crashinfomac.cpp b/src/coreclr/debug/createdump/crashinfomac.cpp index ad9c247e37dfdc..3ada3bd767c964 100644 --- a/src/coreclr/debug/createdump/crashinfomac.cpp +++ b/src/coreclr/debug/createdump/crashinfomac.cpp @@ -277,6 +277,9 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm uint64_t start = segment.vmaddr + module.LoadBias(); uint64_t end = start + segment.vmsize; + // Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip. + AddModuleAddressRange(start, end, module.BaseAddress()); + // Round to page boundary start = start & PAGE_MASK; _ASSERTE(start > 0); @@ -297,9 +300,6 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm } // Add this module segment to the module mappings list m_moduleMappings.insert(moduleRegion); - - // Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip. - AddModuleAddressRange(start, end, module.BaseAddress()); } else { diff --git a/src/coreclr/debug/createdump/stackframe.h b/src/coreclr/debug/createdump/stackframe.h index 75e20d93120c0c..00c3a1cfb7fd8f 100644 --- a/src/coreclr/debug/createdump/stackframe.h +++ b/src/coreclr/debug/createdump/stackframe.h @@ -66,9 +66,16 @@ struct StackFrame } } +// See comment in threadinfo.cpp UnwindNativeFrames function +#if defined(__aarch64__) + #define STACK_POINTER_MASK ~0x7 +#else + #define STACK_POINTER_MASK ~0x0 +#endif + inline uint64_t ModuleAddress() const { return m_moduleAddress; } inline uint64_t InstructionPointer() const { return m_instructionPointer; } - inline uint64_t StackPointer() const { return m_stackPointer; } + inline uint64_t StackPointer() const { return m_stackPointer & STACK_POINTER_MASK; } inline uint32_t NativeOffset() const { return m_nativeOffset; } inline uint32_t Token() const { return m_token; } inline uint32_t ILOffset() const { return m_ilOffset; } diff --git a/src/coreclr/debug/createdump/threadinfo.cpp b/src/coreclr/debug/createdump/threadinfo.cpp index 82509f52750653..e64eafc8d29a96 100644 --- a/src/coreclr/debug/createdump/threadinfo.cpp +++ b/src/coreclr/debug/createdump/threadinfo.cpp @@ -53,6 +53,16 @@ ThreadInfo::UnwindNativeFrames(CONTEXT* pContext) uint64_t ip = 0, sp = 0; GetFrameLocation(pContext, &ip, &sp); +#if defined(__aarch64__) + // ARM64 can have frames with the same SP but different IPs. Increment sp so it gets added to the stack + // frames in the correct order and to prevent the below loop termination on non-increasing sp. Since stack + // pointers are always 8 byte align, this increase is masked off in StackFrame::StackPointer() to get the + // original stack pointer. + if (sp == previousSp && ip != previousIp) + { + sp++; + } +#endif if (ip == 0 || sp <= previousSp) { TRACE_VERBOSE("Unwind: sp not increasing or ip == 0 sp %p ip %p\n", (void*)sp, (void*)ip); break; diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index f9ec95c1f41838..9aaf6e6e4cb171 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -92,10 +92,10 @@ BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved) } HRESULT -ConvertUtf8(__in LPCUTF8 utf8, +ConvertUtf8(_In_ LPCUTF8 utf8, ULONG32 bufLen, ULONG32* nameLen, - __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer) + _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer) { if (nameLen) { @@ -118,9 +118,9 @@ ConvertUtf8(__in LPCUTF8 utf8, } HRESULT -AllocUtf8(__in_opt LPCWSTR wstr, +AllocUtf8(_In_opt_ LPCWSTR wstr, ULONG32 srcChars, - __deref_out LPUTF8* utf8) + _Outptr_ LPUTF8* utf8) { ULONG32 chars = WszWideCharToMultiByte(CP_UTF8, 0, wstr, srcChars, NULL, 0, NULL, NULL); @@ -165,7 +165,7 @@ HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport, mdTypeDef classToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer) + _Inout_updates_(bufferChars) LPUTF8 buffer) { HRESULT hr; LPCUTF8 baseName, namespaceName; @@ -179,7 +179,7 @@ HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, mdMethodDef methodToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer) + _Inout_updates_(bufferChars) LPUTF8 buffer) { HRESULT status; HRESULT hr; @@ -228,13 +228,13 @@ GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, } HRESULT -SplitFullName(__in_z __in PCWSTR fullName, +SplitFullName(_In_z_ PCWSTR fullName, SplitSyntax syntax, ULONG32 memberDots, - __deref_out_opt LPUTF8* namespaceName, - __deref_out_opt LPUTF8* typeName, - __deref_out_opt LPUTF8* memberName, - __deref_out_opt LPUTF8* params) + _Outptr_opt_ LPUTF8* namespaceName, + _Outptr_opt_ LPUTF8* typeName, + _Outptr_opt_ LPUTF8* memberName, + _Outptr_opt_ LPUTF8* params) { HRESULT status; PCWSTR paramsStart, memberStart, memberEnd, typeStart; @@ -401,7 +401,7 @@ SplitFullName(__in_z __in PCWSTR fullName, } int -CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags) +CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags) { if (nameFlags & CLRDATA_BYNAME_CASE_INSENSITIVE) { @@ -469,8 +469,8 @@ MetaEnum::End(void) HRESULT MetaEnum::NextToken(mdToken* token, - __deref_opt_out_opt LPCUTF8* namespaceName, - __deref_opt_out_opt LPCUTF8* name) + _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName, + _Outptr_opt_result_maybenull_ LPCUTF8* name) { HRESULT hr; if (!m_mdImport) @@ -584,8 +584,8 @@ MetaEnum::NextDomainToken(AppDomain** appDomain, } HRESULT -MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, +MetaEnum::NextTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, mdToken* token) { @@ -617,8 +617,8 @@ MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName, } HRESULT -MetaEnum::NextDomainTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, +MetaEnum::NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, AppDomain** appDomain, mdToken* token) { @@ -755,7 +755,7 @@ SplitName::Clear(void) } HRESULT -SplitName::SplitString(__in_opt PCWSTR fullName) +SplitName::SplitString(_In_opt_ PCWSTR fullName) { if (m_syntax == SPLIT_NO_NAME) { @@ -800,7 +800,7 @@ WCHAR* wcrscan(LPCWSTR beg, LPCWSTR end, WCHAR ch) // sepName to point to the second '+' character in the string. When sepName // points to the first '+' character this function will return "Outer" in // pResult and sepName will point one WCHAR before fullName. -HRESULT NextEnclosingClasName(LPCWSTR fullName, __deref_inout LPWSTR& sepName, __deref_out LPUTF8 *pResult) +HRESULT NextEnclosingClasName(LPCWSTR fullName, _Outref_ LPWSTR& sepName, _Outptr_ LPUTF8 *pResult) { if (sepName < fullName) { @@ -994,7 +994,7 @@ SplitName::FindField(IMDInternalImport* mdInternal) } HRESULT -SplitName::AllocAndSplitString(__in_opt PCWSTR fullName, +SplitName::AllocAndSplitString(_In_opt_ PCWSTR fullName, SplitSyntax syntax, ULONG32 nameFlags, ULONG32 memberDots, @@ -1024,7 +1024,7 @@ SplitName::AllocAndSplitString(__in_opt PCWSTR fullName, } HRESULT -SplitName::CdStartMethod(__in_opt PCWSTR fullName, +SplitName::CdStartMethod(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, mdTypeDef typeToken, @@ -1138,7 +1138,7 @@ SplitName::CdNextDomainMethod(CLRDATA_ENUM* handle, } HRESULT -SplitName::CdStartField(__in_opt PCWSTR fullName, +SplitName::CdStartField(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, ULONG32 fieldFlags, IXCLRDataTypeInstance* fromTypeInst, @@ -1241,7 +1241,7 @@ SplitName::CdNextField(ClrDataAccess* dac, IXCLRDataValue** value, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet) { @@ -1419,7 +1419,7 @@ SplitName::CdNextDomainField(ClrDataAccess* dac, } HRESULT -SplitName::CdStartType(__in_opt PCWSTR fullName, +SplitName::CdStartType(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, AppDomain* appDomain, @@ -3698,7 +3698,7 @@ ClrDataAccess::GetRuntimeNameByAddress( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement) { HRESULT status; @@ -4317,7 +4317,7 @@ ClrDataAccess::GetDataByAddress( /* [in] */ IXCLRDataTask* tlsTask, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataValue **value, /* [out] */ CLRDATA_ADDRESS *displacement) { @@ -5642,7 +5642,7 @@ ClrDataAccess::GetFullMethodName( IN MethodDesc* methodDesc, IN ULONG32 symbolChars, OUT ULONG32* symbolLen, - __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol + _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol ) { StackSString s; @@ -5690,7 +5690,7 @@ ClrDataAccess::GetJitHelperName( #define JITHELPER(code,fn,sig) #code, #include }; - static_assert_no_msg(COUNTOF(s_rgHelperNames) == CORINFO_HELP_COUNT); + static_assert_no_msg(ARRAY_SIZE(s_rgHelperNames) == CORINFO_HELP_COUNT); #ifdef TARGET_UNIX if (!dynamicHelpersOnly) @@ -5737,7 +5737,7 @@ ClrDataAccess::RawGetMethodName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement) { #ifdef TARGET_ARM @@ -5745,7 +5745,7 @@ ClrDataAccess::RawGetMethodName( address &= ~THUMB_CODE; #endif - const UINT k_cch64BitHexFormat = COUNTOF("1234567812345678"); + const UINT k_cch64BitHexFormat = ARRAY_SIZE("1234567812345678"); HRESULT status; if (flags != 0) @@ -5887,7 +5887,7 @@ ClrDataAccess::RawGetMethodName( // Printf failed. Estimate a size that will be at least big enough to hold the name if (symbolLen) { - size_t cchSymbol = COUNTOF(s_wszFormatNameWithStubManager) + + size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameWithStubManager) + wcslen(wszStubManagerName) + k_cch64BitHexFormat + 1; @@ -5950,7 +5950,7 @@ ClrDataAccess::RawGetMethodName( // Printf failed. Estimate a size that will be at least big enough to hold the name if (symbolLen) { - size_t cchSymbol = COUNTOF(s_wszFormatNameAddressOnly) + + size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameAddressOnly) + k_cch64BitHexFormat + 1; @@ -6460,7 +6460,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly, DWORD &dwDataSize, DWORD &dwRvaHint, bool &isNGEN, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { SUPPORTS_DAC_HOST_ONLY; @@ -6524,7 +6524,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly, bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, DWORD &dwTimeStamp, DWORD &dwSize, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { SUPPORTS_DAC_HOST_ONLY; @@ -6548,7 +6548,7 @@ bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, // In the end we add given ilExtension. // This dependecy is based on Apollo installer behavior. bool ClrDataAccess::GetILImageNameFromNgenImage( LPCWSTR ilExtension, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { if (wszFilePath == NULL || cchFilePath == 0) @@ -7565,9 +7565,9 @@ typedef struct _WER_RUNTIME_EXCEPTION_INFORMATION // else detailed error code. // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __out GenericModeBlock * pGMB) +STDAPI OutOfProcessExceptionEventGetWatsonBucket(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _Out_ GenericModeBlock * pGMB) { HANDLE hProcess = pExceptionInformation->hProcess; HANDLE hThread = pExceptionInformation->hThread; @@ -7656,12 +7656,12 @@ STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext, // Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224). // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __out BOOL * pbOwnershipClaimed, - __out_ecount(*pchSize) PWSTR pwszEventName, +STDAPI OutOfProcessExceptionEventCallback(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _Out_ BOOL * pbOwnershipClaimed, + _Out_writes_(*pchSize) PWSTR pwszEventName, __inout PDWORD pchSize, - __out PDWORD pdwSignatureCount) + _Out_ PDWORD pdwSignatureCount) { SUPPORTS_DAC_HOST_ONLY; @@ -7748,12 +7748,12 @@ STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext, // Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224). // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __in DWORD dwIndex, - __out_ecount(*pchName) PWSTR pwszName, +STDAPI OutOfProcessExceptionEventSignatureCallback(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _In_ DWORD dwIndex, + _Out_writes_(*pchName) PWSTR pwszName, __inout PDWORD pchName, - __out_ecount(*pchValue) PWSTR pwszValue, + _Out_writes_(*pchValue) PWSTR pwszValue, __inout PDWORD pchValue) { SUPPORTS_DAC_HOST_ONLY; @@ -7873,12 +7873,12 @@ STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext, // this function are of the pwszName and pwszValue buffers. // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __out BOOL * pbCustomDebuggerNeeded, - __out_ecount_opt(*pchSize) PWSTR pwszDebuggerLaunch, +STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _Out_ BOOL * pbCustomDebuggerNeeded, + _Out_writes_opt_(*pchSize) PWSTR pwszDebuggerLaunch, __inout PDWORD pchSize, - __out BOOL * pbAutoLaunchDebugger) + _Out_ BOOL * pbAutoLaunchDebugger) { SUPPORTS_DAC_HOST_ONLY; diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index ebb5d12c0ce3aa..4efcd8a8323b4f 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -5428,6 +5428,16 @@ GENERICS_TYPE_TOKEN DacDbiInterfaceImpl::ResolveExactGenericArgsToken(DWORD if (dwExactGenericArgsTokenIndex == 0) { + // In a rare case of VS4Mac debugging VS4Mac ARM64 optimized code we get a null generics argument token. We aren't sure + // why the token is null, it may be a bug or it may be by design in the runtime. In the interest of time we are working + // around the issue rather than investigating the root cause. This workaround should only cause us to degrade generic + // types from exact type parameters to approximate or canonical type parameters. In the future if we discover this issue + // is happening more frequently than we expect or the workaround is more impactful than we expect we may need to remove + // this workaround and resolve the underlying issue. + if (rawToken == 0) + { + return rawToken; + } // In this case the real generics type token is the MethodTable of the "this" object. // Note that we want the target address here. diff --git a/src/coreclr/debug/daccess/dacfn.cpp b/src/coreclr/debug/daccess/dacfn.cpp index e1b83aba17e20c..11f798ed04c199 100644 --- a/src/coreclr/debug/daccess/dacfn.cpp +++ b/src/coreclr/debug/daccess/dacfn.cpp @@ -89,7 +89,7 @@ DacExceptionFilter(Exception* ex, ClrDataAccess* access, } void __cdecl -DacWarning(__in char* format, ...) +DacWarning(_In_ char* format, ...) { char text[256]; va_list args; diff --git a/src/coreclr/debug/daccess/dacimpl.h b/src/coreclr/debug/daccess/dacimpl.h index 948bef16e498da..57a4dc1bbab8fc 100644 --- a/src/coreclr/debug/daccess/dacimpl.h +++ b/src/coreclr/debug/daccess/dacimpl.h @@ -222,22 +222,22 @@ struct METH_EXTENTS CLRDATA_ADDRESS_RANGE extents[1]; }; -HRESULT ConvertUtf8(__in LPCUTF8 utf8, +HRESULT ConvertUtf8(_In_ LPCUTF8 utf8, ULONG32 bufLen, ULONG32* nameLen, - __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer); -HRESULT AllocUtf8(__in_opt LPCWSTR wstr, + _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer); +HRESULT AllocUtf8(_In_opt_ LPCWSTR wstr, ULONG32 srcChars, - __deref_out LPUTF8* utf8); + _Outptr_ LPUTF8* utf8); HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport, mdTypeDef classToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer); + _Inout_updates_(bufferChars) LPUTF8 buffer); HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, mdMethodDef methodToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer); + _Inout_updates_(bufferChars) LPUTF8 buffer); enum SplitSyntax { @@ -247,15 +247,15 @@ enum SplitSyntax SPLIT_NO_NAME, }; -HRESULT SplitFullName(__in_z __in PCWSTR fullName, +HRESULT SplitFullName(_In_z_ PCWSTR fullName, SplitSyntax syntax, ULONG32 memberDots, - __deref_out_opt LPUTF8* namespaceName, - __deref_out_opt LPUTF8* typeName, - __deref_out_opt LPUTF8* memberName, - __deref_out_opt LPUTF8* params); + _Outptr_opt_ LPUTF8* namespaceName, + _Outptr_opt_ LPUTF8* typeName, + _Outptr_opt_ LPUTF8* memberName, + _Outptr_opt_ LPUTF8* params); -int CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags); +int CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags); #define INH_STATIC \ (CLRDATA_VALUE_ALL_KINDS | \ @@ -304,16 +304,16 @@ class MetaEnum void End(void); HRESULT NextToken(mdToken* token, - __deref_opt_out_opt LPCUTF8* namespaceName, - __deref_opt_out_opt LPCUTF8* name); + _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName, + _Outptr_opt_result_maybenull_ LPCUTF8* name); HRESULT NextDomainToken(AppDomain** appDomain, mdToken* token); - HRESULT NextTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, + HRESULT NextTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, mdToken* token); - HRESULT NextDomainTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, + HRESULT NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, AppDomain** appDomain, mdToken* token); @@ -410,7 +410,7 @@ class SplitName void Delete(void); void Clear(void); - HRESULT SplitString(__in_opt PCWSTR fullName); + HRESULT SplitString(_In_opt_ PCWSTR fullName); bool FindType(IMDInternalImport* mdInternal); bool FindMethod(IMDInternalImport* mdInternal); @@ -421,13 +421,13 @@ class SplitName return CompareUtf8(str1, str2, m_nameFlags); } - static HRESULT AllocAndSplitString(__in_opt PCWSTR fullName, + static HRESULT AllocAndSplitString(_In_opt_ PCWSTR fullName, SplitSyntax syntax, ULONG32 nameFlags, ULONG32 memberDots, SplitName** split); - static HRESULT CdStartMethod(__in_opt PCWSTR fullName, + static HRESULT CdStartMethod(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, mdTypeDef typeToken, @@ -441,7 +441,7 @@ class SplitName AppDomain** appDomain, mdMethodDef* token); - static HRESULT CdStartField(__in_opt PCWSTR fullName, + static HRESULT CdStartField(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, ULONG32 fieldFlags, IXCLRDataTypeInstance* fromTypeInst, @@ -462,14 +462,14 @@ class SplitName IXCLRDataValue** value, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet); static HRESULT CdNextDomainField(ClrDataAccess* dac, CLRDATA_ENUM* handle, IXCLRDataValue** value); - static HRESULT CdStartType(__in_opt PCWSTR fullName, + static HRESULT CdStartType(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, AppDomain* appDomain, @@ -901,7 +901,7 @@ class ClrDataAccess /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement); virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains( @@ -972,7 +972,7 @@ class ClrDataAccess /* [in] */ IXCLRDataTask* tlsTask, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataValue **value, /* [out] */ CLRDATA_ADDRESS *displacement); @@ -1080,10 +1080,10 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE GetAppDomainStoreData(struct DacpAppDomainStoreData *data); virtual HRESULT STDMETHODCALLTYPE GetAppDomainList(unsigned int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetAppDomainData(CLRDATA_ADDRESS addr, struct DacpAppDomainData *data); - virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], int *fetched); virtual HRESULT STDMETHODCALLTYPE GetAssemblyData(CLRDATA_ADDRESS baseDomainPtr, CLRDATA_ADDRESS assembly, struct DacpAssemblyData *data); - virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetThreadData(CLRDATA_ADDRESS thread, struct DacpThreadData *data); virtual HRESULT STDMETHODCALLTYPE GetThreadFromThinlockID(UINT thinLockId, CLRDATA_ADDRESS *pThread); virtual HRESULT STDMETHODCALLTYPE GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp); @@ -1091,27 +1091,27 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE GetMethodDescData(CLRDATA_ADDRESS methodDesc, CLRDATA_ADDRESS ip, struct DacpMethodDescData *data, ULONG cRevertedRejitVersions, DacpReJitData * rgRevertedRejitData, ULONG * pcNeededRevertedRejitData); virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD); - virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromFrame(CLRDATA_ADDRESS frameAddr, CLRDATA_ADDRESS * ppMD); virtual HRESULT STDMETHODCALLTYPE GetCodeHeaderData(CLRDATA_ADDRESS ip, struct DacpCodeHeaderData *data); virtual HRESULT STDMETHODCALLTYPE GetThreadpoolData(struct DacpThreadpoolData *data); virtual HRESULT STDMETHODCALLTYPE GetWorkRequestData(CLRDATA_ADDRESS addrWorkRequest, struct DacpWorkRequestData *data); virtual HRESULT STDMETHODCALLTYPE GetObjectData(CLRDATA_ADDRESS objAddr, struct DacpObjectData *data); - virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData *data); virtual HRESULT STDMETHODCALLTYPE GetMethodTableFieldData(CLRDATA_ADDRESS mt, struct DacpMethodTableFieldData *data); virtual HRESULT STDMETHODCALLTYPE GetMethodTableTransparencyData(CLRDATA_ADDRESS mt, struct DacpMethodTableTransparencyData *data); virtual HRESULT STDMETHODCALLTYPE GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS *value); virtual HRESULT STDMETHODCALLTYPE GetFieldDescData(CLRDATA_ADDRESS fieldDesc, struct DacpFieldDescData *data); - virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetModule(CLRDATA_ADDRESS addr, IXCLRDataModule **mod); virtual HRESULT STDMETHODCALLTYPE GetModuleData(CLRDATA_ADDRESS moduleAddr, struct DacpModuleData *data); virtual HRESULT STDMETHODCALLTYPE TraverseModuleMap(ModuleMapType mmt, CLRDATA_ADDRESS moduleAddr, MODULEMAPTRAVERSE pCallback, LPVOID token); virtual HRESULT STDMETHODCALLTYPE GetMethodDescFromToken(CLRDATA_ADDRESS moduleAddr, mdToken token, CLRDATA_ADDRESS *methodDesc); virtual HRESULT STDMETHODCALLTYPE GetPEFileBase(CLRDATA_ADDRESS addr, CLRDATA_ADDRESS *base); - virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetAssemblyModuleList(CLRDATA_ADDRESS assembly, unsigned int count, CLRDATA_ADDRESS modules[], unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetGCHeapData(struct DacpGcHeapData *data); virtual HRESULT STDMETHODCALLTYPE GetGCHeapList(unsigned int count, CLRDATA_ADDRESS heaps[], unsigned int *pNeeded); @@ -1127,7 +1127,7 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE TraverseEHInfo(CLRDATA_ADDRESS ip, DUMPEHINFO pCallback, LPVOID token); virtual HRESULT STDMETHODCALLTYPE GetStressLogAddress(CLRDATA_ADDRESS *stressLog); virtual HRESULT STDMETHODCALLTYPE GetJitManagerList(unsigned int count, struct DacpJitManagerInfo managers[], unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetJumpThunkTarget(T_CONTEXT *ctx, CLRDATA_ADDRESS *targetIP, CLRDATA_ADDRESS *targetMD); virtual HRESULT STDMETHODCALLTYPE TraverseLoaderHeap(CLRDATA_ADDRESS loaderHeapAddr, VISITHEAP pCallback); virtual HRESULT STDMETHODCALLTYPE GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, struct DacpJitCodeHeapInfo codeHeaps[], unsigned int *pNeeded); @@ -1152,17 +1152,17 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE GetDacModuleHandle(HMODULE *phModule); virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pContext, HRESULT *pResult); - virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetStackReferences(DWORD osThreadID, ISOSStackRefEnum **ppEnum); - virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetHandleEnum(ISOSHandleEnum **ppHandleEnum); virtual HRESULT STDMETHODCALLTYPE GetHandleEnumForTypes(unsigned int types[], unsigned int count, ISOSHandleEnum **ppHandleEnum); @@ -1244,12 +1244,12 @@ class ClrDataAccess HRESULT GetFullMethodName(IN MethodDesc* methodDesc, IN ULONG32 symbolChars, IN ULONG32* symbolLen, - __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol); + _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol); HRESULT RawGetMethodName(/* [in] */ CLRDATA_ADDRESS address, /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement); HRESULT FollowStubStep( @@ -1512,17 +1512,17 @@ class ClrDataAccess DWORD &dwDataSize, DWORD &dwRvaHint, bool &isNGEN, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, DWORD cchFilePath); static bool GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, DWORD &dwTimeStamp, DWORD &dwSize, - __out_ecount(cchPath) LPWSTR wszPath, + _Out_writes_(cchPath) LPWSTR wszPath, const DWORD cchPath); #if defined(FEATURE_CORESYSTEM) static bool GetILImageNameFromNgenImage(LPCWSTR ilExtension, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath); #endif // FEATURE_CORESYSTEM }; @@ -2348,7 +2348,7 @@ class ClrDataAppDomain : public IXCLRDataAppDomain virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetUniqueID( /* [out] */ ULONG64 *id); @@ -2429,17 +2429,17 @@ class ClrDataAssembly : public IXCLRDataAssembly virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetDisplayName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFlags( /* [out] */ ULONG32 *flags); @@ -2601,12 +2601,12 @@ class ClrDataModule : public IXCLRDataModule, IXCLRDataModule2 virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetVersionId( /* [out] */ GUID* vid); @@ -2747,7 +2747,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ mdFieldDef *token); @@ -2756,7 +2756,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ IXCLRDataModule** tokenScope, @@ -2791,7 +2791,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32* flags); @@ -2800,7 +2800,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32* flags); @@ -2808,7 +2808,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( /* [out] */ mdTypeDef *token, @@ -2918,7 +2918,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token); virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFieldsByName( @@ -2952,7 +2952,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **value, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token); @@ -2985,7 +2985,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByToken2( /* [in] */ IXCLRDataModule* tokenScope, @@ -2994,13 +2994,13 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetModule( /* [out] */ IXCLRDataModule **mod); @@ -3095,7 +3095,7 @@ class ClrDataMethodDefinition : public IXCLRDataMethodDefinition /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( /* [out] */ mdMethodDef *token, @@ -3200,7 +3200,7 @@ class ClrDataMethodInstance : public IXCLRDataMethodInstance /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFlags( /* [out] */ ULONG32 *flags); @@ -3304,7 +3304,7 @@ class ClrDataTask : public IXCLRDataTask virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetUniqueID( /* [out] */ ULONG64 *id); @@ -3500,7 +3500,7 @@ class ClrDataFrame : public IXCLRDataFrame, /* [out] */ IXCLRDataValue **arg, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetNumLocalVariables( /* [out] */ ULONG32 *numLocals); @@ -3510,7 +3510,7 @@ class ClrDataFrame : public IXCLRDataFrame, /* [out] */ IXCLRDataValue **localVariable, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments( /* [out] */ ULONG32 *numTypeArgs); @@ -3523,7 +3523,7 @@ class ClrDataFrame : public IXCLRDataFrame, /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetMethodInstance( /* [out] */ IXCLRDataMethodInstance **method); @@ -3620,7 +3620,7 @@ class ClrDataExceptionState : public IXCLRDataExceptionState virtual HRESULT STDMETHODCALLTYPE GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]); virtual HRESULT STDMETHODCALLTYPE IsSameState( /* [in] */ EXCEPTION_RECORD64 *exRecord, @@ -3724,7 +3724,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token); virtual HRESULT STDMETHODCALLTYPE GetNumFields2( @@ -3742,7 +3742,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token); virtual HRESULT STDMETHODCALLTYPE EnumField2( @@ -3750,7 +3750,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token); @@ -3783,7 +3783,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetFieldByToken2( /* [in] */ IXCLRDataModule* tokenScope, @@ -3791,7 +3791,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetAssociatedValue( /* [out] */ IXCLRDataValue **assocValue); @@ -3802,7 +3802,7 @@ class ClrDataValue : public IXCLRDataValue virtual HRESULT STDMETHODCALLTYPE GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]); virtual HRESULT STDMETHODCALLTYPE GetArrayProperties( /* [out] */ ULONG32 *rank, @@ -3844,7 +3844,7 @@ class ClrDataValue : public IXCLRDataValue IXCLRDataValue** pubValue, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet); @@ -3854,7 +3854,7 @@ class ClrDataValue : public IXCLRDataValue IXCLRDataValue** pubValue, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet) { diff --git a/src/coreclr/debug/daccess/inspect.cpp b/src/coreclr/debug/daccess/inspect.cpp index 21afb220103cb6..0a3138c5b77dbd 100644 --- a/src/coreclr/debug/daccess/inspect.cpp +++ b/src/coreclr/debug/daccess/inspect.cpp @@ -574,7 +574,7 @@ ClrDataValue::GetFieldByIndex( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token) { // XXX Microsoft - Obsolete method, never implemented. @@ -661,7 +661,7 @@ ClrDataValue::EnumField( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token) { return EnumField2(handle, field, nameBufLen, nameLen, nameBuf, @@ -674,7 +674,7 @@ ClrDataValue::EnumField2( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token) { @@ -839,7 +839,7 @@ ClrDataValue::GetFieldByToken( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { return GetFieldByToken2(NULL, token, field, bufLen, nameLen, nameBuf); } @@ -851,7 +851,7 @@ ClrDataValue::GetFieldByToken2( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status; @@ -1029,7 +1029,7 @@ HRESULT STDMETHODCALLTYPE ClrDataValue::GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]) { HRESULT status; @@ -1381,7 +1381,7 @@ ClrDataValue::NewFromFieldDesc(ClrDataAccess* dac, IXCLRDataValue** pubValue, ULONG32 nameBufRetLen, ULONG32 *nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef *tokenRet) { @@ -1991,7 +1991,7 @@ ClrDataTypeDefinition::EnumField( /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ mdFieldDef *token) @@ -2005,7 +2005,7 @@ ClrDataTypeDefinition::EnumField2( /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ IXCLRDataModule** tokenScope, @@ -2180,7 +2180,7 @@ ClrDataTypeDefinition::GetFieldByToken( /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags) { @@ -2194,7 +2194,7 @@ ClrDataTypeDefinition::GetFieldByToken2( /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags) { @@ -2276,7 +2276,7 @@ ClrDataTypeDefinition::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status = S_OK; @@ -3014,7 +3014,7 @@ ClrDataTypeInstance::GetStaticFieldByIndex( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token) { HRESULT status; @@ -3186,7 +3186,7 @@ ClrDataTypeInstance::EnumStaticField2( /* [out] */ IXCLRDataValue **value, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token) { @@ -3351,7 +3351,7 @@ ClrDataTypeInstance::GetStaticFieldByToken( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { return GetStaticFieldByToken2(NULL, token, tlsTask, field, bufLen, nameLen, nameBuf); @@ -3365,7 +3365,7 @@ ClrDataTypeInstance::GetStaticFieldByToken2( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status; @@ -3430,7 +3430,7 @@ ClrDataTypeInstance::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status = S_OK; diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp index fe66a8b30b4212..1e327721f4a92d 100644 --- a/src/coreclr/debug/daccess/request.cpp +++ b/src/coreclr/debug/daccess/request.cpp @@ -580,7 +580,7 @@ ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, } HRESULT -ClrDataAccess::GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded) +ClrDataAccess::GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded) { if (!buffer && !pNeeded) return E_POINTER; @@ -1322,7 +1322,7 @@ ClrDataAccess::GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD } HRESULT -ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { if (methodDesc == 0) return E_INVALIDARG; @@ -1426,7 +1426,7 @@ ClrDataAccess::GetDomainFromContext(CLRDATA_ADDRESS contextAddr, CLRDATA_ADDRESS HRESULT -ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded) +ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded) { if (obj == 0) return E_INVALIDARG; @@ -1478,7 +1478,7 @@ ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __ou } HRESULT -ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded) +ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded) { if (obj == 0) return E_INVALIDARG; @@ -1740,7 +1740,7 @@ ClrDataAccess::GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData } HRESULT -ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded) +ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded) { if (mt == 0) return E_INVALIDARG; @@ -2003,7 +2003,7 @@ ClrDataAccess::GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS } HRESULT -ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded) +ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded) { if (vtable == 0) return E_INVALIDARG; @@ -2043,7 +2043,7 @@ ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z } HRESULT -ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded) +ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded) { if (addr == 0 || (fileName == NULL && pNeeded == NULL) || (fileName != NULL && count == 0)) return E_INVALIDARG; @@ -2369,7 +2369,7 @@ ClrDataAccess::GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pCo HRESULT ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, - __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded) { if (assembly == NULL || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0)) return E_INVALIDARG; @@ -2399,7 +2399,7 @@ ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int } HRESULT -ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { if (assembly == NULL || (name == NULL && pNeeded == NULL) || (name != NULL && count == 0)) return E_INVALIDARG; @@ -2509,7 +2509,7 @@ ClrDataAccess::GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, } HRESULT -ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { SOSDacEnter(); @@ -2550,7 +2550,7 @@ ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_ HRESULT ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, - __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded) { // Method is not supported on CoreCLR @@ -2559,7 +2559,7 @@ ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, HRESULT ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, - __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded) { // Method is not supported on CoreCLR @@ -2568,7 +2568,7 @@ ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, HRESULT ClrDataAccess::GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, - __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded) { // Method is not supported on CoreCLR @@ -2620,7 +2620,7 @@ ClrDataAccess::GetAssemblyData(CLRDATA_ADDRESS cdBaseDomainPtr, CLRDATA_ADDRESS } HRESULT -ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { SOSDacEnter(); Assembly* pAssembly = PTR_Assembly(TO_TADDR(assembly)); @@ -2661,7 +2661,7 @@ ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __o } HRESULT -ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded) +ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded) { if ((assembly == NULL) || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0)) { @@ -3636,7 +3636,7 @@ ClrDataAccess::GetSyncBlockCleanupData(CLRDATA_ADDRESS syncBlock, struct DacpSyn } HRESULT -ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded) +ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded) { SOSDacEnter(); diff --git a/src/coreclr/debug/daccess/stack.cpp b/src/coreclr/debug/daccess/stack.cpp index 6ced6d60b35391..dfcb16c31523f3 100644 --- a/src/coreclr/debug/daccess/stack.cpp +++ b/src/coreclr/debug/daccess/stack.cpp @@ -787,7 +787,7 @@ ClrDataFrame::GetArgumentByIndex( /* [out] */ IXCLRDataValue **arg, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -942,7 +942,7 @@ ClrDataFrame::GetLocalVariableByIndex( /* [out] */ IXCLRDataValue **localVariable, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -1111,7 +1111,7 @@ ClrDataFrame::GetCodeName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ]) + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ]) { HRESULT status = E_FAIL; diff --git a/src/coreclr/debug/daccess/task.cpp b/src/coreclr/debug/daccess/task.cpp index 42c4e0becce1c1..30abc5e090cc9e 100644 --- a/src/coreclr/debug/daccess/task.cpp +++ b/src/coreclr/debug/daccess/task.cpp @@ -149,7 +149,7 @@ HRESULT STDMETHODCALLTYPE ClrDataTask::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -713,7 +713,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAppDomain::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status = S_OK; @@ -1132,7 +1132,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAssembly::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -1160,7 +1160,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAssembly::GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -1201,7 +1201,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAssembly::GetDisplayName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -2376,7 +2376,7 @@ HRESULT STDMETHODCALLTYPE ClrDataModule::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -2404,7 +2404,7 @@ HRESULT STDMETHODCALLTYPE ClrDataModule::GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -3115,7 +3115,7 @@ ClrDataMethodDefinition::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -3858,7 +3858,7 @@ ClrDataMethodInstance::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -4735,7 +4735,7 @@ HRESULT STDMETHODCALLTYPE ClrDataExceptionState::GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]) { HRESULT status = E_FAIL; diff --git a/src/coreclr/debug/dbgutil/machoreader.cpp b/src/coreclr/debug/dbgutil/machoreader.cpp index d2801547cb9ba9..7fef34e1afb16d 100644 --- a/src/coreclr/debug/dbgutil/machoreader.cpp +++ b/src/coreclr/debug/dbgutil/machoreader.cpp @@ -229,9 +229,8 @@ MachOModule::ReadLoadCommands() m_segments.push_back(segment); // Calculate the load bias for the module. This is the value to add to the vmaddr of a - // segment to get the actual address. For shared modules, this is 0 since those segments - // are absolute address. - if (segment->fileoff == 0 && segment->filesize > 0) + // segment to get the actual address. + if (strcmp(segment->segname, SEG_TEXT) == 0) { m_loadBias = m_baseAddress - segment->vmaddr; } diff --git a/src/coreclr/debug/di/cordb.cpp b/src/coreclr/debug/di/cordb.cpp index 2c11397fcd3bc7..e195f3731a9e6f 100644 --- a/src/coreclr/debug/di/cordb.cpp +++ b/src/coreclr/debug/di/cordb.cpp @@ -443,10 +443,10 @@ STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pConfigurationFile, DWORD startupFlags, DWORD runtimeInfoFlags, - __out_ecount_opt(dwDirectory) LPWSTR pDirectory, + _Out_writes_bytes_opt_(dwDirectory) LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength, - __out_ecount_opt(cchBuffer) LPWSTR pVersion, + _Out_writes_bytes_opt_(cchBuffer) LPWSTR pVersion, DWORD cchBuffer, DWORD* dwlength) { diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp index 2e70a306180c59..b8c9e745260db2 100644 --- a/src/coreclr/debug/di/divalue.cpp +++ b/src/coreclr/debug/di/divalue.cpp @@ -2320,7 +2320,7 @@ HRESULT CordbObjectValue::GetLength(ULONG32 *pcchString) // Return Value: S_OK or CORDBG_E_INVALID_OBJECT, CORDBG_E_OBJECT_NEUTERED, or E_INVALIDARG on failure HRESULT CordbObjectValue::GetString(ULONG32 cchString, ULONG32 *pcchString, - __out_ecount_opt(cchString) WCHAR szString[]) + _Out_writes_bytes_opt_(cchString) WCHAR szString[]) { PUBLIC_REENTRANT_API_ENTRY(this); FAIL_IF_NEUTERED(this); diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp index 9951d4a6af305f..6d6a7a55befa2e 100644 --- a/src/coreclr/debug/di/module.cpp +++ b/src/coreclr/debug/di/module.cpp @@ -1256,7 +1256,7 @@ HRESULT CordbModule::GetAssembly(ICorDebugAssembly **ppAssembly) // Public implementation of ICorDebugModule::GetName, // wrapper around code:GetNameWorker (which throws). -HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) @@ -1324,7 +1324,7 @@ HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_pa // Note: // Filename isn't necessarily the same as the module name in the metadata. // -HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { CONTRACTL { diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index 9b21fa47e67285..59af4cc8d9c649 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -1111,7 +1111,7 @@ HRESULT ShimProcess::CreateProcess( Cordb * pCordb, ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR szProgramName, - __in_z LPWSTR szProgramArgs, + _In_z_ LPWSTR szProgramArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL fInheritHandles, @@ -8624,7 +8624,7 @@ HRESULT CordbProcess::EnableLogMessages(BOOL fOnOff) /* * ModifyLogSwitch modifies the specified switch's severity level. */ -COM_METHOD CordbProcess::ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel) +COM_METHOD CordbProcess::ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel) { PUBLIC_API_ENTRY(this); FAIL_IF_NEUTERED(this); @@ -13674,7 +13674,7 @@ void CordbWin32EventThread::ForceDbgContinue(CordbProcess *pProcess, CordbUnmana HRESULT CordbWin32EventThread::SendCreateProcessEvent( MachineInfo machineInfo, LPCWSTR programName, - __in_z LPWSTR programArgs, + _In_z_ LPWSTR programArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, diff --git a/src/coreclr/debug/di/publish.cpp b/src/coreclr/debug/di/publish.cpp index 23003b980ad9f1..1d7741fb9ea75b 100644 --- a/src/coreclr/debug/di/publish.cpp +++ b/src/coreclr/debug/di/publish.cpp @@ -658,7 +658,7 @@ HRESULT AllocateAndReadRemoteString( HANDLE hProcess, void * pRemotePtr, SIZE_T cbSize, // size of buffer to allocate + copy. - __deref_out_bcount(cbSize) WCHAR * * ppNewLocalBuffer + _Outptr_result_bytebuffer_(cbSize) WCHAR * * ppNewLocalBuffer ) { // Make sure buffer has right geometry. @@ -902,7 +902,7 @@ HRESULT CorpubProcess::GetProcessID(unsigned *pid) */ HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true); VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *); @@ -928,7 +928,7 @@ HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName, // CorpubAppDomain // ****************************************** -CorpubAppDomain::CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id) +CorpubAppDomain::CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id) : CordbCommonBase (0, enumCorpubAppDomain), m_pNext (NULL), m_szAppDomainName (szAppDomainName), @@ -976,7 +976,7 @@ HRESULT CorpubAppDomain::GetID (ULONG32 *pId) */ HRESULT CorpubAppDomain::GetName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true); VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *); diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp index 6b4da4ee206027..081baa95216d5b 100644 --- a/src/coreclr/debug/di/rsappdomain.cpp +++ b/src/coreclr/debug/di/rsappdomain.cpp @@ -700,7 +700,7 @@ HRESULT CordbAppDomain::Attach() */ HRESULT CordbAppDomain::GetName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) diff --git a/src/coreclr/debug/di/rsassembly.cpp b/src/coreclr/debug/di/rsassembly.cpp index b7b7d6756391d7..73c864f6e2159a 100644 --- a/src/coreclr/debug/di/rsassembly.cpp +++ b/src/coreclr/debug/di/rsassembly.cpp @@ -202,7 +202,7 @@ HRESULT CordbAssembly::EnumerateModules(ICorDebugModuleEnum **ppModules) */ HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { PUBLIC_API_ENTRY(this); FAIL_IF_NEUTERED(this); @@ -232,7 +232,7 @@ HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName, // HRESULT CordbAssembly::GetName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { PUBLIC_API_ENTRY(this); FAIL_IF_NEUTERED(this); diff --git a/src/coreclr/debug/di/rsmain.cpp b/src/coreclr/debug/di/rsmain.cpp index ff49f2186a40ca..5594b299e2d125 100644 --- a/src/coreclr/debug/di/rsmain.cpp +++ b/src/coreclr/debug/di/rsmain.cpp @@ -595,7 +595,7 @@ namespace COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, - __in_z WCHAR* pConnectionName); + _In_z_ WCHAR* pConnectionName); COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId); COM_METHOD DestroyConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId); @@ -725,7 +725,7 @@ namespace HRESULT DefaultManagedCallback2::CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, - __in_z WCHAR* pConnectionName) + _In_z_ WCHAR* pConnectionName) { _ASSERTE(!"DefaultManagedCallback2::CreateConnection not implemented"); return E_NOTIMPL; @@ -1572,7 +1572,7 @@ bool Cordb::IsInteropDebuggingSupported() // //--------------------------------------------------------------------------------------- HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -1601,7 +1601,7 @@ HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName, HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -1735,7 +1735,7 @@ HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget, HRESULT Cordb::CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, diff --git a/src/coreclr/debug/di/rsmda.cpp b/src/coreclr/debug/di/rsmda.cpp index 517e6dcfdeb015..822e9824a1d417 100644 --- a/src/coreclr/debug/di/rsmda.cpp +++ b/src/coreclr/debug/di/rsmda.cpp @@ -102,7 +102,7 @@ HRESULT CordbMDA::QueryInterface(REFIID riid, void **ppInterface) // // Returns: S_OK on success. //----------------------------------------------------------------------------- -HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { _ASSERTE(pInputString != NULL); ULONG32 len = (ULONG32) wcslen(pInputString) + 1; @@ -144,7 +144,7 @@ HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, // the type from that based off the schema. // See CopyOutString for parameter details. //----------------------------------------------------------------------------- -HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) @@ -159,7 +159,7 @@ HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part // Get a string description of the MDA. This may be empty (0-length). // See CopyOutString for parameter details. //----------------------------------------------------------------------------- -HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) @@ -176,7 +176,7 @@ HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecou // See the MDA documentation for the schema for this XML stream. // See CopyOutString for parameter details. //----------------------------------------------------------------------------- -HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index a34dd0e6a07288..690917c2795a91 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -2211,7 +2211,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote COM_METHOD SetManagedHandler(ICorDebugManagedCallback *pCallback); COM_METHOD SetUnmanagedHandler(ICorDebugUnmanagedCallback *pCallback); COM_METHOD CreateProcess(LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -2243,7 +2243,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote COM_METHOD CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -2267,7 +2267,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote HRESULT CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -2463,7 +2463,7 @@ class CordbAppDomain : public CordbBase, // Returns the friendly name of the AppDomain COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); /* * GetObject returns the runtime app domain object. @@ -2646,12 +2646,12 @@ class CordbAssembly : public CordbBase, public ICorDebugAssembly, ICorDebugAssem */ COM_METHOD GetCodeBase(ULONG32 cchName, ULONG32 * pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // returns the filename of the assembly, or "" for in-memory assemblies COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); //----------------------------------------------------------- @@ -3079,7 +3079,7 @@ class CordbProcess : /* * ModifyLogSwitch modifies the specified switch's severity level. */ - COM_METHOD ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel); + COM_METHOD ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel); COM_METHOD EnumerateAppDomains(ICorDebugAppDomainEnum **ppAppDomains); COM_METHOD GetObject(ICorDebugValue **ppObject); @@ -4180,7 +4180,7 @@ class CordbModule : public CordbBase, COM_METHOD GetProcess(ICorDebugProcess **ppProcess); COM_METHOD GetBaseAddress(CORDB_ADDRESS *pAddress); COM_METHOD GetAssembly(ICorDebugAssembly **ppAssembly); - COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); COM_METHOD EnableJITDebugging(BOOL bTrackJITInfo, BOOL bAllowJitOpts); COM_METHOD EnableClassLoadCallbacks(BOOL bClassLoadCallbacks); @@ -4252,7 +4252,7 @@ class CordbModule : public CordbBase, #endif // _DEBUG // Internal help to get the "name" (filename or pretty name) of the module. - HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // Marks that the module's metadata has become invalid and needs to be refetched. void RefreshMetaData(); @@ -4484,15 +4484,15 @@ class CordbMDA : public CordbBase, public ICorDebugMDA // Get the string for the type of the MDA. Never empty. // This is a convenient performant alternative to getting the XML stream and extracting // the type from that based off the schema. - COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // Get a string description of the MDA. This may be empty (0-length). - COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // Get the full associated XML for the MDA. This may be empty. // This could be a potentially expensive operation if the xml stream is large. // See the MDA documentation for the schema for this XML stream. - COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); COM_METHOD GetFlags(CorDebugMDAFlags * pFlags); @@ -9292,7 +9292,7 @@ class CordbObjectValue : public CordbValue, COM_METHOD GetLength(ULONG32 * pcchString); COM_METHOD GetString(ULONG32 cchString, ULONG32 * ppcchStrin, - __out_ecount_opt(cchString) WCHAR szString[]); + _Out_writes_bytes_opt_(cchString) WCHAR szString[]); //----------------------------------------------------------- // ICorDebugExceptionObjectValue @@ -10120,7 +10120,7 @@ class CordbWin32EventThread HRESULT SendCreateProcessEvent(MachineInfo machineInfo, LPCWSTR programName, - __in_z LPWSTR programArgs, + _In_z_ LPWSTR programArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -10811,7 +10811,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess */ COM_METHOD GetDisplayName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); CorpubProcess *GetNextProcess () { return m_pNext;} void SetNext (CorpubProcess *pNext) { m_pNext = pNext;} @@ -10838,7 +10838,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain { public: - CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id); + CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id); virtual ~CorpubAppDomain(); #ifdef _DEBUG @@ -10873,7 +10873,7 @@ class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain */ COM_METHOD GetName (ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); CorpubAppDomain *GetNextAppDomain () { return m_pNext;} void SetNext (CorpubAppDomain *pNext) { m_pNext = pNext;} @@ -11142,7 +11142,7 @@ class CordbEnumFilter : public CordbBase, void CheckAgainstDAC(CordbFunction * pFunc, void * pIP, mdMethodDef mdExpected); #endif -HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); +HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); diff --git a/src/coreclr/debug/di/shimcallback.cpp b/src/coreclr/debug/di/shimcallback.cpp index ba5f0771fca49a..4e8f029209def7 100644 --- a/src/coreclr/debug/di/shimcallback.cpp +++ b/src/coreclr/debug/di/shimcallback.cpp @@ -659,7 +659,7 @@ HRESULT ShimProxyCallback::DebuggerError(ICorDebugProcess * pProcess, HRESULT er // Implementation of ICorDebugManagedCallback::LogMessage -HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, __in LPWSTR pLogSwitchName, __in LPWSTR pMessage) +HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pMessage) { m_pShim->PreDispatchEvent(); class LogMessageEvent : public ManagedEvent @@ -695,7 +695,7 @@ HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebug // Implementation of ICorDebugManagedCallback::LogSwitch -HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, __in LPWSTR pLogSwitchName, __in LPWSTR pParentName) +HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pParentName) { m_pShim->PreDispatchEvent(); class LogSwitchEvent : public ManagedEvent @@ -1060,7 +1060,7 @@ HRESULT ShimProxyCallback::FunctionRemapOpportunity(ICorDebugAppDomain * pAppDom // Implementation of ICorDebugManagedCallback2::CreateConnection -HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, __in LPWSTR pConnectionName) +HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnectionName) { m_pShim->PreDispatchEvent(); class CreateConnectionEvent : public ManagedEvent diff --git a/src/coreclr/debug/di/shimpriv.h b/src/coreclr/debug/di/shimpriv.h index 89a0c0d0c79374..26a939ee8a3a8e 100644 --- a/src/coreclr/debug/di/shimpriv.h +++ b/src/coreclr/debug/di/shimpriv.h @@ -128,15 +128,15 @@ class ShimProxyCallback : COM_METHOD LogMessage( ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, LONG lLevel, - __in LPWSTR pLogSwitchName, - __in LPWSTR pMessage); + _In_ LPWSTR pLogSwitchName, + _In_ LPWSTR pMessage); COM_METHOD LogSwitch( ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, LONG lLevel, ULONG ulReason, - __in LPWSTR pLogSwitchName, - __in LPWSTR pParentName); + _In_ LPWSTR pLogSwitchName, + _In_ LPWSTR pParentName); COM_METHOD CreateAppDomain(ICorDebugProcess *pProcess, ICorDebugAppDomain *pAppDomain); @@ -178,7 +178,7 @@ class ShimProxyCallback : ICorDebugFunction *pNewFunction, ULONG32 oldILOffset); - COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, __in LPWSTR pConnName); + COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnName); COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId ); @@ -368,7 +368,7 @@ class ShimProcess Cordb * pCordb, ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR programName, - __in_z LPWSTR programArgs, + _In_z_ LPWSTR programArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, diff --git a/src/coreclr/debug/di/symbolinfo.cpp b/src/coreclr/debug/di/symbolinfo.cpp index 452adbe71f3a7e..37cff967d02fea 100644 --- a/src/coreclr/debug/di/symbolinfo.cpp +++ b/src/coreclr/debug/di/symbolinfo.cpp @@ -231,7 +231,7 @@ STDMETHODIMP_(ULONG) SymbolInfo::Release () STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error. mdTypeDef td, // [IN] TypeDef token for inquiry. - __out_ecount_part_opt(cchTypeDef, pchTypeDef) + _Out_writes_to_opt_(cchTypeDef, pchTypeDef) LPWSTR szTypeDef, // [OUT] Put name here. ULONG cchTypeDef, // [IN] size of name buffer in wide chars. ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here. @@ -278,7 +278,7 @@ STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error. STDMETHODIMP SymbolInfo::GetMethodProps ( mdMethodDef mb, // The method for which to get props. mdTypeDef *pClass, // Put method's class here. - __out_ecount_part_opt(cchMethod, *pchMethod) + _Out_writes_to_opt_(cchMethod, *pchMethod) LPWSTR szMethod, // Put method's name here. ULONG cchMethod, // Size of szMethod buffer in wide chars. ULONG *pchMethod, // Put actual size here @@ -419,7 +419,7 @@ STDMETHODIMP SymbolInfo::FindTypeDefByName ( // S_OK or error. } STDMETHODIMP SymbolInfo::GetScopeProps ( // S_OK or error. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put the name here. ULONG cchName, // [IN] Size of name buffer in wide chars. ULONG *pchName, // [OUT] Put size of name (wide chars) here. @@ -449,7 +449,7 @@ STDMETHODIMP SymbolInfo::GetInterfaceImplProps ( // S_OK or error. STDMETHODIMP SymbolInfo::GetTypeRefProps ( // S_OK or error. mdTypeRef tr, // [IN] TypeRef token. mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Name of the TypeRef. ULONG cchName, // [IN] Size of buffer. ULONG *pchName) // [OUT] Size of Name. @@ -629,7 +629,7 @@ STDMETHODIMP SymbolInfo::FindMemberRef ( STDMETHODIMP SymbolInfo::GetMemberRefProps ( // S_OK or error. mdMemberRef mr, // [IN] given memberref mdToken *ptk, // [OUT] Put classref or classdef here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // [OUT] buffer to fill for member's name ULONG cchMember, // [IN] the count of char of szMember ULONG *pchMember, // [OUT] actual count of char in member name @@ -752,7 +752,7 @@ STDMETHODIMP SymbolInfo::GetSigFromToken ( // S_OK or error. STDMETHODIMP SymbolInfo::GetModuleRefProps ( // S_OK or error. mdModuleRef mur, // [IN] moduleref token. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] buffer to fill with the moduleref name. ULONG cchName, // [IN] size of szName in wide characters. ULONG *pchName) // [OUT] actual count of characters in the name. @@ -800,7 +800,7 @@ STDMETHODIMP SymbolInfo::EnumUnresolvedMethods ( // S_OK, S_FALSE, or erro STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error. mdString stk, // [IN] String token. - __out_ecount_part_opt(cchString, *pchString) + _Out_writes_to_opt_(cchString, *pchString) LPWSTR szString, // [OUT] Copy of string. ULONG cchString, // [IN] Max chars of room in szString. ULONG *pchString) // [OUT] How many chars in actual string. @@ -812,7 +812,7 @@ STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error. STDMETHODIMP SymbolInfo::GetPinvokeMap ( // S_OK or error. mdToken tk, // [IN] FieldDef or MethodDef. DWORD *pdwMappingFlags, // [OUT] Flags used for mapping. - __out_ecount_part_opt(cchImportName, *pchImportName) + _Out_writes_to_opt_(cchImportName, *pchImportName) LPWSTR szImportName, // [OUT] Import name. ULONG cchImportName, // [IN] Size of the name buffer. ULONG *pchImportName, // [OUT] Actual number of characters stored. @@ -896,7 +896,7 @@ STDMETHODIMP SymbolInfo::FindTypeRef ( STDMETHODIMP SymbolInfo::GetMemberProps ( mdToken mb, // The member for which to get props. mdTypeDef *pClass, // Put member's class here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // Put member's name here. ULONG cchMember, // Size of szMember buffer in wide chars. ULONG *pchMember, // Put actual size here @@ -916,7 +916,7 @@ STDMETHODIMP SymbolInfo::GetMemberProps ( STDMETHODIMP SymbolInfo::GetFieldProps ( mdFieldDef mb, // The field for which to get props. mdTypeDef *pClass, // Put field's class here. - __out_ecount_part_opt(cchField, *pchField) + _Out_writes_to_opt_(cchField, *pchField) LPWSTR szField, // Put field's name here. ULONG cchField, // Size of szField buffer in wide chars. ULONG *pchField, // Put actual size here @@ -957,7 +957,7 @@ STDMETHODIMP SymbolInfo::GetParamProps ( // S_OK or error. mdParamDef tk, // [IN]The Parameter. mdMethodDef *pmd, // [OUT] Parent Method token. ULONG *pulSequence, // [OUT] Parameter sequence. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put name here. ULONG cchName, // [OUT] Size of name buffer. ULONG *pchName, // [OUT] Put actual size of name here. diff --git a/src/coreclr/debug/di/symbolinfo.h b/src/coreclr/debug/di/symbolinfo.h index 22deafaaf5d516..5b1291f4cfe598 100644 --- a/src/coreclr/debug/di/symbolinfo.h +++ b/src/coreclr/debug/di/symbolinfo.h @@ -104,7 +104,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport mdTypeDef *ptd); // [OUT] Put the TypeDef token here. STDMETHOD(GetScopeProps)( // S_OK or error. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put the name here. ULONG cchName, // [IN] Size of name buffer in wide chars. ULONG *pchName, // [OUT] Put size of name (wide chars) here. @@ -115,7 +115,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetTypeDefProps)( // S_OK or error. mdTypeDef td, // [IN] TypeDef token for inquiry. - __out_ecount_part_opt(cchTypeDef, *pchTypeDef) + _Out_writes_to_opt_(cchTypeDef, *pchTypeDef) LPWSTR szTypeDef, // [OUT] Put name here. ULONG cchTypeDef, // [IN] size of name buffer in wide chars. ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here. @@ -130,7 +130,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetTypeRefProps)( // S_OK or error. mdTypeRef tr, // [IN] TypeRef token. mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Name of the TypeRef. ULONG cchName, // [IN] Size of buffer. ULONG *pchName); // [OUT] Size of Name. @@ -244,7 +244,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD (GetMethodProps)( mdMethodDef mb, // The method for which to get props. mdTypeDef *pClass, // Put method's class here. - __out_ecount_part_opt(cchMethod, *pchMethod) + _Out_writes_to_opt_(cchMethod, *pchMethod) LPWSTR szMethod, // Put method's name here. ULONG cchMethod, // Size of szMethod buffer in wide chars. ULONG *pchMethod, // Put actual size here @@ -257,7 +257,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetMemberRefProps)( // S_OK or error. mdMemberRef mr, // [IN] given memberref mdToken *ptk, // [OUT] Put classref or classdef here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // [OUT] buffer to fill for member's name ULONG cchMember, // [IN] the count of char of szMember ULONG *pchMember, // [OUT] actual count of char in member name @@ -336,7 +336,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetModuleRefProps)( // S_OK or error. mdModuleRef mur, // [IN] moduleref token. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] buffer to fill with the moduleref name. ULONG cchName, // [IN] size of szName in wide characters. ULONG *pchName); // [OUT] actual count of characters in the name. @@ -364,7 +364,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetUserString)( // S_OK or error. mdString stk, // [IN] String token. - __out_ecount_part_opt(cchString, *pchString) + _Out_writes_to_opt_(cchString, *pchString) LPWSTR szString, // [OUT] Copy of string. ULONG cchString, // [IN] Max chars of room in szString. ULONG *pchString); // [OUT] How many chars in actual string. @@ -372,7 +372,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetPinvokeMap)( // S_OK or error. mdToken tk, // [IN] FieldDef or MethodDef. DWORD *pdwMappingFlags, // [OUT] Flags used for mapping. - __out_ecount_part_opt(cchImportName, *pchImportName) + _Out_writes_to_opt_(cchImportName, *pchImportName) LPWSTR szImportName, // [OUT] Import name. ULONG cchImportName, // [IN] Size of the name buffer. ULONG *pchImportName, // [OUT] Actual number of characters stored. @@ -424,7 +424,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetMemberProps)( mdToken mb, // The member for which to get props. mdTypeDef *pClass, // Put member's class here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // Put member's name here. ULONG cchMember, // Size of szMember buffer in wide chars. ULONG *pchMember, // Put actual size here @@ -440,7 +440,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetFieldProps)( mdFieldDef mb, // The field for which to get props. mdTypeDef *pClass, // Put field's class here. - __out_ecount_part_opt(cchField, *pchField) + _Out_writes_to_opt_(cchField, *pchField) LPWSTR szField, // Put field's name here. ULONG cchField, // Size of szField buffer in wide chars. ULONG *pchField, // Put actual size here @@ -473,7 +473,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport mdParamDef tk, // [IN]The Parameter. mdMethodDef *pmd, // [OUT] Parent Method token. ULONG *pulSequence, // [OUT] Parameter sequence. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put name here. ULONG cchName, // [OUT] Size of name buffer. ULONG *pchName, // [OUT] Put actual size of name here. diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp index 8e5200d37d5097..1e326e724250b6 100644 --- a/src/coreclr/debug/ee/debugger.cpp +++ b/src/coreclr/debug/ee/debugger.cpp @@ -14341,8 +14341,8 @@ void Debugger::SendRawLogMessage( // the creation/modification of a LogSwitch void Debugger::SendLogSwitchSetting(int iLevel, int iReason, - __in_z LPCWSTR pLogSwitchName, - __in_z LPCWSTR pParentSwitchName) + _In_z_ LPCWSTR pLogSwitchName, + _In_z_ LPCWSTR pParentSwitchName) { CONTRACTL { @@ -15854,7 +15854,7 @@ BOOL Debugger::IsThreadContextInvalid(Thread *pThread, CONTEXT *pCtx) // notification when a SQL connection begins -void Debugger::CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName) +void Debugger::CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName) { CONTRACTL { diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h index 3fd9edf68f5d86..084f1da6a5c93f 100644 --- a/src/coreclr/debug/ee/debugger.h +++ b/src/coreclr/debug/ee/debugger.h @@ -2201,7 +2201,7 @@ class Debugger : public DebugInterface void SendInterceptExceptionComplete(Thread *thread); HRESULT AttachDebuggerForBreakpoint(Thread *thread, - __in_opt WCHAR *wszLaunchReason); + _In_opt_ WCHAR *wszLaunchReason); void ThreadIsSafe(Thread *thread); @@ -2424,8 +2424,8 @@ class Debugger : public DebugInterface void SendLogSwitchSetting (int iLevel, int iReason, - __in_z LPCWSTR pLogSwitchName, - __in_z LPCWSTR pParentSwitchName); + _In_z_ LPCWSTR pLogSwitchName, + _In_z_ LPCWSTR pParentSwitchName); bool IsLoggingEnabled (void) { @@ -2507,7 +2507,7 @@ class Debugger : public DebugInterface BOOL IsThreadContextInvalid(Thread *pThread, T_CONTEXT *pCtx); // notification for SQL fiber debugging support - void CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName); + void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName); void DestroyConnection(CONNID dwConnectionId); void ChangeConnection(CONNID dwConnectionId); @@ -3704,7 +3704,7 @@ void DbgLogHelper(DebuggerIPCEventType event); // Helpers for cleanup // These are various utility functions, mainly where we factor out code. //----------------------------------------------------------------------------- -void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf, +void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix); diff --git a/src/coreclr/debug/ee/rcthread.cpp b/src/coreclr/debug/ee/rcthread.cpp index 18c840edbb6984..0f48eb2c95e188 100644 --- a/src/coreclr/debug/ee/rcthread.cpp +++ b/src/coreclr/debug/ee/rcthread.cpp @@ -116,7 +116,7 @@ void DebuggerRCThread::CloseIPCHandles() // cBufSizeInChars - the size of the buffer in characters, including the null. // pPrefx - The undecorated name of the event. //----------------------------------------------------------------------------- -void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf, +void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix) { diff --git a/src/coreclr/debug/inc/common.h b/src/coreclr/debug/inc/common.h index 2baec963e14f2f..cb8474c7373856 100644 --- a/src/coreclr/debug/inc/common.h +++ b/src/coreclr/debug/inc/common.h @@ -45,7 +45,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent, #endif // (FEATURE_DBGIPC_TRANSPORT_DI || FEATURE_DBGIPC_TRANSPORT_VM) -void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf, +void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid); diff --git a/src/coreclr/debug/inc/dbgipcevents.h b/src/coreclr/debug/inc/dbgipcevents.h index db4a00fca1c865..ddef09554cf80d 100644 --- a/src/coreclr/debug/inc/dbgipcevents.h +++ b/src/coreclr/debug/inc/dbgipcevents.h @@ -990,7 +990,7 @@ extern const size_t nameCount; struct MSLAYOUT IPCENames // We use a class/struct so that the function can remain in a shared header file { - static DebuggerIPCEventType GetEventType(__in_z char * strEventType) + static DebuggerIPCEventType GetEventType(_In_z_ char * strEventType) { // pass in the string of event name and find the matching enum value // This is a linear search which is pretty slow. However, this is only used diff --git a/src/coreclr/debug/shared/dbgtransportsession.cpp b/src/coreclr/debug/shared/dbgtransportsession.cpp index 85fb7901b01c1a..6d3ed5b345cf7c 100644 --- a/src/coreclr/debug/shared/dbgtransportsession.cpp +++ b/src/coreclr/debug/shared/dbgtransportsession.cpp @@ -1143,7 +1143,7 @@ DbgTransportSession::Message * DbgTransportSession::RemoveMessageFromSendQueue(D // Check read and optionally write memory access to the specified range of bytes. Used to check // ReadProcessMemory and WriteProcessMemory requests. -HRESULT DbgTransportSession::CheckBufferAccess(__in_ecount(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess) +HRESULT DbgTransportSession::CheckBufferAccess(_In_reads_(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess) { // check for integer overflow if ((pbBuffer + cbBuffer) < pbBuffer) diff --git a/src/coreclr/debug/shared/utils.cpp b/src/coreclr/debug/shared/utils.cpp index 85f17b50c44e78..be967b1d1b7fa2 100644 --- a/src/coreclr/debug/shared/utils.cpp +++ b/src/coreclr/debug/shared/utils.cpp @@ -126,7 +126,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent, // cBufSizeInChars - the size of the buffer in characters, including the null. // pPrefx - The undecorated name of the event. //----------------------------------------------------------------------------- -void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid) +void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid) { const WCHAR szGlobal[] = W("Global\\"); int szGlobalLen; diff --git a/src/coreclr/debug/shim/debugshim.cpp b/src/coreclr/debug/shim/debugshim.cpp index b86c8eb0cfcc3a..3dcfbcc2510785 100644 --- a/src/coreclr/debug/shim/debugshim.cpp +++ b/src/coreclr/debug/shim/debugshim.cpp @@ -427,11 +427,11 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget, CLR_DEBUGGING_VERSION* pVersion, DWORD* pdwDbiTimeStamp, DWORD* pdwDbiSizeOfImage, - __out_z __inout_ecount(dwDbiNameCharCount) WCHAR* pDbiName, + _Inout_updates_z_(dwDbiNameCharCount) WCHAR* pDbiName, DWORD dwDbiNameCharCount, DWORD* pdwDacTimeStamp, DWORD* pdwDacSizeOfImage, - __out_z __inout_ecount(dwDacNameCharCount) WCHAR* pDacName, + _Inout_updates_z_(dwDacNameCharCount) WCHAR* pDacName, DWORD dwDacNameCharCount) { #ifdef HOST_WINDOWS @@ -629,7 +629,7 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget, } // Formats the long name for DAC -HRESULT CLRDebuggingImpl::FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer, +HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer, DWORD cchBuffer, DWORD targetImageFileMachine, VS_FIXEDFILEINFO * pVersion) diff --git a/src/coreclr/debug/shim/debugshim.h b/src/coreclr/debug/shim/debugshim.h index 5055d5a11b47d1..93df463867feb5 100644 --- a/src/coreclr/debug/shim/debugshim.h +++ b/src/coreclr/debug/shim/debugshim.h @@ -69,14 +69,14 @@ class CLRDebuggingImpl : public ICLRDebugging CLR_DEBUGGING_VERSION * pVersion, DWORD * pdwDbiTimeStamp, DWORD * pdwDbiSizeOfImage, - __out_z __inout_ecount(dwDbiNameCharCount) WCHAR * pDbiName, + _Inout_updates_z_(dwDbiNameCharCount) WCHAR * pDbiName, DWORD dwDbiNameCharCount, DWORD * pdwDacTimeStamp, DWORD * pdwDacSizeOfImage, - __out_z __inout_ecount(dwDacNameCharCount) WCHAR * pDacName, + _Inout_updates_z_(dwDacNameCharCount) WCHAR * pDacName, DWORD dwDacNameCharCount); - HRESULT FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer, + HRESULT FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer, DWORD cchBuffer, DWORD targetImageFileMachine, VS_FIXEDFILEINFO * pVersion); diff --git a/src/coreclr/dlls/dbgshim/dbgshim.cpp b/src/coreclr/dlls/dbgshim/dbgshim.cpp index ac1e2d7fe189ac..40e4d7dea4bf26 100644 --- a/src/coreclr/dlls/dbgshim/dbgshim.cpp +++ b/src/coreclr/dlls/dbgshim/dbgshim.cpp @@ -79,12 +79,12 @@ if it exists, it will: DLLEXPORT HRESULT CreateProcessForLaunch( - __in LPWSTR lpCommandLine, - __in BOOL bSuspendProcess, - __in LPVOID lpEnvironment, - __in LPCWSTR lpCurrentDirectory, - __out PDWORD pProcessId, - __out HANDLE *pResumeHandle) + _In_ LPWSTR lpCommandLine, + _In_ BOOL bSuspendProcess, + _In_ LPVOID lpEnvironment, + _In_ LPCWSTR lpCurrentDirectory, + _Out_ PDWORD pProcessId, + _Out_ HANDLE *pResumeHandle) { PUBLIC_CONTRACT; @@ -140,7 +140,7 @@ CreateProcessForLaunch( DLLEXPORT HRESULT ResumeProcess( - __in HANDLE hResumeHandle) + _In_ HANDLE hResumeHandle) { PUBLIC_CONTRACT; if (ResumeThread(hResumeHandle) == (DWORD)-1) @@ -159,7 +159,7 @@ ResumeProcess( DLLEXPORT HRESULT CloseResumeHandle( - __in HANDLE hResumeHandle) + _In_ HANDLE hResumeHandle) { PUBLIC_CONTRACT; if (!CloseHandle(hResumeHandle)) @@ -190,7 +190,7 @@ HRESULT GetContinueStartupEvent( DWORD debuggeePID, LPCWSTR szTelestoFullPath, - __out HANDLE *phContinueStartupEvent); + _Out_ HANDLE *phContinueStartupEvent); #endif // TARGET_UNIX @@ -697,10 +697,10 @@ StartupHelperThread(LPVOID p) DLLEXPORT HRESULT RegisterForRuntimeStartup( - __in DWORD dwProcessId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken) + _In_ DWORD dwProcessId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken) { return RegisterForRuntimeStartupEx(dwProcessId, NULL, pfnCallback, parameter, ppUnregisterToken); } @@ -738,11 +738,11 @@ RegisterForRuntimeStartup( DLLEXPORT HRESULT RegisterForRuntimeStartupEx( - __in DWORD dwProcessId, - __in LPCWSTR lpApplicationGroupId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken) + _In_ DWORD dwProcessId, + _In_ LPCWSTR lpApplicationGroupId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken) { PUBLIC_CONTRACT; @@ -787,7 +787,7 @@ RegisterForRuntimeStartupEx( DLLEXPORT HRESULT UnregisterForRuntimeStartup( - __in PVOID pUnregisterToken) + _In_ PVOID pUnregisterToken) { PUBLIC_CONTRACT; @@ -824,8 +824,8 @@ const int cchEventNameBufferSize = (sizeof(StartupNotifyEventNamePrefix) + sizeo DLLEXPORT HRESULT GetStartupNotificationEvent( - __in DWORD debuggeePID, - __out HANDLE* phStartupEvent) + _In_ DWORD debuggeePID, + _Out_ HANDLE* phStartupEvent) { PUBLIC_CONTRACT; @@ -1220,9 +1220,9 @@ DLLEXPORT HRESULT EnumerateCLRs( DWORD debuggeePID, - __out HANDLE** ppHandleArrayOut, - __out LPWSTR** ppStringArrayOut, - __out DWORD* pdwArrayLengthOut) + _Out_ HANDLE** ppHandleArrayOut, + _Out_ LPWSTR** ppStringArrayOut, + _Out_ DWORD* pdwArrayLengthOut) { PUBLIC_CONTRACT; @@ -1357,9 +1357,9 @@ EnumerateCLRs( DLLEXPORT HRESULT CloseCLREnumeration( - __in HANDLE* pHandleArray, - __in LPWSTR* pStringArray, - __in DWORD dwArrayLength) + _In_ HANDLE* pHandleArray, + _In_ LPWSTR* pStringArray, + _In_ DWORD dwArrayLength) { PUBLIC_CONTRACT; @@ -1484,11 +1484,11 @@ const WCHAR *c_versionStrFormat = W("%08x;%08x;%p"); DLLEXPORT HRESULT CreateVersionStringFromModule( - __in DWORD pidDebuggee, - __in LPCWSTR szModuleName, - __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer, - __in DWORD cchBuffer, - __out DWORD* pdwLength) + _In_ DWORD pidDebuggee, + _In_ LPCWSTR szModuleName, + _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer, + _In_ DWORD cchBuffer, + _Out_ DWORD* pdwLength) { PUBLIC_CONTRACT; @@ -1719,9 +1719,9 @@ CheckDbiAndRuntimeVersion( DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersionEx( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb) + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb) { return CreateDebuggingInterfaceFromVersion2(iDebuggerVersion, szDebuggeeVersion, NULL, ppCordb); } @@ -1748,10 +1748,10 @@ CreateDebuggingInterfaceFromVersionEx( DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersion2( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __in LPCWSTR szApplicationGroupId, - __out IUnknown ** ppCordb) + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _In_ LPCWSTR szApplicationGroupId, + _Out_ IUnknown ** ppCordb) { PUBLIC_CONTRACT; @@ -1880,8 +1880,8 @@ CreateDebuggingInterfaceFromVersion2( DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersion( - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb ) { PUBLIC_CONTRACT; @@ -1907,7 +1907,7 @@ HRESULT GetContinueStartupEvent( DWORD debuggeePID, LPCWSTR szTelestoFullPath, - __out HANDLE* phContinueStartupEvent) + _Out_ HANDLE* phContinueStartupEvent) { if ((phContinueStartupEvent == NULL) || (szTelestoFullPath == NULL)) return E_INVALIDARG; diff --git a/src/coreclr/dlls/dbgshim/dbgshim.h b/src/coreclr/dlls/dbgshim/dbgshim.h index 392cd7b9286a85..004fd2a38128f2 100644 --- a/src/coreclr/dlls/dbgshim/dbgshim.h +++ b/src/coreclr/dlls/dbgshim/dbgshim.h @@ -11,81 +11,81 @@ typedef VOID (*PSTARTUP_CALLBACK)(IUnknown *pCordb, PVOID parameter, HRESULT hr) EXTERN_C HRESULT CreateProcessForLaunch( - __in LPWSTR lpCommandLine, - __in BOOL bSuspendProcess, - __in LPVOID lpEnvironment, - __in LPCWSTR lpCurrentDirectory, - __out PDWORD pProcessId, - __out HANDLE *pResumeHandle); + _In_ LPWSTR lpCommandLine, + _In_ BOOL bSuspendProcess, + _In_ LPVOID lpEnvironment, + _In_ LPCWSTR lpCurrentDirectory, + _Out_ PDWORD pProcessId, + _Out_ HANDLE *pResumeHandle); EXTERN_C HRESULT ResumeProcess( - __in HANDLE hResumeHandle); + _In_ HANDLE hResumeHandle); EXTERN_C HRESULT CloseResumeHandle( - __in HANDLE hResumeHandle); + _In_ HANDLE hResumeHandle); EXTERN_C HRESULT RegisterForRuntimeStartup( - __in DWORD dwProcessId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken); + _In_ DWORD dwProcessId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken); EXTERN_C HRESULT RegisterForRuntimeStartupEx( - __in DWORD dwProcessId, - __in LPCWSTR szApplicationGroupId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken); + _In_ DWORD dwProcessId, + _In_ LPCWSTR szApplicationGroupId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken); EXTERN_C HRESULT UnregisterForRuntimeStartup( - __in PVOID pUnregisterToken); + _In_ PVOID pUnregisterToken); EXTERN_C HRESULT GetStartupNotificationEvent( - __in DWORD debuggeePID, - __out HANDLE* phStartupEvent); + _In_ DWORD debuggeePID, + _Out_ HANDLE* phStartupEvent); EXTERN_C HRESULT EnumerateCLRs(DWORD debuggeePID, - __out HANDLE** ppHandleArrayOut, - __out LPWSTR** ppStringArrayOut, - __out DWORD* pdwArrayLengthOut); + _Out_ HANDLE** ppHandleArrayOut, + _Out_ LPWSTR** ppStringArrayOut, + _Out_ DWORD* pdwArrayLengthOut); EXTERN_C HRESULT CloseCLREnumeration( - __in HANDLE* pHandleArray, - __in LPWSTR* pStringArray, - __in DWORD dwArrayLength); + _In_ HANDLE* pHandleArray, + _In_ LPWSTR* pStringArray, + _In_ DWORD dwArrayLength); EXTERN_C HRESULT CreateVersionStringFromModule( - __in DWORD pidDebuggee, - __in LPCWSTR szModuleName, - __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer, - __in DWORD cchBuffer, - __out DWORD* pdwLength); + _In_ DWORD pidDebuggee, + _In_ LPCWSTR szModuleName, + _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer, + _In_ DWORD cchBuffer, + _Out_ DWORD* pdwLength); EXTERN_C HRESULT CreateDebuggingInterfaceFromVersionEx( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb); + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb); EXTERN_C DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersion2( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __in LPCWSTR szApplicationGroupId, - __out IUnknown ** ppCordb); + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _In_ LPCWSTR szApplicationGroupId, + _Out_ IUnknown ** ppCordb); EXTERN_C HRESULT CreateDebuggingInterfaceFromVersion( - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb); + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb); diff --git a/src/coreclr/dlls/mscordac/CMakeLists.txt b/src/coreclr/dlls/mscordac/CMakeLists.txt index 8d04b34e48aad7..25c2532358774b 100644 --- a/src/coreclr/dlls/mscordac/CMakeLists.txt +++ b/src/coreclr/dlls/mscordac/CMakeLists.txt @@ -47,7 +47,7 @@ else(CLR_CMAKE_HOST_WIN32) set(REDEFINES_FILE_SCRIPT ${CMAKE_SOURCE_DIR}/generateredefinesfile.sh) - if (CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64) + if (CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64 OR CLR_CMAKE_HOST_ARCH_LOONGARCH64) set(JUMP_INSTRUCTION b) else() set(JUMP_INSTRUCTION jmp) diff --git a/src/coreclr/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/dlls/mscordac/mscordac_unixexports.src index 2a529b2f4a779d..334d1b90c93082 100644 --- a/src/coreclr/dlls/mscordac/mscordac_unixexports.src +++ b/src/coreclr/dlls/mscordac/mscordac_unixexports.src @@ -65,7 +65,6 @@ nativeStringResourceTable_mscorrc #PAL_wcsrchr #PAL_wcscmp #PAL_wcschr -#PAL_wcscspn #PAL_wcscat #PAL_wcsstr #PAL__open @@ -140,8 +139,6 @@ nativeStringResourceTable_mscorrc #LoadLibraryA #LoadLibraryW #LoadLibraryExW -#LocalAlloc -#LocalFree #MapViewOfFile #MapViewOfFileEx #MoveFileExW diff --git a/src/coreclr/dlls/mscoree/mscoree.cpp b/src/coreclr/dlls/mscoree/mscoree.cpp index 4e2d87906ad309..c985b88ab30c2e 100644 --- a/src/coreclr/dlls/mscoree/mscoree.cpp +++ b/src/coreclr/dlls/mscoree/mscoree.cpp @@ -218,7 +218,7 @@ STDAPI ReOpenMetaDataWithMemoryEx( static DWORD g_dwSystemDirectory = 0; static WCHAR * g_pSystemDirectory = NULL; -HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength) +HRESULT GetInternalSystemDirectory(_Out_writes_to_opt_(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength) { CONTRACTL { NOTHROW; @@ -252,7 +252,7 @@ HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength) } -LPCWSTR GetInternalSystemDirectory(__out DWORD* pdwLength) +LPCWSTR GetInternalSystemDirectory(_Out_ DWORD* pdwLength) { LIMITED_METHOD_CONTRACT; diff --git a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp index 6a0ba5a2499475..623f0087d400c0 100644 --- a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp +++ b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp @@ -487,7 +487,7 @@ HRESULT CeeFileGenWriter::generateImage(void **ppImage) return hr; } // HRESULT CeeFileGenWriter::generateImage() -HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName) +HRESULT CeeFileGenWriter::setOutputFileName(_In_ LPWSTR fileName) { if (m_outputFileName) delete[] m_outputFileName; @@ -498,7 +498,7 @@ HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName) return S_OK; } // HRESULT CeeFileGenWriter::setOutputFileName() -HRESULT CeeFileGenWriter::setResourceFileName(__in LPWSTR fileName) +HRESULT CeeFileGenWriter::setResourceFileName(_In_ LPWSTR fileName) { if (m_resourceFileName) delete[] m_resourceFileName; @@ -1294,7 +1294,7 @@ HRESULT CeeFileGenWriter::setVTableEntry(ULONG size, ULONG offset) return setVTableEntry64(size,(void*)(ULONG_PTR)offset); } // HRESULT CeeFileGenWriter::setVTableEntry() -HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *ptr, +HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, _In_ char *ptr, unsigned *offset) { *offset = section.computeOffset(ptr); @@ -1302,7 +1302,7 @@ HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *p return S_OK; } // HRESULT CeeFileGenWriter::computeSectionOffset() -HRESULT CeeFileGenWriter::computeOffset(__in char *ptr, +HRESULT CeeFileGenWriter::computeOffset(_In_ char *ptr, CeeSection **pSection, unsigned *offset) { TESTANDRETURNPOINTER(pSection); diff --git a/src/coreclr/dlls/mscorpe/iceefilegen.cpp b/src/coreclr/dlls/mscorpe/iceefilegen.cpp index 6714d355d0bfc3..6c40d9699fce91 100644 --- a/src/coreclr/dlls/mscorpe/iceefilegen.cpp +++ b/src/coreclr/dlls/mscorpe/iceefilegen.cpp @@ -183,7 +183,7 @@ HRESULT ICeeFileGen::AddSectionReloc (HCEESECTION section, ULONG offset, HCEESEC } } -HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFileName) +HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, _In_ LPWSTR outputFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(outputFileName); @@ -192,7 +192,7 @@ HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFile return(gen->setOutputFileName(outputFileName)); } -__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, __out LPWSTR *outputFileName) +__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, _Out_ LPWSTR *outputFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(outputFileName); @@ -204,7 +204,7 @@ __success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFi } -HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resourceFileName) +HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, _In_ LPWSTR resourceFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(resourceFileName); @@ -214,7 +214,7 @@ HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resource } __success(return == S_OK) -HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, __out LPWSTR *resourceFileName) +HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, _Out_ LPWSTR *resourceFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(resourceFileName); @@ -277,7 +277,7 @@ HRESULT ICeeFileGen::GetMethodRVA(HCEEFILE ceeFile, ULONG codeOffset, ULONG *cod return S_OK; } -HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, __in LPWSTR strValue, ULONG *strRef) +HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, _In_ LPWSTR strValue, ULONG *strRef) { TESTANDRETURNPOINTER(ceeFile); @@ -429,7 +429,7 @@ HRESULT ICeeFileGen::SetStrongNameEntry(HCEEFILE ceeFile, ULONG size, ULONG offs return gen->setStrongNameEntry(size, offset); } -HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr, +HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, _In_ char *ptr, unsigned *offset) { TESTANDRETURNPOINTER(section); @@ -443,7 +443,7 @@ HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr, __success(return == S_OK) HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset, - __out char **ptr) + _Out_ char **ptr) { TESTANDRETURNPOINTER(section); @@ -454,7 +454,7 @@ HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset, return S_OK; } -HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, __in char *ptr, +HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, _In_ char *ptr, HCEESECTION *pSection, unsigned *offset) { TESTANDRETURNPOINTER(pSection); diff --git a/src/coreclr/dlls/mscorpe/pewriter.cpp b/src/coreclr/dlls/mscorpe/pewriter.cpp index 9add4b56d13b80..b78b00c2853ffb 100644 --- a/src/coreclr/dlls/mscorpe/pewriter.cpp +++ b/src/coreclr/dlls/mscorpe/pewriter.cpp @@ -1829,7 +1829,7 @@ HRESULT PEWriter::fixup(CeeGenTokenMapper *pMapper) return(S_OK); // SUCCESS } -HRESULT PEWriter::Open(__in LPCWSTR fileName) +HRESULT PEWriter::Open(_In_ LPCWSTR fileName) { _ASSERTE(m_file == INVALID_HANDLE_VALUE); HRESULT hr = NOERROR; @@ -1913,7 +1913,7 @@ HRESULT PEWriter::Close() } /******************************************************************/ -HRESULT PEWriter::write(__in LPCWSTR fileName) { +HRESULT PEWriter::write(_In_ LPCWSTR fileName) { HRESULT hr; diff --git a/src/coreclr/dlls/mscorpe/pewriter.h b/src/coreclr/dlls/mscorpe/pewriter.h index 21817b1d5efc45..84ec61f9275eca 100644 --- a/src/coreclr/dlls/mscorpe/pewriter.h +++ b/src/coreclr/dlls/mscorpe/pewriter.h @@ -41,7 +41,7 @@ class PEWriter : public PESectionMan HRESULT link(); HRESULT fixup(CeeGenTokenMapper *pMapper); - HRESULT write(__in LPCWSTR fileName); + HRESULT write(_In_ LPCWSTR fileName); HRESULT write(void **ppImage); // calling these functions is optional @@ -174,7 +174,7 @@ class PEWriter : public PESectionMan HRESULT linkPlaceSections(entry * entries, unsigned iEntries); void setSectionIndex(IMAGE_SECTION_HEADER * h, unsigned sectionIndex); - HRESULT Open(__in LPCWSTR fileName); + HRESULT Open(_In_ LPCWSTR fileName); HRESULT Write(const void *data, int size); HRESULT Seek(int offset); HRESULT Pad(int align); @@ -257,8 +257,8 @@ class PESeedSection : public PEWriterSection { int getDirEntry() { _ASSERTE(!"PESeedSection"); return 0; } HRESULT directoryEntry(unsigned num) { _ASSERTE(!"PESeedSection"); return E_FAIL; } char * computePointer(unsigned offset) const { _ASSERTE(!"PESeedSection"); return NULL; } - BOOL containsPointer(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; } - unsigned computeOffset(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; } + BOOL containsPointer(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; } + unsigned computeOffset(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; } HRESULT cloneInstance(PESection *destination) { _ASSERTE(!"PESeedSection"); return E_FAIL; } // PEWriterSection diff --git a/src/coreclr/dlls/mscorrc/mscorrc.rc b/src/coreclr/dlls/mscorrc/mscorrc.rc index 2175566c10b610..d2c7bff988cc87 100644 --- a/src/coreclr/dlls/mscorrc/mscorrc.rc +++ b/src/coreclr/dlls/mscorrc/mscorrc.rc @@ -194,6 +194,10 @@ BEGIN IDS_EE_NDIRECT_GETPROCADDR_WIN_DLL "Unable to find an entry point named '%1' in DLL." IDS_EE_NDIRECT_GETPROCADDR_UNIX_SO "Unable to find an entry point named '%1' in shared library." IDS_EE_NDIRECT_GETPROCADDRESS_NONAME "A library name must be specified in a DllImport attribute applied to non-IJW methods." + IDS_EE_NDIRECT_DISABLEDMARSHAL_SETLASTERROR "Setting SetLastError to 'true' is not supported when runtime marshalling is disabled." + IDS_EE_NDIRECT_DISABLEDMARSHAL_LCID "The LCIDConversionAttribute is not supported when runtime marshalling is disabled." + IDS_EE_NDIRECT_DISABLEDMARSHAL_PRESERVESIG "Setting PreserveSig to false for a P/Invoke is not supported when runtime marshalling is disabled." + IDS_EE_NDIRECT_DISABLEDMARSHAL_VARARGS "Using a variable argument list in a P/Invoke is not supported when runtime marshalling is disabled." IDS_EE_CLASS_CONSTRAINTS_VIOLATION "GenericArguments[%1], '%2', on '%3' violates the constraint of type parameter '%4'." IDS_EE_METHOD_CONSTRAINTS_VIOLATION "Method %1.%2: type argument '%3' violates the constraint of type parameter '%4'." IDS_EE_NOSYNCHRONIZED "Synchronized attribute cannot be used with this method type." @@ -297,6 +301,7 @@ BEGIN IDS_EE_BADMARSHAL_GENERICS_RESTRICTION "Non-blittable generic types cannot be marshaled." IDS_EE_BADMARSHAL_AUTOLAYOUT "Structures marked with [StructLayout(LayoutKind.Auto)] cannot be marshaled." IDS_EE_BADMARSHAL_STRING_OUT "Cannot marshal a string by-value with the [Out] attribute." + IDS_EE_BADMARSHAL_MARSHAL_DISABLED "Cannot marshal managed types when the runtime marshalling system is disabled." IDS_EE_BADMARSHALPARAM_STRINGBUILDER "Invalid managed/unmanaged type combination (StringBuilders must be paired with LPStr, LPWStr, or LPTStr)." IDS_EE_BADMARSHALPARAM_NO_LPTSTR "Invalid managed/unmanaged type combination (Strings cannot be paired with LPTStr for parameters and return types of methods in interfaces exposed to COM)." @@ -580,13 +585,13 @@ BEGIN IDS_ER_FRAMEWORK_VERSION "CoreCLR Version: " IDS_ER_UNHANDLEDEXCEPTION "Description: The process was terminated due to an unhandled exception." IDS_ER_UNHANDLEDEXCEPTIONMSG "Exception Info: " - IDS_ER_MANAGEDFAILFAST "Description: The application requested process termination through System.Environment.FailFast(string message)." + IDS_ER_MANAGEDFAILFAST "Description: The application requested process termination through System.Environment.FailFast." IDS_ER_MANAGEDFAILFASTMSG "Message: " IDS_ER_UNMANAGEDFAILFAST "Description: The process was terminated due to an internal error in the .NET Runtime " IDS_ER_STACK_OVERFLOW "Description: The process was terminated due to stack overflow." IDS_ER_STACK "Stack:" IDS_ER_WORDAT "at" - IDS_ER_UNMANAGEDFAILFASTMSG "at IP %1 (%2) with exit code %3." + IDS_ER_UNMANAGEDFAILFASTMSG "at IP 0x%x (0x%x) with exit code 0x%x." IDS_ER_UNHANDLEDEXCEPTIONINFO "exception code %1, exception address %2" IDS_ER_MESSAGE_TRUNCATE "The remainder of the message was truncated." IDS_ER_CODECONTRACT_FAILED "Description: The application encountered a bug. A managed code contract (precondition, postcondition, object invariant, or assert) failed." diff --git a/src/coreclr/dlls/mscorrc/resource.h b/src/coreclr/dlls/mscorrc/resource.h index 05b31799ec5c47..7a8f148456a831 100644 --- a/src/coreclr/dlls/mscorrc/resource.h +++ b/src/coreclr/dlls/mscorrc/resource.h @@ -588,3 +588,8 @@ #define IDS_EE_BADMARSHAL_DELEGATE_TLB_INTERFACE 0x2649 #define IDS_EE_THREAD_APARTMENT_NOT_SUPPORTED 0x264A #define IDS_EE_NO_IINSPECTABLE 0x264B +#define IDS_EE_BADMARSHAL_MARSHAL_DISABLED 0x264C +#define IDS_EE_NDIRECT_DISABLEDMARSHAL_SETLASTERROR 0x264D +#define IDS_EE_NDIRECT_DISABLEDMARSHAL_LCID 0x264E +#define IDS_EE_NDIRECT_DISABLEDMARSHAL_PRESERVESIG 0x264F +#define IDS_EE_NDIRECT_DISABLEDMARSHAL_VARARGS 0x2650 diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index ace66eac266709..e270bcdc91ee47 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -2522,6 +2522,8 @@ size_t gc_heap::bgc_loh_size_increased = 0; size_t gc_heap::bgc_poh_size_increased = 0; +size_t gc_heap::background_soh_size_end_mark = 0; + size_t gc_heap::background_soh_alloc_count = 0; size_t gc_heap::background_uoh_alloc_count = 0; @@ -9402,7 +9404,7 @@ void gc_heap::remove_ro_segment (heap_segment* seg) enter_spin_lock (&gc_heap::gc_lock); - seg_table->remove ((uint8_t*)seg); + seg_table->remove (heap_segment_mem (seg)); seg_mapping_table_remove_ro_segment (seg); // Locate segment (and previous segment) in the list. @@ -10890,7 +10892,7 @@ void gc_heap::seg_clear_mark_array_bits_soh (heap_segment* seg) } } -void gc_heap::clear_batch_mark_array_bits (uint8_t* start, uint8_t* end) +void gc_heap::bgc_clear_batch_mark_array_bits (uint8_t* start, uint8_t* end) { if ((start < background_saved_highest_address) && (end > background_saved_lowest_address)) @@ -10914,8 +10916,15 @@ void gc_heap::clear_batch_mark_array_bits (uint8_t* start, uint8_t* end) if (startwrd == endwrd) { - unsigned int wrd = firstwrd | lastwrd; - mark_array[startwrd] &= wrd; + if (startbit != endbit) + { + unsigned int wrd = firstwrd | lastwrd; + mark_array[startwrd] &= wrd; + } + else + { + assert (start == end); + } return; } @@ -10938,18 +10947,6 @@ void gc_heap::clear_batch_mark_array_bits (uint8_t* start, uint8_t* end) } } } - -void gc_heap::bgc_clear_batch_mark_array_bits (uint8_t* start, uint8_t* end) -{ - if ((start < background_saved_highest_address) && - (end > background_saved_lowest_address)) - { - start = max (start, background_saved_lowest_address); - end = min (end, background_saved_highest_address); - - clear_batch_mark_array_bits (start, end); - } -} #endif //BACKGROUND_GC inline @@ -28892,6 +28889,14 @@ void gc_heap::plan_phase (int condemned_gen_number) { dprintf (2,( "**** Doing Compacting GC ****")); +#if defined(USE_REGIONS) && defined(BACKGROUND_GC) + if (should_update_end_mark_size()) + { + background_soh_size_end_mark += generation_end_seg_allocated (older_gen) - + r_older_gen_end_seg_allocated; + } +#endif //USE_REGIONS && BACKGROUND_GC + #ifndef USE_REGIONS if (should_expand) { @@ -29396,6 +29401,13 @@ void gc_heap::fix_generation_bounds (int condemned_gen_number, } } #endif //MULTIPLE_HEAPS + +#ifdef BACKGROUND_GC + if (should_update_end_mark_size()) + { + background_soh_size_end_mark = generation_size (max_generation); + } +#endif //BACKGROUND_GC #endif //!USE_REGIONS { @@ -29614,6 +29626,14 @@ void gc_heap::thread_final_regions (bool compact_p) generation_final_regions[gen_idx].tail = generation_tail_region (gen); } +#ifdef BACKGROUND_GC + heap_segment* max_gen_tail_region = 0; + if (should_update_end_mark_size()) + { + max_gen_tail_region = generation_final_regions[max_generation].tail; + } +#endif //BACKGROUND_GC + // Step 2: for each region in the condemned generations, we thread it onto its planned generation // in our generation_final_regions array. for (int gen_idx = condemned_gen_number; gen_idx >= 0; gen_idx--) @@ -29664,6 +29684,21 @@ void gc_heap::thread_final_regions (bool compact_p) } } +#ifdef BACKGROUND_GC + if (max_gen_tail_region) + { + max_gen_tail_region = heap_segment_next (max_gen_tail_region); + + while (max_gen_tail_region) + { + background_soh_size_end_mark += heap_segment_allocated (max_gen_tail_region) - + heap_segment_mem (max_gen_tail_region); + + max_gen_tail_region = heap_segment_next (max_gen_tail_region); + } + } +#endif //BACKGROUND_GC + // Step 4: if a generation doesn't have any regions, we need to get a new one for it; // otherwise we just set the head region as the start region for that generation. for (int gen_idx = 0; gen_idx <= max_generation; gen_idx++) @@ -29701,7 +29736,7 @@ void gc_heap::thread_final_regions (bool compact_p) } } - verify_regions (true); + verify_regions (true, false); } void gc_heap::thread_start_region (generation* gen, heap_segment* region) @@ -29752,7 +29787,7 @@ heap_segment* gc_heap::get_new_region (int gen_number, size_t size) heap_segment_next (generation_tail_region (gen)) = new_region; generation_tail_region (gen) = new_region; - verify_regions (gen_number, false); + verify_regions (gen_number, false, settings.concurrent); } return new_region; @@ -29779,6 +29814,12 @@ heap_segment* gc_heap::allocate_new_region (gc_heap* hp, int gen_num, bool uoh_p heap_segment* res = make_heap_segment (start, (end - start), hp, gen_num); dprintf (REGIONS_LOG, ("got a new region %Ix %Ix->%Ix", (size_t)res, start, end)); + + if (res == nullptr) + { + global_region_allocator.delete_region (start); + } + return res; } @@ -29815,7 +29856,7 @@ void gc_heap::update_start_tail_regions (generation* gen, (size_t)prev_region, heap_segment_mem (prev_region))); } - verify_regions (false); + verify_regions (false, settings.concurrent); } // There's one complication with deciding whether we can make a region SIP or not - if the plan_gen_num of @@ -30090,6 +30131,8 @@ inline void gc_heap::check_demotion_helper_sip (uint8_t** pval, int parent_gen_num, uint8_t* parent_loc) { uint8_t* child_object = *pval; + if (!is_in_heap_range (child_object)) + return; if (!child_object) return; int child_object_plan_gen = get_region_plan_gen_num (child_object); @@ -32927,6 +32970,11 @@ void gc_heap::decommit_mark_array_by_seg (heap_segment* seg) } } +bool gc_heap::should_update_end_mark_size() +{ + return ((settings.condemned_generation == (max_generation - 1)) && (current_c_gc_state == c_gc_state_planning)); +} + void gc_heap::background_mark_phase () { verify_mark_array_cleared(); @@ -33001,6 +33049,7 @@ void gc_heap::background_mark_phase () bgc_begin_poh_size = total_poh_size; bgc_loh_size_increased = 0; bgc_poh_size_increased = 0; + background_soh_size_end_mark = 0; dprintf (GTC_LOG, ("BM: h%d: loh: %Id, soh: %Id, poh: %Id", heap_number, total_loh_size, total_soh_size, total_poh_size)); @@ -33481,6 +33530,8 @@ void gc_heap::background_mark_phase () heap_segment_background_allocated (seg) = heap_segment_allocated (seg); } + background_soh_size_end_mark += heap_segment_background_allocated (seg) - heap_segment_mem (seg); + dprintf (3333, ("h%d gen%d seg %Ix (%Ix) background allocated is %Ix", heap_number, i, (size_t)(seg), heap_segment_mem (seg), heap_segment_background_allocated (seg))); @@ -42103,7 +42154,7 @@ gc_heap::verify_free_lists () } } -void gc_heap::verify_regions (int gen_number, bool can_verify_gen_num) +void gc_heap::verify_regions (int gen_number, bool can_verify_gen_num, bool can_verify_tail) { #ifdef USE_REGIONS // For the given generation, verify that @@ -42166,7 +42217,7 @@ void gc_heap::verify_regions (int gen_number, bool can_verify_gen_num) FATAL_GC_ERROR(); } - if (tail_region != prev_region_in_gen) + if (can_verify_tail && (tail_region != prev_region_in_gen)) { dprintf (REGIONS_LOG, ("h%d gen%d tail region is %Ix(%Ix), diff from last region %Ix(%Ix)!!", heap_number, gen_number, @@ -42177,12 +42228,18 @@ void gc_heap::verify_regions (int gen_number, bool can_verify_gen_num) #endif //USE_REGIONS } -void gc_heap::verify_regions (bool can_verify_gen_num) +inline bool is_user_alloc_gen (int gen_number) +{ + return ((gen_number == soh_gen0) || (gen_number == loh_generation) || (gen_number == poh_generation)); +} + +void gc_heap::verify_regions (bool can_verify_gen_num, bool concurrent_p) { #ifdef USE_REGIONS for (int i = 0; i < total_generation_count; i++) { - verify_regions (i, can_verify_gen_num); + bool can_verify_tail = (concurrent_p ? !is_user_alloc_gen (i) : true); + verify_regions (i, can_verify_gen_num, can_verify_tail); } #endif //USE_REGIONS } @@ -42313,7 +42370,7 @@ void gc_heap::verify_heap (BOOL begin_gc_p) //verify that the generation structures makes sense { #ifdef USE_REGIONS - verify_regions (true); + verify_regions (true, settings.concurrent); #else //USE_REGIONS generation* gen = generation_of (max_generation); @@ -43374,8 +43431,15 @@ void GCHeap::SetYieldProcessorScalingFactor (float scalingFactor) unsigned int GCHeap::WhichGeneration (Object* object) { - gc_heap* hp = gc_heap::heap_of ((uint8_t*)object); - unsigned int g = hp->object_gennum ((uint8_t*)object); + uint8_t* o = (uint8_t*)object; +#ifdef FEATURE_BASICFREEZE + if (!((o < g_gc_highest_address) && (o >= g_gc_lowest_address))) + { + return max_generation; + } +#endif //FEATURE_BASICFREEZE + gc_heap* hp = gc_heap::heap_of (o); + unsigned int g = hp->object_gennum (o); dprintf (3, ("%Ix is in gen %d", (size_t)object, g)); return g; } @@ -45097,11 +45161,11 @@ size_t GCHeap::GetTotalBytesInUse () for (int i = 0; i < gc_heap::n_heaps; i++) { GCHeap* Hp = gc_heap::g_heaps [i]->vm_heap; - tot_size += Hp->ApproxTotalBytesInUse (FALSE); + tot_size += Hp->ApproxTotalBytesInUse(); } return tot_size; #else - return ApproxTotalBytesInUse (); + return ApproxTotalBytesInUse(); #endif //MULTIPLE_HEAPS } @@ -45156,58 +45220,58 @@ size_t GCHeap::ApproxTotalBytesInUse(BOOL small_heap_only) size_t totsize = 0; enter_spin_lock (&pGenGCHeap->gc_lock); - // the complication with the following code is that background GC may - // remove the ephemeral segment while we are iterating - // if so, we retry a couple times and ultimately may report a slightly wrong result - for (int tries = 1; tries <= 3; tries++) + // For gen0 it's a bit complicated because we are currently allocating in it. We get the fragmentation first + // just so that we don't give a negative number for the resulting size. + generation* gen = pGenGCHeap->generation_of (0); + size_t gen0_frag = generation_free_list_space (gen) + generation_free_obj_space (gen); + uint8_t* current_alloc_allocated = pGenGCHeap->alloc_allocated; + heap_segment* current_eph_seg = pGenGCHeap->ephemeral_heap_segment; + size_t gen0_size = 0; +#ifdef USE_REGIONS + heap_segment* gen0_seg = generation_start_segment (gen); + while (gen0_seg) { - heap_segment* eph_seg = generation_allocation_segment (pGenGCHeap->generation_of (0)); - // Get small block heap size info - totsize = (pGenGCHeap->alloc_allocated - heap_segment_mem (eph_seg)); - heap_segment* seg1 = generation_start_segment (pGenGCHeap->generation_of (max_generation)); - while ((seg1 != eph_seg) && (seg1 != nullptr) -#ifdef BACKGROUND_GC - && (seg1 != pGenGCHeap->freeable_soh_segment) -#endif //BACKGROUND_GC - ) + uint8_t* end = in_range_for_segment (current_alloc_allocated, gen0_seg) ? + current_alloc_allocated : heap_segment_allocated (gen0_seg); + gen0_size += end - heap_segment_mem (gen0_seg); + + if (gen0_seg == current_eph_seg) { -#ifdef BACKGROUND_GC - if (!heap_segment_decommitted_p (seg1)) -#endif //BACKGROUND_GC - { - totsize += heap_segment_allocated (seg1) - - heap_segment_mem (seg1); - } - seg1 = heap_segment_next (seg1); - } - if (seg1 == eph_seg) break; + } + + gen0_seg = heap_segment_next (gen0_seg); + } +#else //USE_REGIONS + // For segments ephemeral seg does not change. + gen0_size = current_alloc_allocated - heap_segment_mem (current_eph_seg); +#endif //USE_REGIONS + + totsize = gen0_size - gen0_frag; + + int stop_gen_index = max_generation; + + if (gc_heap::current_c_gc_state == c_gc_state_planning) + { + // During BGC sweep since we can be deleting SOH segments, we avoid walking the segment + // list. + generation* oldest_gen = pGenGCHeap->generation_of (max_generation); + totsize = pGenGCHeap->background_soh_size_end_mark - generation_free_list_space (oldest_gen) - generation_free_obj_space (oldest_gen); + stop_gen_index--; } - //discount the fragmentation - for (int i = 0; i <= max_generation; i++) + for (int i = (max_generation - 1); i <= stop_gen_index; i++) { generation* gen = pGenGCHeap->generation_of (i); - totsize -= (generation_free_list_space (gen) + generation_free_obj_space (gen)); + totsize += pGenGCHeap->generation_size (i) - generation_free_list_space (gen) - generation_free_obj_space (gen); } if (!small_heap_only) { for (int i = uoh_start_generation; i < total_generation_count; i++) { - heap_segment* seg2 = generation_start_segment (pGenGCHeap->generation_of (i)); - - while (seg2 != 0) - { - totsize += heap_segment_allocated (seg2) - - heap_segment_mem (seg2); - seg2 = heap_segment_next (seg2); - } - - //discount the fragmentation - generation* uoh_gen = pGenGCHeap->generation_of (i); - size_t frag = generation_free_list_space (uoh_gen) + generation_free_obj_space (uoh_gen); - totsize -= frag; + generation* gen = pGenGCHeap->generation_of (i); + totsize += pGenGCHeap->generation_size (i) - generation_free_list_space (gen) - generation_free_obj_space (gen); } } leave_spin_lock (&pGenGCHeap->gc_lock); diff --git a/src/coreclr/gc/gcinterface.dac.h b/src/coreclr/gc/gcinterface.dac.h index cfffcf1221a811..c7d72c7145baf4 100644 --- a/src/coreclr/gc/gcinterface.dac.h +++ b/src/coreclr/gc/gcinterface.dac.h @@ -111,7 +111,7 @@ enum oom_reason /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ /* If you modify failure_get_memory and */ /* oom_reason be sure to make the corresponding */ -/* changes in toolbox\sos\strike\strike.cpp. */ +/* changes in tools\sos\strike\strike.cpp. */ /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ enum failure_get_memory { diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h index 081b9a539c073c..baa0272db1368d 100644 --- a/src/coreclr/gc/gcpriv.h +++ b/src/coreclr/gc/gcpriv.h @@ -51,7 +51,7 @@ inline void FATAL_GC_ERROR() // // This means any empty regions can be freely used for any generation. For // Server GC we will balance regions between heaps. -// For now enable regions by default for only StandAlone GC builds +// For now disable regions outside of StandAlone GC builds #if defined (HOST_64BIT) && defined (BUILD_AS_STANDALONE) #define USE_REGIONS #endif //HOST_64BIT && BUILD_AS_STANDALONE @@ -1286,9 +1286,9 @@ class gc_heap PER_HEAP void verify_free_lists(); PER_HEAP - void verify_regions (int gen_number, bool can_verify_gen_num); + void verify_regions (int gen_number, bool can_verify_gen_num, bool can_verify_tail); PER_HEAP - void verify_regions (bool can_verify_gen_num); + void verify_regions (bool can_verify_gen_num, bool concurrent_p); PER_HEAP_ISOLATED void enter_gc_lock_for_verify_heap(); PER_HEAP_ISOLATED @@ -2156,8 +2156,6 @@ class gc_heap PER_HEAP void seg_clear_mark_array_bits_soh (heap_segment* seg); PER_HEAP - void clear_batch_mark_array_bits (uint8_t* start, uint8_t* end); - PER_HEAP void bgc_clear_batch_mark_array_bits (uint8_t* start, uint8_t* end); #ifdef VERIFY_HEAP PER_HEAP @@ -3440,6 +3438,9 @@ class gc_heap PER_HEAP void decommit_mark_array_by_seg (heap_segment* seg); + PER_HEAP_ISOLATED + bool should_update_end_mark_size(); + PER_HEAP void background_mark_phase(); @@ -4268,6 +4269,9 @@ class gc_heap PER_HEAP size_t bgc_poh_size_increased; + PER_HEAP + size_t background_soh_size_end_mark; + PER_HEAP size_t background_soh_alloc_count; diff --git a/src/coreclr/gc/unix/gcenv.unix.cpp b/src/coreclr/gc/unix/gcenv.unix.cpp index 895d2afdf395a9..2d979c395610e9 100644 --- a/src/coreclr/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/gc/unix/gcenv.unix.cpp @@ -28,6 +28,10 @@ #undef min #undef max +#ifndef __has_cpp_attribute +#define __has_cpp_attribute(x) (0) +#endif + #if __has_cpp_attribute(fallthrough) #define FALLTHROUGH [[fallthrough]] #else @@ -98,7 +102,7 @@ extern "C" # define __NR_membarrier 389 # elif defined(__aarch64__) # define __NR_membarrier 283 -# elif +# else # error Unknown architecture # endif # endif diff --git a/src/coreclr/hosts/corerun/dotenv.cpp b/src/coreclr/hosts/corerun/dotenv.cpp index ba22f5004713d0..0e0e37c7919b0a 100644 --- a/src/coreclr/hosts/corerun/dotenv.cpp +++ b/src/coreclr/hosts/corerun/dotenv.cpp @@ -4,10 +4,13 @@ #include "dotenv.hpp" #include #include -#include #include #include +#ifdef TARGET_WINDOWS +#include +#endif + namespace { pal::string_t convert_to_string_t(std::string str) diff --git a/src/coreclr/hosts/coreshim/CoreShim.cpp b/src/coreclr/hosts/coreshim/CoreShim.cpp index 62ab011df12155..23265e5872b3f6 100644 --- a/src/coreclr/hosts/coreshim/CoreShim.cpp +++ b/src/coreclr/hosts/coreshim/CoreShim.cpp @@ -375,7 +375,7 @@ HRESULT coreclr::Initialize( HMODULE mod = ::GetModuleHandleW(W("CoreRun.exe")); if (mod != NULL) { - using GetCurrentClrDetailsFunc = HRESULT(*)(void **clrInstance, unsigned int *appDomainId); + using GetCurrentClrDetailsFunc = HRESULT(__cdecl *)(void **clrInstance, unsigned int *appDomainId); auto getCurrentClrDetails = (GetCurrentClrDetailsFunc)::GetProcAddress(mod, "GetCurrentClrDetails"); RETURN_IF_FAILED(getCurrentClrDetails(&_clrInst, &_appDomainId)); if (_clrInst != nullptr) diff --git a/src/coreclr/ilasm/asmman.cpp b/src/coreclr/ilasm/asmman.cpp index 7b5fd474b65157..447267d0b4d252 100644 --- a/src/coreclr/ilasm/asmman.cpp +++ b/src/coreclr/ilasm/asmman.cpp @@ -49,7 +49,7 @@ BinStr* BinStrToUnicode(BinStr* pSource, bool Swap) return NULL; } -AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName) +AsmManFile* AsmMan::GetFileByName(_In_ __nullterminated char* szFileName) { AsmManFile* ret = NULL; if(szFileName) @@ -63,14 +63,14 @@ AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName return ret; } -mdToken AsmMan::GetFileTokByName(__in __nullterminated char* szFileName) +mdToken AsmMan::GetFileTokByName(_In_ __nullterminated char* szFileName) { AsmManFile* tmp = GetFileByName(szFileName); return(tmp ? tmp->tkTok : mdFileNil); } -AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName) +AsmManComType* AsmMan::GetComTypeByName(_In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName) { AsmManComType* ret = NULL; if(szComTypeName) @@ -102,14 +102,14 @@ AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char* } mdToken AsmMan::GetComTypeTokByName( - __in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName) + _In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName) { AsmManComType* tmp = GetComTypeByName(szComTypeName, szComEnclosingTypeName); return(tmp ? tmp->tkTok : mdExportedTypeNil); } -AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* szAsmRefName) +AsmManAssembly* AsmMan::GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName) { AsmManAssembly* ret = NULL; if(szAsmRefName) @@ -124,12 +124,12 @@ AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* sz } return ret; } -mdToken AsmMan::GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName) +mdToken AsmMan::GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName) { AsmManAssembly* tmp = GetAsmRefByName(szAsmRefName); return(tmp ? tmp->tkTok : mdAssemblyRefNil); } -AsmManAssembly* AsmMan::GetAsmRefByAsmName(__in __nullterminated const char* szAsmName) +AsmManAssembly* AsmMan::GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName) { AsmManAssembly* ret = NULL; if(szAsmName) @@ -160,7 +160,7 @@ void AsmMan::SetModuleName(__inout_opt __nullterminated char* szName) } //============================================================================================================== -void AsmMan::AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob) +void AsmMan::AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob) { AsmManFile* tmp = GetFileByName(szName); Assembler* pAsm = (Assembler*)m_pAssembler; @@ -244,7 +244,7 @@ void AsmMan::EmitFiles() } //end for(i = 0; tmp=m_FileLst.PEEK(i); i++) } -void AsmMan::StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef) +void AsmMan::StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef) { if(!isRef && (0==strcmp(szName, "mscorlib"))) ((Assembler*)m_pAssembler)->m_fIsMscorlib = TRUE; if(!isRef && (m_pAssembly != NULL)) @@ -674,7 +674,7 @@ void AsmMan::SetAssemblyAutodetect() } } -void AsmMan::StartComType(__in __nullterminated char* szName, DWORD dwAttr) +void AsmMan::StartComType(_In_ __nullterminated char* szName, DWORD dwAttr) { if((m_pCurComType = new AsmManComType)) { @@ -732,7 +732,7 @@ void AsmMan::EndComType() } } -void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName) +void AsmMan::SetComTypeFile(_In_ __nullterminated char* szFileName) { if(m_pCurComType) { @@ -740,7 +740,7 @@ void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName) } } -void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName) +void AsmMan::SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName) { if(m_pCurComType) { @@ -748,7 +748,7 @@ void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName) } } -void AsmMan::SetComTypeComType(__in __nullterminated char* szComTypeName) +void AsmMan::SetComTypeComType(_In_ __nullterminated char* szComTypeName) { if(m_pCurComType) { @@ -780,7 +780,7 @@ BOOL AsmMan::SetComTypeClassTok(mdToken tkClass) return FALSE; } -void AsmMan::StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr) +void AsmMan::StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr) { if((m_pCurManRes = new AsmManRes)) { @@ -808,7 +808,7 @@ void AsmMan::EndManifestRes() } -void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset) +void AsmMan::SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset) { if(m_pCurManRes) { @@ -817,7 +817,7 @@ void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG } } -void AsmMan::SetManifestResAsmRef(__in __nullterminated char* szAsmRefName) +void AsmMan::SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName) { if(m_pCurManRes) { diff --git a/src/coreclr/ilasm/asmman.hpp b/src/coreclr/ilasm/asmman.hpp index 1290c9b2707c8a..972c8382434f8e 100644 --- a/src/coreclr/ilasm/asmman.hpp +++ b/src/coreclr/ilasm/asmman.hpp @@ -193,12 +193,12 @@ class AsmMan ErrorReporter* report; void* m_pAssembler; - AsmManFile* GetFileByName(__in __nullterminated char* szFileName); - AsmManAssembly* GetAsmRefByName(__in __nullterminated const char* szAsmRefName); - AsmManComType* GetComTypeByName(__in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName = NULL); - mdToken GetComTypeTokByName(__in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName = NULL); + AsmManFile* GetFileByName(_In_ __nullterminated char* szFileName); + AsmManAssembly* GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName); + AsmManComType* GetComTypeByName(_In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName = NULL); + mdToken GetComTypeTokByName(_In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName = NULL); IMetaDataEmit* m_pEmitter; @@ -241,11 +241,11 @@ class AsmMan void SetModuleName(__inout_opt __nullterminated char* szName); - void AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob); + void AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob); void EmitFiles(); void EmitDebuggableAttribute(mdToken tkOwner); - void StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef); + void StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef); void EndAssembly(); void EmitAssemblyRefs(); void EmitAssembly(); @@ -257,27 +257,27 @@ class AsmMan void SetAssemblyHashBlob(BinStr* pHashBlob); void SetAssemblyAutodetect(); - void StartComType(__in __nullterminated char* szName, DWORD dwAttr); + void StartComType(_In_ __nullterminated char* szName, DWORD dwAttr); void EndComType(); - void SetComTypeFile(__in __nullterminated char* szFileName); - void SetComTypeAsmRef(__in __nullterminated char* szAsmRefName); - void SetComTypeComType(__in __nullterminated char* szComTypeName); + void SetComTypeFile(_In_ __nullterminated char* szFileName); + void SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName); + void SetComTypeComType(_In_ __nullterminated char* szComTypeName); BOOL SetComTypeImplementationTok(mdToken tk); BOOL SetComTypeClassTok(mdToken tkClass); - void StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr); + void StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr); void EndManifestRes(); - void SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset); - void SetManifestResAsmRef(__in __nullterminated char* szAsmRefName); + void SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset); + void SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName); - AsmManAssembly* GetAsmRefByAsmName(__in __nullterminated const char* szAsmName); + AsmManAssembly* GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName); - mdToken GetFileTokByName(__in __nullterminated char* szFileName); - mdToken GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName); - mdToken GetAsmTokByName(__in __nullterminated const char* szAsmName) + mdToken GetFileTokByName(_In_ __nullterminated char* szFileName); + mdToken GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName); + mdToken GetAsmTokByName(_In_ __nullterminated const char* szAsmName) { return (m_pAssembly && (strcmp(m_pAssembly->szName,szAsmName)==0)) ? m_pAssembly->tkTok : 0; }; - mdToken GetModuleRefTokByName(__in __nullterminated char* szName) + mdToken GetModuleRefTokByName(_In_ __nullterminated char* szName) { if(szName && *szName) { diff --git a/src/coreclr/ilasm/asmparse.h b/src/coreclr/ilasm/asmparse.h index ef377b5e430d7c..e5479202730033 100644 --- a/src/coreclr/ilasm/asmparse.h +++ b/src/coreclr/ilasm/asmparse.h @@ -20,11 +20,11 @@ class ReadStream { virtual ~ReadStream() = default; - virtual unsigned getAll(__out char** ppch) = 0; + virtual unsigned getAll(_Out_ char** ppch) = 0; // read at most 'buffLen' bytes into 'buff', Return the // number of characters read. On EOF return 0 - virtual unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) = 0; + virtual unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) = 0; // Return the name of the stream, (for error reporting). //virtual const char* name() = 0; @@ -49,12 +49,12 @@ class BinStrStream : public ReadStream { //if(m_pBS) // delete m_pBS; }; - unsigned getAll(__out char **ppbuff) + unsigned getAll(_Out_ char **ppbuff) { *ppbuff = m_pStart; return m_pBS->length(); }; - unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) + unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) { _ASSERTE(m_pStart != NULL); unsigned Remainder = (unsigned)(m_pEnd - m_pCurr); @@ -95,7 +95,7 @@ class BinStrStream : public ReadStream { /**************************************************************************/ class MappedFileStream : public ReadStream { public: - MappedFileStream(__in __nullterminated WCHAR* wFileName) + MappedFileStream(_In_ __nullterminated WCHAR* wFileName) { fileNameW = wFileName; m_hFile = INVALID_HANDLE_VALUE; @@ -124,12 +124,12 @@ class MappedFileStream : public ReadStream { fileNameW = NULL; } } - unsigned getAll(__out char** pbuff) + unsigned getAll(_Out_ char** pbuff) { *pbuff = m_pStart; return m_FileSize; } - unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) + unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) { _ASSERTE(m_pStart != NULL); unsigned Remainder = (unsigned)(m_pEnd - m_pCurr); @@ -214,29 +214,29 @@ typedef LIFO ARG_NAME_LIST_STACK; /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEXTCHAR)(char*); -char* nextcharU(__in __nullterminated char* pos); -char* nextcharW(__in __nullterminated char* pos); +char* nextcharU(_In_ __nullterminated char* pos); +char* nextcharW(_In_ __nullterminated char* pos); /*--------------------------------------------------------------------------*/ typedef unsigned(*PFN_SYM)(char*); -unsigned SymAU(__in __nullterminated char* curPos); -unsigned SymW(__in __nullterminated char* curPos); +unsigned SymAU(_In_ __nullterminated char* curPos); +unsigned SymW(_In_ __nullterminated char* curPos); /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEWSTRFROMTOKEN)(char*,size_t); -char* NewStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen); -char* NewStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen); +char* NewStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen); +char* NewStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen); /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEWSTATICSTRFROMTOKEN)(char*,size_t,char*,size_t); -char* NewStaticStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize); -char* NewStaticStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize); +char* NewStaticStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize); +char* NewStaticStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize); /*--------------------------------------------------------------------------*/ typedef unsigned(*PFN_GETDOUBLE)(char*,unsigned,double**); -unsigned GetDoubleAU(__in __nullterminated char* begNum, unsigned L, double** ppRes); -unsigned GetDoubleW(__in __nullterminated char* begNum, unsigned L, double** ppRes); +unsigned GetDoubleAU(_In_ __nullterminated char* begNum, unsigned L, double** ppRes); +unsigned GetDoubleW(_In_ __nullterminated char* begNum, unsigned L, double** ppRes); /*--------------------------------------------------------------------------*/ struct PARSING_ENVIRONMENT { @@ -284,9 +284,9 @@ class AsmParse : public ErrorReporter virtual void warn(const char* fmt, ...); virtual void msg(const char* fmt, ...); char *getLine(int lineNum) { return penv->in->getLine(lineNum); }; - unsigned getAll(__out char** pbuff) { return penv->in->getAll(pbuff); }; + unsigned getAll(_Out_ char** pbuff) { return penv->in->getAll(pbuff); }; bool Success() {return success; }; - void SetIncludePath(__in WCHAR* wz) { wzIncludePath = wz; }; + void SetIncludePath(_In_ WCHAR* wz) { wzIncludePath = wz; }; ARG_NAME_LIST_STACK m_ANSFirst; ARG_NAME_LIST_STACK m_ANSLast; @@ -298,20 +298,20 @@ class AsmParse : public ErrorReporter BinStr* MakeTypeClass(CorElementType kind, mdToken tk); BinStr* MakeTypeArray(CorElementType kind, BinStr* elemType, BinStr* bounds); - char* fillBuff(__in_opt __nullterminated char* curPos); // refill the input buffer + char* fillBuff(_In_opt_z_ char* curPos); // refill the input buffer HANDLE hstdout; HANDLE hstderr; private: - friend void yyerror(__in __nullterminated const char* str); + friend void yyerror(_In_ __nullterminated const char* str); friend int parse_literal(unsigned curSym, __inout __nullterminated char* &curPos, BOOL translate_escapes); friend int yyparse(); friend int yylex(); friend Instr* SetupInstr(unsigned short opcode); friend int findKeyword(const char* name, size_t nameLen, unsigned short* opcode); - friend TypeDefDescr* findTypedef(__in_ecount(nameLen) char* name, size_t nameLen); - friend char* skipBlanks(__in __nullterminated char*,unsigned*); - friend char* nextBlank(__in __nullterminated char*); + friend TypeDefDescr* findTypedef(_In_reads_(nameLen) char* name, size_t nameLen); + friend char* skipBlanks(_In_ __nullterminated char*,unsigned*); + friend char* nextBlank(_In_ __nullterminated char*); friend int ProcessEOF(); friend unsigned __int8* skipType(unsigned __int8* ptr, BOOL fFixupType); friend void FixupConstraints(); diff --git a/src/coreclr/ilasm/assem.cpp b/src/coreclr/ilasm/assem.cpp index e8044d16ab2b7f..e58b8e569d8d34 100644 --- a/src/coreclr/ilasm/assem.cpp +++ b/src/coreclr/ilasm/assem.cpp @@ -1039,7 +1039,7 @@ BOOL Assembler::EmitProp(PropDescriptor* pPD) return TRUE; } -Class *Assembler::FindCreateClass(__in __nullterminated const char *pszFQN) +Class *Assembler::FindCreateClass(_In_ __nullterminated const char *pszFQN) { Class *pSearch = NULL; @@ -1186,7 +1186,7 @@ BOOL Assembler::DoGlobalFixups() return TRUE; } -state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTION section) +state_t Assembler::AddGlobalLabel(_In_ __nullterminated char *pszName, HCEESECTION section) { if (FindGlobalLabel(pszName) != NULL) { @@ -1213,7 +1213,7 @@ state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTI return m_State; } -void Assembler::AddLabel(DWORD CurPC, __in __nullterminated char *pszName) +void Assembler::AddLabel(DWORD CurPC, _In_ __nullterminated char *pszName) { if (m_pCurMethod->FindLabel(pszName) != NULL) { @@ -1478,7 +1478,7 @@ acceptable. Do NOT use for cryptographic purposes. */ unsigned hash( - __in_ecount(length) const BYTE *k, /* the key */ + _In_reads_(length) const BYTE *k, /* the key */ unsigned length, /* the length of the key */ unsigned initval) /* the previous hash, or an arbitrary value */ { diff --git a/src/coreclr/ilasm/assembler.cpp b/src/coreclr/ilasm/assembler.cpp index 48f9487656f7cf..85183bfae7542b 100644 --- a/src/coreclr/ilasm/assembler.cpp +++ b/src/coreclr/ilasm/assembler.cpp @@ -15,7 +15,7 @@ #define FAIL_UNLESS(x, y) if (!(x)) { report->error y; return; } /**************************************************************************/ -void Assembler::StartNameSpace(__in __nullterminated char* name) +void Assembler::StartNameSpace(_In_ __nullterminated char* name) { m_NSstack.PUSH(m_szNamespace); m_szNamespace = name; @@ -91,7 +91,7 @@ void Assembler::ClearBoundList(void) m_TyParList = NULL; } /**************************************************************************/ -mdToken Assembler::ResolveClassRef(mdToken tkResScope, __in __nullterminated const char *pszFullClassName, Class** ppClass) +mdToken Assembler::ResolveClassRef(mdToken tkResScope, _In_ __nullterminated const char *pszFullClassName, Class** ppClass) { Class *pClass = NULL; mdToken tkRet = mdTokenNil; @@ -239,7 +239,7 @@ mdToken Assembler::ResolveTypeSpec(BinStr* typeSpec) } /**************************************************************************/ -mdToken Assembler::GetAsmRef(__in __nullterminated const char* szName) +mdToken Assembler::GetAsmRef(_In_ __nullterminated const char* szName) { mdToken tkResScope = 0; if(strcmp(szName,"*")==0) tkResScope = mdTokenNil; @@ -330,7 +330,7 @@ mdToken Assembler::GetInterfaceImpl(mdToken tsClass, mdToken tsInterface) } /**************************************************************************/ -mdToken Assembler::GetModRef(__in __nullterminated char* szName) +mdToken Assembler::GetModRef(_In_ __nullterminated char* szName) { mdToken tkResScope = 0; if(!strcmp(szName,m_szScopeName)) @@ -417,7 +417,7 @@ DWORD Assembler::CheckClassFlagsIfNested(Class* pEncloser, DWORD attr) /**************************************************************************/ -void Assembler::StartClass(__in __nullterminated char* name, DWORD attr, TyParList *typars) +void Assembler::StartClass(_In_ __nullterminated char* name, DWORD attr, TyParList *typars) { Class *pEnclosingClass = m_pCurClass; char *szFQN; @@ -607,7 +607,7 @@ void Assembler::SetPinvoke(BinStr* DllName, int Ordinal, BinStr* Alias, int Attr } /**************************************************************************/ -void Assembler::StartMethod(__in __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars) +void Assembler::StartMethod(_In_ __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars) { if (m_pCurMethod != NULL) { @@ -801,7 +801,7 @@ void Assembler::EndMethod() } /**************************************************************************/ /* rvaLabel is the optional label that indicates this field points at a particular RVA */ -void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, __in __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset) +void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, _In_ __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset) { FieldDescriptor* pFD; ULONG i,n; @@ -1030,7 +1030,7 @@ void Assembler::NewSEHDescriptor(void) //sets m_SEHD if(m_SEHD == NULL) report->error("Failed to allocate SEH descriptor\n"); } /**************************************************************************/ -void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullterminated char *szTo) +void Assembler::SetTryLabels(_In_ __nullterminated char * szFrom, _In_ __nullterminated char *szTo) { if(!m_SEHD) return; Label *pLbl = m_pCurMethod->FindLabel(szFrom); @@ -1043,7 +1043,7 @@ void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullter else report->error("Undefined 1st label in 'try