Skip to content

[5.7-04182022][Parseable Output] Compute file extensions using full extension strings & emit output in WMO #58871

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

Merged

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 12, 2022

Cherry-pick of #58422

Cherry-pick of #58865


• Explanation: Generation of valid JSON output for compiler frontend's parseable output depends on being able to determine file types of inputs and outputs of compilation tasks. The compiler defines multiple file kinds with multiple . extensions, such as .abi.json or .private.swiftinterface, but existing code attempts to compute file outputs only using the trailing suffix of the path after the last .. This led to some file kinds not being recognized, which led to us not being able to generate valid JSON.
• Scope of Issue: Compilation tasks launched by build systems that consume parseable-output that specify certain output kinds (for example an ABI descriptor) and fail, do not result in visible error diagnostics being emitted.
• Origination: This particular case was not handled in the implementation of frontend-emitted parseable-output which only started being used recently. The problem of determining file kinds using only the trailing . suffix is more-general in the compiler and needs to be addressed separately. This fix is narrow and specific to generation of parseable-output JSON.
• Risk: Low
• Automated Testing: Automated test added to the compiler test suite

5.7 Cherry-pick PR: #58868
Resolves rdar://92961252


• Explanation: Frontend-emitted parseable-output did not previously emit messages for whole-module jobs because its original intent was to emit messages describing batch compilation jobs. We recently started using frontend-emitted parseable-output and require that it also emit messages for WMO compiler tasks for consistency. This change adds emission of JSON parseable-output messages for WMO compiler jobs. It is already merged for release/5.7, but the above fix is built on top of the fix here so it is worth bringing them both together.
• Scope of Issue: Failing WMO compilation tasks launched by build systems consuming frontend-emitted parseable-output did not previously emit error messages.
• Origination: This particular case was not handled in the implementation of frontend-emitted parseable-output which only started being used recently.
• Risk: Low

This was previously cherry-picked into 5.7 in #58471
Resolves rdar://91999048

…shed messages on a per-primary basis. Which means that `-frontend-parseable-output` had no effect in contexts where no primary inputs are specified, such as WMO. This change fixes that by also emitting began/finished messages when no primary outputs are specified.

Resolves rdar://91999048
@artemcm artemcm requested a review from nkcsgexi May 12, 2022 18:38
@artemcm artemcm requested a review from a team as a code owner May 12, 2022 18:38
@artemcm artemcm changed the title 57 04182022 parseable fixes [5.7-04182022][Parseable Output] Compute file extensions using full extension strings & emit output in WMO May 12, 2022
@artemcm
Copy link
Contributor Author

artemcm commented May 12, 2022

@swift-ci please test

Generation of valid JSON output for parseable output depends on being able to determine file types of inputs and outputs of compilation tasks. FileTypes.def defines multiple file kinds with multiple '.' extensions, such as '.abi.json' or '.features.json', but existing code attempted to compute file outputs only using the trailing suffix of the path after the last '.'. This led to some files not being recognized, which led to us not being able to generate valid JSON.

Resolves rdar://92961252
@artemcm artemcm force-pushed the 57-04182022ParseableFixes branch from 02f1123 to 1186973 Compare May 12, 2022 20:02
@artemcm
Copy link
Contributor Author

artemcm commented May 12, 2022

@swift-ci please test

@artemcm artemcm merged commit 8ae6507 into swiftlang:release/5.7-04182022 May 13, 2022
@artemcm artemcm deleted the 57-04182022ParseableFixes branch May 13, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants