Skip to content

TypeSystem: add a platform hook for library search path additions #6927

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
Jun 1, 2023

Conversation

compnerd
Copy link
Member

Windows does not provide a library search path through a mechanism similar to DT_RPATH or LC_RPATH. Libraries are instead resolved via the environment variable Path. Add a hook to inject the default library search path into the repl instance. This is required to ensure that system libraries are available. With this, it is finally possible to run the REPL on Windows without any additional parameters.

@compnerd compnerd requested a review from adrian-prantl May 28, 2023 16:23
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@adrian-prantl
Copy link

This looks like a change that should be made upstream on llvm.org first.

@compnerd
Copy link
Member Author

@adrian-prantl I don't see how this would be upstream first. It is in a Swift specific path.

@compnerd
Copy link
Member Author

@swift-ci please test

@adrian-prantl
Copy link

If it's Swift-specific, then the function name probably should have Swift in it?

@bulbazord
Copy link

The idea itself looks fine to me. Although it is only used for swift, does it make sense to put it on llvm.org? The change itself doesn't seem explicitly related to swift even if it's only used for swift. What do you think?

@compnerd
Copy link
Member Author

I didn't notice that the other ones did have Swift in their names! I'll rename it.

I think that while this could be useful upstream someday, we currently have a single use of it in SwiftASTContext so I don't see how to justify upstreaming this. I could see this being useful for some of the REPL work that @walter-erquinigo is doing.

That said, I'd like to get this into the 5.9 release as this is the last piece needed for the REPL on Windows I believe. I can try to upstream it in parallel.

Windows does not provide a library search path through a mechanism
similar to `DT_RPATH` or `LC_RPATH`.  Libraries are instead resolved via
the environment variable `Path`.  Add a hook to inject the default
library search path into the repl instance.  This is required to ensure
that system libraries are available.  With this, it is finally possible
to run the REPL on Windows without any additional parameters.
@compnerd
Copy link
Member Author

@swift-ci please test

@walter-erquinigo
Copy link

Indeed, I'd love to have this being available in vanilla lldb. At some point we'll have Windows support and who knows what we'll end up needing. But in any case, no time pressure

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd compnerd requested a review from fredriss May 31, 2023 15:55
@compnerd
Copy link
Member Author

@walter-erquinigo, thanks, then it sounds like it has some reason to be upstreamed. I'll create a separate version that we can upstream in parallel, and then we can switch this over on main and go with this for 5.9. WDYT @bulbazord and @adrian-prantl?

It would be nice to have the REPL be nice to use for the 5.9 release.

@adrian-prantl adrian-prantl merged commit 60e2a62 into swiftlang:swift/release/5.9 Jun 1, 2023
@compnerd compnerd deleted the search branch June 1, 2023 01:50
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.

4 participants