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
[SR-5524] Importing a modulemapped C library in REPL throws an error #4626
Comments
Comment by Matthias M. Schneider (JIRA) Temporary fixesMissing read permissions for include filesCheck the permissions of all include files in your Swift installation directory. They must have the read-flag set for group and other access. You can set the permissions using this command: sudo find /opt/swift/ -name "*.h" ! -perm -go=r -exec chmod go+r "{}" \; where Location of header filesUsing ltrace I could track down the problem to locating missing header files which reside in Extending the command lineCalling Swift REPL with the following command line options will actually work for versions 3.1.1 and 4.0.0:
Adding the include path permanentlyTo add the required include files permanently without the need to add the search path to the
You can add the following lines to your export C_INCLUDE_PATH=/opt/swift/usr/lib/swift/clang/include/
export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH |
That workaround works only on REPL an lldb.
|
Comment by Matthias M. Schneider (JIRA) @norio-nomura: Thanks for the feedback. In this case of symbol redefinitions in module maps one could suggest that you specify the Again, this is more like fighting the symptoms with YAW (yet another workaround 😉 ) than a real solution. For more information on using module maps with clang, please see clang module map command line parameters. |
Attachment: Download
Environment
Ubuntu Linux 16.04 LTS, Swift 3.1.1, Swift 4.0.0-dev
Additional Detail from JIRA
md5: 4ca55ff9257afe4db0384f0c0979d411
relates to:
Issue Description:
A Swift package of type system-module throws an error when trying to import in REPL.
Swift 3.1.1
Swift 4.0.0-dev
Module definition for Clibssh
The following sources were used to produce the system module for using libssh.so in Swift.
Package definition for the module
Module map definition
Note 1: Importing the module in Swift 3.0.1 REPL works fine.
Note 2: Building an executable file with this module definition works flawlessly in Swift 3.1.1 and Swift 4.0.0
I'm linking this issue to SR-3794, SR-3648 and SR-2783 as it seems there are some similarities.
The text was updated successfully, but these errors were encountered: