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-3794] import Glibc does not work from the swift 3.1-dev REPL #4642
Comments
Does this also fail when trying to compile a file, or is it just the REPL? |
(This failure usually means the clang/ folder inside Swift's resource dir—usually lib/swift/—is missing.) |
Comment by Peter (JIRA) For me it works when I compile a file, but fails in the REPL. |
Comment by Peter (JIRA) This was actually reported by Chris Double in December 2016: https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20161219/004206.html He wrote: ---------------~~~~8<~~~~---------------- If I explicitly pass include paths to 'swift' it works in the REPL: ---------------~~~~8<~~~~---------------- |
Okay, retagging as LLDB. |
@belkadan Whatever we should do, we should see why the integration tests did not catch this. The integration tests before we send out the package is supposed to run something in the repl. Maybe it is running it in the old repl? |
jingham@apple.com (JIRA User), who should be looking at this? |
Comment by Hugh Bellamy (JIRA) I'n getting a similar error here: apple/swift#7490 |
I'm experiencing a similar error with current master on Arch Linux. Importing Foundation or Dispatch fails unless I pass |
Comment by Peter (JIRA) I tried the newly released swift 3.1 and the problem is still present. |
Comment by Timothy S Hawkins (JIRA) I am getting the same issue on Fedora 25, however i can move on by adding the symlink cd /usr/include However when I do that I subsequently get the following, This worked fine on swift-3.0.2-RELEASE tag, it only fails on swift-3.1-RELEASE [thawkins@timdev05 bin]$ ./swift ///usr/include/pty.h:28:10: note: in file included from ///usr/include/pty.h:28: /usr/include/sys/ioctl.h:29:10: note: in file included from /usr/include/sys/ioctl.h:29: error: /usr/include/bits/ioctl-types.h:27:8: error: redefinition of 'winsize' /usr/include/asm-generic/termios.h:14:8: note: previous definition is here <module-includes>:2:10: note: in file included from <module-includes>:2: ///usr/include/pty.h:28:10: note: in file included from ///usr/include/pty.h:28: /usr/include/sys/ioctl.h:29:10: note: in file included from /usr/include/sys/ioctl.h:29: error: /usr/include/bits/ioctl-types.h:36:8: error: redefinition of 'termio' /usr/include/asm-generic/termios.h:22:8: note: previous definition is here <module-includes>:3:10: note: in file included from <module-includes>:3: ///usr/include/utmp.h:23:10: note: in file included from ///usr/include/utmp.h:23: /usr/include/sys/types.h:219:11: note: in file included from /usr/include/sys/types.h:219:
/usr/include/sys/select.h:47:10: note: in file included from /usr/include/sys/select.h:47: error: /usr/include/bits/time.h:30:8: error: redefinition of 'timeval' /usr/include/x86_64-linux-gnu/time.h:15:8: note: previous definition is here <module-includes>:3:10: note: in file included from <module-includes>:3: ///usr/include/utmp.h:29:10: note: in file included from ///usr/include/utmp.h:29: /usr/include/bits/utmp.h:24:10: note: in file included from /usr/include/bits/utmp.h:24: error: /usr/include/sys/time.h:55:8: error: redefinition of 'timezone' /usr/include/x86_64-linux-gnu/time.h:20:8: note: previous definition is here <module-includes>:3:10: note: in file included from <module-includes>:3: ///usr/include/utmp.h:29:10: note: in file included from ///usr/include/utmp.h:29: /usr/include/bits/utmp.h:24:10: note: in file included from /usr/include/bits/utmp.h:24: error: /usr/include/sys/time.h:94:5: error: expected identifier /usr/include/x86_64-linux-gnu/time.h:30:22: note: expanded from macro 'ITIMER_REAL' <module-includes>:3:10: note: in file included from <module-includes>:3: ///usr/include/utmp.h:29:10: note: in file included from ///usr/include/utmp.h:29: /usr/include/bits/utmp.h:24:10: note: in file included from /usr/include/bits/utmp.h:24: error: /usr/include/sys/time.h:97:5: error: expected identifier /usr/include/x86_64-linux-gnu/time.h:31:25: note: expanded from macro 'ITIMER_VIRTUAL' <module-includes>:3:10: note: in file included from <module-includes>:3: ///usr/include/utmp.h:29:10: note: in file included from ///usr/include/utmp.h:29: /usr/include/bits/utmp.h:24:10: note: in file included from /usr/include/bits/utmp.h:24: error: /usr/include/sys/time.h:101:5: error: expected identifier /usr/include/x86_64-linux-gnu/time.h:32:22: note: expanded from macro 'ITIMER_PROF' <module-includes>:3:10: note: in file included from <module-includes>:3: ///usr/include/utmp.h:29:10: note: in file included from ///usr/include/utmp.h:29: /usr/include/bits/utmp.h:24:10: note: in file included from /usr/include/bits/utmp.h:24: error: /usr/include/sys/time.h:107:8: error: redefinition of 'itimerval' /usr/include/x86_64-linux-gnu/time.h:39:8: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:323:11: note: in file included from ///usr/include/signal.h:323:
error: /usr/include/bits/sigstack.h:53:5: error: unknown type name 'size_t'; did you mean 'ssize_t'? /usr/include/sys/types.h:109:19: note: 'ssize_t' declared here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:4:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:4: error: /usr/include/asm/signal.h:15:23: error: typedef redefinition with different types ('unsigned long' vs '__sigset_t') /usr/include/sys/select.h:37:20: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:4:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:4: error: /usr/include/asm/signal.h:114:8: error: redefinition of 'sigaction' /usr/include/bits/sigaction.h:24:8: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:4:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:4: error: /usr/include/asm/signal.h:115:17: error: expected ';' at end of declaration list /usr/include/bits/sigaction.h:36:40: note: expanded from macro 'sa_handler'
<module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:4:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:4: error: /usr/include/asm/signal.h:123:16: error: redefinition of 'sigaltstack' /usr/include/bits/sigstack.h:49:16: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:4:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:4: error: /usr/include/asm/signal.h:126:2: error: unknown type name 'size_t'; did you mean 'ssize_t'? /usr/include/sys/types.h:109:19: note: 'ssize_t' declared here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:4:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:4: error: /usr/include/asm/signal.h:127:3: error: typedef redefinition with different types ('struct (anonymous struct at /usr/include/asm/signal.h:123:16)' vs 'struct sigaltstack') /usr/include/bits/sigstack.h:54:5: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:5:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:5: /usr/include/asm/siginfo.h:14:10: note: in file included from /usr/include/asm/siginfo.h:14: error: /usr/include/asm-generic/siginfo.h:7:15: error: redefinition of 'sigval' /usr/include/bits/siginfo.h:32:15: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:5:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:5: /usr/include/asm/siginfo.h:14:10: note: in file included from /usr/include/asm/siginfo.h:14: error: /usr/include/asm-generic/siginfo.h:10:3: error: typedef redefinition with different types ('union (anonymous union at /usr/include/asm-generic/siginfo.h:7:15)' vs 'union sigval') /usr/include/bits/siginfo.h:36:5: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:5:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:5: /usr/include/asm/siginfo.h:14:10: note: in file included from /usr/include/asm/siginfo.h:14: error: /usr/include/asm-generic/siginfo.h:118:24: error: typedef redefinition with different types ('struct siginfo' vs 'struct siginfo_t') /usr/include/bits/siginfo.h:133:5: note: previous definition is here <module-includes>:12:10: note: in file included from <module-includes>:12: ///usr/include/signal.h:326:12: note: in file included from ///usr/include/signal.h:326:
/usr/include/sys/ucontext.h:22:10: note: in file included from /usr/include/sys/ucontext.h:22: /usr/include/x86_64-linux-gnu/signal.h:5:10: note: in file included from /usr/include/x86_64-linux-gnu/signal.h:5: /usr/include/asm/siginfo.h:14:10: note: in file included from /usr/include/asm/siginfo.h:14: error: /usr/include/asm-generic/siginfo.h:290:16: error: redefinition of 'sigevent' /usr/include/bits/siginfo.h:320:16: note: previous definition is here error: too many errors emitted, stopping now |
Comment by Hugh Bellamy (JIRA) Feel like submitting a PR to add this to the CMake build? |
Comment by Ryan Lovelett (JIRA) This is also effecting |
Comment by Rick M (JIRA) This was affecting me on Ubuntu 16.04, importing Glibc, in the swift repl. It does not seem to affect |
Comment by Vivian Kong (JIRA) I saw the same error in REPL on Linux on s390x (it used to work in 3.0.2). The workaround mentioned above allows me to import Glibc but I can't import Foundation/Dispatch etc. Any ideas on what might be the problem? Thanks. $ ./swift -I/home/tester/swift31/install/usr/lib/swift/clang/include 2> import Dispatch |
Comment by Matthias M. Schneider (JIRA) Please see the comment on issue SR-5524 for a possible temporary fix. |
This seems to work with a recent lldb ./build/Ninja-ReleaseAssert/lldb-linux-x86_64/bin/lldb --repl
Welcome to Swift version 5.1.1-dev (LLVM 7ade6a3e01, Swift cc60f2c351).
Type :help for assistance.
1> import Glibc
2> Please try again and let us know! |
Environment
Ubuntu 16.10
swift -v
Swift version 3.1-dev (LLVM 3e67f314a4, Clang 0540ceb7ad, Swift ca7046e)
Target: x86_64-unknown-linux-gnu
/home/peter/Documents/programs/swift/swift-DEVELOPMENT-SNAPSHOT-2017-01-04-a-ubuntu16.10/usr/bin/lldb "--repl=-disable-objc-interop -color-diagnostics"
Welcome to Swift version 3.1-dev (LLVM 3e67f314a4, Clang 0540ceb7ad, Swift ca7046e).
Additional Detail from JIRA
md5: 68542641f5966ad72f7a08689e36c7b3
is duplicated by:
relates to:
Issue Description:
I get the following error when I try to import Glibc in the swift 3.1-dev REPL
peter@peter-UX305CA:~/Documents/dev/swift/measurement$ swift -v
Swift version 3.1-dev (LLVM 3e67f314a4, Clang 0540ceb7ad, Swift ca7046e)
Target: x86_64-unknown-linux-gnu
/home/peter/Documents/programs/swift/swift-DEVELOPMENT-SNAPSHOT-2017-01-04-a-ubuntu16.10/usr/bin/lldb "--repl=-disable-objc-interop -color-diagnostics"
Welcome to Swift version 3.1-dev (LLVM 3e67f314a4, Clang 0540ceb7ad, Swift ca7046e). Type :help for assistance.
1> import Glibc
<module-includes>:3:10: note: in file included from <module-includes>:3:
#include "///usr/include/utmp.h"
^
///usr/include/utmp.h:23:10: note: in file included from ///usr/include/utmp.h:23:
#include <sys/types.h>
^
error: /usr/include/x86_64-linux-gnu/sys/types.h:146:10: error: 'stddef.h' file not found
#include <stddef.h>
^
error: could not build Objective-C module 'SwiftGlibc'
1>
The text was updated successfully, but these errors were encountered: