Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Trace of Linux Swift trying to open SwiftShims.swiftmodule
# strace -s 80 -o /tmp/swift.log -- swift <(echo '1 + 1') ; fgrep -C 40 'opening import' /tmp/swift.log
# <unknown>:0: error: opening import file for module 'SwiftShims': No such file or directory
stat("/usr/local/lib/swift/clang/include", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/local/include", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/local/usr/include", 0x7ffe1f9c52c0) = -1 ENOENT (No such file or directory)
stat("/usr/local/usr", 0x7ffe1f9c51d0) = -1 ENOENT (No such file or directory)
open("/usr/local/System/Library/CoreServices/SystemVersion.plist", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/tmp/org.llvm.clang.root/ModuleCache/modules.timestamp", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
brk(0x6481000) = 0x6481000
mmap(NULL, 176128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f37d78d0000
brk(0x64a3000) = 0x64a3000
brk(0x64c4000) = 0x64c4000
open("/dev/fd/63", O_RDONLY) = 3
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
read(3, "1 + 1\n", 16384) = 6
read(3, "", 16384) = 0
close(3) = 0
open("/usr/local/lib/swift/linux/x86_64/Swift.swiftmodule", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=17434920, ...}) = 0
mmap(NULL, 17434920, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f37d4bbb000
close(3) = 0
open("/usr/local/lib/swift/linux/x86_64/Swift.swiftdoc", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=672196, ...}) = 0
mmap(NULL, 672196, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f37d782b000
close(3) = 0
brk(0x64f7000) = 0x64f7000
brk(0x64ed000) = 0x64ed000
brk(0x6520000) = 0x6520000
mmap(NULL, 331776, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f37d77da000
mremap(0x7f37d77da000, 331776, 659456, MREMAP_MAYMOVE) = 0x7f37d7739000
mmap(NULL, 385024, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f37d4b5d000
munmap(0x7f37d7739000, 659456) = 0
open("/usr/local/lib/swift/linux/x86_64/SwiftShims.swiftmodule", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "\33[1m", 4) = 4
write(2, "<unknown>", 9) = 9
write(2, ":", 1) = 1
write(2, "0", 1) = 1
write(2, ": ", 2) = 2
write(2, "\33[0;1;31m", 9) = 9
write(2, "error: ", 7) = 7
write(2, "\33[0m", 4) = 4
write(2, "\33[1m", 4) = 4
write(2, "opening import file for module 'SwiftShims': No such file or directory", 70) = 70
write(2, "\n", 1) = 1
write(2, "\33[0m", 4) = 4
stat("/usr/local/lib/swift/module.modulemap", 0x7ffe1f9c4aa0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/swift/module.map", 0x7ffe1f9c4aa0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/swift/SwiftShims", 0x7ffe1f9c4d10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/swift", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 8 entries */, 32768) = 240
stat("/usr/local/lib/swift/shims", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/local/lib/swift/shims/module.modulemap", 0x7ffe1f9c4970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/swift/shims/module.map", {st_mode=S_IFREG|0644, st_size=319, ...}) = 0
open("/usr/local/lib/swift/shims/module.map", O_RDONLY) = 4
pread(4, "module SwiftShims {\n header \"CoreFoundationShims.h\"\n header \"FoundationShims.h"..., 319, 0) = 319
close(4) = 0
stat("/usr/local/lib/swift/shims/CoreFoundationShims.h", {st_mode=S_IFREG|0644, st_size=3856, ...}) = 0
stat("/usr/local/lib/swift/shims/FoundationShims.h", {st_mode=S_IFREG|0644, st_size=2014, ...}) = 0
stat("/usr/local/lib/swift/shims/GlobalObjects.h", {st_mode=S_IFREG|0644, st_size=1365, ...}) = 0
stat("/usr/local/lib/swift/shims/HeapObject.h", {st_mode=S_IFREG|0644, st_size=1840, ...}) = 0
stat("/usr/local/lib/swift/shims/LibcShims.h", {st_mode=S_IFREG|0644, st_size=2046, ...}) = 0
stat("/usr/local/lib/swift/shims/RefCount.h", {st_mode=S_IFREG|0644, st_size=13099, ...}) = 0
stat("/usr/local/lib/swift/shims/RuntimeShims.h", {st_mode=S_IFREG|0644, st_size=2413, ...}) = 0
stat("/usr/local/lib/swift/shims/RuntimeStubs.h", {st_mode=S_IFREG|0644, st_size=977, ...}) = 0
stat("/usr/local/lib/swift/shims/SwiftStddef.h", {st_mode=S_IFREG|0644, st_size=687, ...}) = 0
stat("/usr/local/lib/swift/shims/SwiftStdint.h", {st_mode=S_IFREG|0644, st_size=1964, ...}) = 0
stat("/usr/local/lib/swift/shims/UnicodeShims.h", {st_mode=S_IFREG|0644, st_size=2813, ...}) = 0
stat("/usr/local/lib/swift/shims/module_private.map", 0x7ffe1f9c4960) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/swift/glibc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/local/lib/swift/glibc/module.modulemap", 0x7ffe1f9c4970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/swift/glibc/module.map", {st_mode=S_IFREG|0644, st_size=8178, ...}) = 0
open("/usr/local/lib/swift/glibc/module.map", O_RDONLY) = 4
pread(4, "//===--- module.map -------------------------------------------------------===//"..., 8178, 0) = 8178
close(4) = 0
stat("/usr/include", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/include/complex.h", {st_mode=S_IFREG|0644, st_size=3646, ...}) = 0
stat("/usr/include/ctype.h", {st_mode=S_IFREG|0644, st_size=11748, ...}) = 0
stat("/usr/include/errno.h", {st_mode=S_IFREG|0644, st_size=2367, ...}) = 0
stat("/usr/include/features.h", {st_mode=S_IFREG|0644, st_size=12985, ...}) = 0
stat("/usr/include/fenv.h", {st_mode=S_IFREG|0644, st_size=4590, ...}) = 0
stat("/usr/include/inttypes.h", {st_mode=S_IFREG|0644, st_size=11892, ...}) = 0
stat("/usr/include/locale.h", {st_mode=S_IFREG|0644, st_size=7941, ...}) = 0
stat("/usr/include/math.h", {st_mode=S_IFREG|0644, st_size=16476, ...}) = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment