Skip to content
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

Shared library lookup path is not setup for Swift #75

Closed
helje5 opened this issue May 11, 2017 · 7 comments
Closed

Shared library lookup path is not setup for Swift #75

helje5 opened this issue May 11, 2017 · 7 comments

Comments

@helje5
Copy link

helje5 commented May 11, 2017

When you try to run a Swift binary which is linked dynamically, it won't find the Swift shared libraries in the current Docker image.

You may want to add this:

RUN bash -c "echo '/usr/lib/swift/linux' > /etc/ld.so.conf.d/swift.conf;\
             echo '/usr/lib/swift/clang/lib/linux' >> /etc/ld.so.conf.d/swift.conf;\
             echo '/usr/lib/swift/pm' >> /etc/ld.so.conf.d/swift.conf;\
             ldconfig"
@swizzlr
Copy link
Contributor

swizzlr commented Nov 10, 2017

@helje5 Just following up: what exactly is needed here? I've used dynamic libs, I think, in the Swift docker image and have had no problems. What are these search paths providing us with?

(n.b. I have no objection to this, I just want to understand more before proceeding.)

@helje5
Copy link
Author

helje5 commented Nov 10, 2017

Let me retry with the current image, not sure yet when I find the time. I think the issue was that the Swift shared libraries are located in the (non-standard) paths above and hence cannot be located by ld.so when running such a program.

@swizzlr
Copy link
Contributor

swizzlr commented Nov 10, 2017

@helje5 Are you trying to link your compiled program against the Swift package manager, etc.?

@helje5
Copy link
Author

helje5 commented Nov 11, 2017

No, just against Dispatch, Foundation and such. The basics.

@helje5
Copy link
Author

helje5 commented Nov 11, 2017

I don't remember what exactly I was doing. Need to review what I did and what didn't work. But I think if you compile a Swift with plain swiftc, it'll pickup the .so's and then won't run. Or sth like this, not sure.

@swizzlr
Copy link
Contributor

swizzlr commented Nov 11, 2017

no worries, let us know what we can do to help if the need remains with the latest version.

@shahmishal
Copy link
Member

@helje5 We are moving Swift Docker issues to https://bugs.swift.org Component: Docker. Can you please file your issue on bugs.swift.org?

We are planning on closing GitHub swift-docker issues on Dec 20th, 2018 (PST).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants