Commit Graph

9 Commits

Author SHA1 Message Date
Alexis Laferrière
074df70248 Serialization: Write the target SDK in the binary swiftmodule 2024-05-16 11:52:36 -07:00
Alexis Laferrière
144d7eb8a0 [Serialization] Report detected modularization breaks
The Swift compiler expects the context to remain stable between when a
module is built and loaded by a client. Usually the build system would
rebuild a module if a dependency changes, or the compiler would rebuilt
the module from a swiftinterface on a context change. However, such
changes are not always detected and in that case the compiler may crash
on an inconsistency in the context. We often see this when a clang
module is poorly modularized, the headers are modified in the SDK, or
some clang define change its API.

These are project issues that used to make the compiler crash, it
provided a poor experience and doesn't encourage the developer to fix
them by themselves. Instead, let's keep track of modularization issues
encountered during deserialization and report them as proper errors when
they trigger a fatal failure preventing compilation.
2023-05-17 10:23:33 -07:00
Alexis Laferrière
41ec454129 [Serialization] Update error message on deserialization failure
This adds information about whether the module was built from source or
from a swiftinterface, whether it's resilient or not, and tweaks the
format.
2022-10-27 18:51:28 -07:00
Alexis Laferrière
9c840a7156 [Serialization] Suggest solution for SDK mods causing deserialization failures
Many deserialization failures at this points are caused by archives
installed over the SDK. Let's extend the current error message with a
solution for such a case.

rdar://86280699
2022-08-18 12:30:49 -07:00
Ben Barham
599ba8bdbd Add all deserialization fatal output to the pretty stack trace
Rather than outputting diagnostics and to stderr, output all the extra
information added when deserialization fatally fails to the pretty stack
trace instead. Since the pretty stack trace is added to crash logs, this
should avoid the dance of requesting the compiler output

  - Moves the previous "**** DESERIALIZATION FAILURE ..." output to the
    last pretty stack trace line

  - Removes the module and compiler version notes added to the fatal
    diagnostic

  - Adds a new effective compiler version line for all frontend failure.
    Somewhat duplicates the line from the driver, but adds in the
    effective version

  - Adds a new line for the full misc version of the module that failed.
    May double up with previous "While reading from ..." lines that are
    added in various deserialization methods, but better to have it
    twice than not at all
2021-06-04 08:32:07 +10:00
Alexis Laferrière
eae6c00bf3 Merge pull request #36873 from xymus/shorter-xref-note
[Serialization] Shorten and fix reference to wrong module in note
2021-04-12 17:17:38 -07:00
Alexis Laferrière
a3b848b3c1 [Serialization] Shorten and fix reference to wrong module in note 2021-04-12 14:32:29 -07:00
Alexis Laferrière
cd92c080a3 [Serialization] Revert the change to path printing on failures
This is a partial revert  of commit
c5c850c14d.
2021-04-06 11:49:51 -07:00
Alexis Laferrière
9f71f46ee1 [Serialization] Test the output on a crash due to a broken XRef 2021-03-18 12:44:30 -07:00