Skip to content

[Compatibility50] Look up swift_getObjCClassMetadata at runtime. #27170

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
Oct 10, 2019

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Sep 13, 2019

This is the only dependency it has on libswiftCore. Looking this up at runtime allows its use in programs that don't link libswiftCore but might eventually load and run Swift code, such as xctest.

While we're in there, enable tests in files ending with .c.

rdar://problem/55274114

@jckarter
Copy link
Contributor

When does this come up? Should we be linking the compatibility library in the first place in this situation? swiftpm for instance should be set up to disable linking the compatibility library when linking a pure C/ObjC target.

@jckarter
Copy link
Contributor

Also, does libswiftCore.dylib properly load override hooks when it's dynamically dlopened?

@DougGregor
Copy link
Member

My main concern about this is that it may very well not scale. The 5.0 compatibility library currently has only one dependency on libswiftCore.dylib, but that's not necessarily going to be the case going forward, especially if we have to back-deploy more significant fixes.

@mikeash
Copy link
Contributor Author

mikeash commented Sep 14, 2019

The hooks do indeed work when the runtime is dlopened. As for when this comes up, xctest needs to link this library so tests can benefit from the fixes. The hooks only work in the main executable, so linking them into the test bundle wouldn’t work.

Scaling this up would get messy but I’m not sure if there’s a better way. I’m certainly open to suggestions in any case.

This is the only dependency it has on libswiftCore. Looking this up at runtime allows its use in programs that don't link libswiftCore but might eventually load and run Swift code, such as xctest.

While we're in there, enable tests in files ending with `.c`.

rdar://problem/55274114
@mikeash
Copy link
Contributor Author

mikeash commented Oct 10, 2019

@swift-ci please test

@mikeash mikeash merged commit efa3139 into swiftlang:master Oct 10, 2019
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.

3 participants