-
Notifications
You must be signed in to change notification settings - Fork 197
Stop passing -resource-dir
to the Frontend if the flag wasn't passed in on the command-line
#1827
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't pass it for
scanDependencies
jobs either initially, then a single testExplicitModuleBuildTests.testExplicitLinkLibraries
failed. It appears that aswift-frontend -scan-dependencies
job alone does not find the resource-dir properly, so I set this flag for that kind of job for now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the failure? It's possible this job relies on being able to look up linked libraries relative to resource directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It complains that it didn't find a single library:
The test, which you just added in #1622 last summer, looks in the Swift resource directory next to whatever compiler was used, as these swift-driver tests require a Swift toolchain to be in the
PATH
when they're run, and makes sure various parts of the stdlib are available. This currently works because this swift-driver queries the frontend with-print-target-info
then passes that Swift-resource-dir
to all subsequent jobs, like the-scan-dependencies
frontend job that this test invokes.However, this seems like a frontend bug that this swift-driver is covering up, as it is the frontend that finds the Swift resource-dir for all other jobs anyway. I will look into why it does not do so only for
-scan-dependencies
in the frontend and fix that first, just ran this through the CI to see if any other tests broke on other platforms and they didn't.Yep, the only question is who should supply the path to that Swift resource directory? We cannot easily do it in the test because it is just picking up the Swift frontend and resource-dir from the
PATH
, ie it could be anywhere.I see no reason why the
swift-frontend -scan-dependencies
job can't find it, whereas the frontend always easily finds it for all other jobs, so I will look into fixing this in the frontend before coming back to this pull. If I'm missing anything, let me know.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I ran some experiments and it appears the problem is not in the frontend at all, but in this repo when trying to scan dependencies in-process by using libswiftScan. If I disable that, as you can see here, the failing test passes on linux, but some other caching and explicit module tests that probably require that in-process scanning then fail. If I simply disable two tests instead, as shown in the latest version of this pull, then the rest of the macOS tests pass, while other scan-dependencies tests still fail on linux for the lack of a resource-dir.
@artemcm, I see two options here:
scan-dependencies
jobs, as I did initially, until we figure out why that in-process scanning works differently.PATH
in its environment- and try to fix that too.Let me know what you'd like to do: if you choose 2., let me know any ideas you have for the difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the investigation! It makes sense that this would be due to a difference with the in-process scanner. And your theory on the different
PATH
seems plausible. I am okay with passingresource-dir
here to the scanner invocation only in the meantime, to make up for that difference. And I will see if I can discern making the in-process scanner potentially not need that.