Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet-linker] Improve the error message from the linker when we run into a problem. #14253

Merged
merged 1 commit into from
Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tools/dotnet-linker/LinkerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,9 @@ public static void Report (LinkContext context, IList<Exception> exceptions)
var list = ErrorHelper.CollectExceptions (exceptions);
var allWarnings = list.All (v => v is ProductException pe && !pe.Error);
if (!allWarnings) {
// Revisit the error code after https://github.com/mono/linker/issues/1596 has been fixed.
var instance = GetInstance (context, false);
var platform = (instance?.Platform)?.ToString () ?? "unknown";
var msg = MessageContainer.CreateCustomErrorMessage ("Failed to execute the custom steps.", 6999, platform);
var msg = MessageContainer.CreateCustomErrorMessage (Errors.MX7000 /* An error occured while executing the custom linker steps. Please review the build log for more information. */, 7000, platform);
context.LogMessage (msg);
}
// ErrorHelper.Show will print our errors and warnings to stderr.
Expand Down
9 changes: 9 additions & 0 deletions tools/mtouch/Errors.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tools/mtouch/Errors.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,13 @@
</value>
</data>

<!-- The linker says custom linker steps can't use error codes between 1000 and 6000, so we use >= 7000 -->
<data name="MX7000" xml:space="preserve">
<value>An error occured while executing the custom linker steps. Please review the build log for more information.</value>
</data>

<!-- 8XXX are for errors that occur at runtime -->

<data name="MT8018" xml:space="preserve">
<value>Internal consistency error. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new.
</value>
Expand Down