Skip to content

[frontend] Fix TBD validation almost always done for modules #40414

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
merged 1 commit into from
Dec 17, 2021

Conversation

drodriguez
Copy link
Contributor

The logic to do or not the validation of TBD against IR was incorrect.
In the case of modules, the comment described what was supposed to
happen (skipping the validation if the module had SIB files), but the
code was returning if the module had or not SIB files, which would have
returned true for any module without SIB files without checking if the
compiler was build in a debug configuration or not.

This was only visible in the case of non-debug builds, and it only
appeared for us in a convoluted mix of optimized builds with
-enable-testing on some modules.

@drodriguez drodriguez requested a review from CodaFi December 4, 2021 03:20
@drodriguez
Copy link
Contributor Author

@swift-ci please smoke test

@CodaFi
Copy link
Contributor

CodaFi commented Dec 9, 2021

Good catch. Could you provide a quick regression test that builds a SIB file and tries to pull it in through the frontend as an input?

The logic to do or not the validation of TBD against IR was incorrect.
In the case of modules, the comment described what was supposed to
happen (skipping the validation if the module had SIB files), but the
code was returning if the module had or not SIB files, which would have
returned true for any module without SIB files without checking if the
compiler was build in a debug configuration or not.

This was only visible in the case of non-debug builds, and it only
appeared for us in a convoluted mix of optimized builds with
-enable-testing on some modules.
@drodriguez drodriguez force-pushed the tbd-validation-modules branch from 2cfc4be to 8a0e512 Compare December 10, 2021 20:39
@drodriguez
Copy link
Contributor Author

Added a small check that creates a module from a SIB file and a non-SIB module and checks that independently if the validation is performed, SIL can be generated.

@swift-ci please smoke test

@drodriguez
Copy link
Contributor Author

@swift-ci please test Windows platform

@drodriguez
Copy link
Contributor Author

@CodaFi: can you check if the added test was what you had in mind? (if not, can you point out to a test that I can look as a template?) Thanks!

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