Skip to content

Revert "[SwiftLexicalLookup] New unqualified lookup implementation validation" #78280

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 19, 2024

Conversation

bnbarham
Copy link
Contributor

Reverts #77140 as it causes nightly toolchain failures for Debian 12/Fedora 39/Ubuntu 24.04.

@bnbarham
Copy link
Contributor Author

bnbarham commented Dec 18, 2024

@MAJKFL I believe the issue here is that there's now a cycle from swiftAST -> swiftASTGen -> swiftAST. It passed on PR testing as it uses Ubuntu 20.04 and ends up using lld rather than gold, which appears to handle the cycle.

@bnbarham
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@MAJKFL MAJKFL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see there’s a cycle. Thank you for caching that! It does seem to be a bit tricky to fix. I don’t think it would be possible to move the validation outside of ASTGen as it uses it to e.g. access cached if config configured regions, or the parsed source file itself.

Would it make sense to move the logic somewhere outside of swiftAST, or to possibly inject LoggingASTScopeDeclConsumer at all unqualified lookup entry points? If it’s not a viable option, do you perhaps have any suggestions for an alternative approach? @bnbarham @DougGregor

I think it's a good idea to revert it for now and I'll look into fixing it in a subsequent PR.

@plemarquand plemarquand merged commit ae88aac into main Dec 19, 2024
3 checks passed
@plemarquand plemarquand deleted the revert-77140-swift-lexical-lookup-validation branch December 19, 2024 17:40
@bnbarham
Copy link
Contributor Author

bnbarham commented Dec 19, 2024

Would it make sense to move the logic somewhere outside of swiftAST, or to possibly inject LoggingASTScopeDeclConsumer at all unqualified lookup entry points

I think the easiest thing here would probably be to have a new Swift module, ie. move LexicalLookup out of ASTGen.

EDIT: I just noticed you said:

I don’t think it would be possible to move the validation outside of ASTGen as it uses it to e.g. access cached if config configured regions, or the parsed source file itself.

I'd need to look into that more, it does seem like it should be possible to split them 🤔. We probably need to split out more of ASTGen though - CC @rintaro

@hjyamauchi
Copy link
Contributor

I think the original PR introduces the new dll _CompilerSwiftLexicalLookup.dll and it needed to be added to the installer manifest around here https://github.com/swiftlang/swift-installer-scripts/blob/6cecc7c46d1170a3bc3e1ff8838181418e037397/platforms/Windows/bld/bld.wxs#L418 ?

@bnbarham
Copy link
Contributor Author

Thanks @hjyamauchi, will indeed need to add to swift-installer-scripts too.

@rintaro
Copy link
Member

rintaro commented Dec 19, 2024

I will see if we can extract ExportedSourceFile related code out of ASTGen, so ASTGen and the lexical lookup module depend on it.

rintaro added a commit to rintaro/swift that referenced this pull request Dec 21, 2024
…0-swift-lexical-lookup-validation"

This reverts commit ae88aac, reversing
changes made to b0123bc.
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.

5 participants