apple / swift-corelibs-libdispatch

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware
swift.org
Apache License 2.0
2.44k stars 455 forks source link

[SR-9080] <unknown>:0: error: cannot load underlying module for 'Dispatch' #642

Open shahmishal opened 5 years ago

shahmishal commented 5 years ago
Previous ID SR-9080
Radar rdar://problem/45553764
Original Reporter @shahmishal
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | libdispatch | |Labels | Bug | |Assignee | None | |Priority | Medium | Watchers: @shahmishal md5: 8fe1536412bd991aed5ede4f770cccb4

Issue Description:

Error:

<unknown>:0: error: cannot load underlying module for 'Dispatch'

Last successful tag: swift-DEVELOPMENT-SNAPSHOT-2018-10-01-a

First failing tag: swift-DEVELOPMENT-SNAPSHOT-2018-10-19-a

git log --pretty=oneline swift-DEVELOPMENT-SNAPSHOT-2018-10-01-a...swift-DEVELOPMENT-SNAPSHOT-2018-10-19-a

425 commits between two tags.

https://ci.swift.org/job/swift-protobuf-linux-ubuntu-16_04/730/console

shahmishal commented 5 years ago

cc/ @compnerd @benlangmuir @aciidb0mb3r

shahmishal commented 5 years ago

These commits might be interesting to look at:

98ceebe6e8e98be2d396aa8a36e37fb39a8adacd Add dependency on the libdispatch-install step
8d7a26c71109402ebd34207ab3721186cae28e2d [silgenpattern] Unconditionally use the +0 code path to emit enum element dispatch on loadable enum types
c1f17f00c27979a0ccddcbc1c387bda2746f5623 Changed the external project build for libdispatch in tools/SourceKit to use the just-build clang and clang++ rather than the system versions (rdar://45148295). (#19845)
42af92112c463c6b59551a77432993202dccc7e6 Make _swift_dispatch_block_create_with_qos_class NS_RETURNS_RETAINED
b99a0f4af5e30861a117a6f7c93b82d8a95f3497 build: use the exported config for libdispatch
0295a83237f508f7eece78bde1fe0195fdb1fa7f SourceKit: re-package libdispatch, BlocksRuntime
daabc237fa907609401391309b69686acc8df444 SourceKit: libdispatch swift requires swift stdlib
shahmishal commented 5 years ago

Info provided by @aciidb0mb3r

the dispatch modulemap is missing:

root@d1fa04c6e0d3:/toolchain/usr/lib/swift/dispatch# ls -l
total 208
-rwxrwxrwx 1 root root  8155 Oct 24 13:53 base.h
-rwxrwxrwx 1 root root 17651 Oct 24 13:53 block.h
lrwxrwxrwx 1 root root   131 Oct 24 14:57 module.modulemap -> /home/buildnode/jenkins/workspace/oss-swift-package-linux-ubuntu-16_04/swift-corelibs-libdispatch/dispatch/generic/module.modulemap 
compnerd commented 5 years ago

Interesting. Seems like we are install the the module.modulemap but it is a symlink? Should be possible to adjust the install rules to dereference before installation. Is there an easy way to test this locally?

aciidgh commented 5 years ago

I built the toolchain locally but it didn't install a symlink so it is very puzzling why its happening on the CI. I used this invocation:

./swift/utils/build-script --assertions --no-swift-stdlib-assertions --swift-enable-ast-verifier=0 --llbuild --swiftpm --xctest --build-ninja --install-swift --install-lldb --install-llbuild --install-swiftpm --install-xctest --install-prefix=/usr '--swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc' '--llvm-install-components=llvm-cov;llvm-profdata' --build-swift-static-stdlib --build-swift-static-sdk-overlay --install-destdir=/tmp/swift-nightly-install --installable-package=/tmp/swift-DEVELOPMENT-SNAPSHOT-2018-10-27-a-ubuntu16.04.tar.gz --build-subdir=buildbot_linux --lldb --release --foundation --libdispatch --lit-args=-v --install-foundation --install-libdispatch --reconfigure
compnerd commented 5 years ago

https://github.com/apple/swift-corelibs-libdispatch/pull/412 should address the issue ... @aciidb0mb3r perhaps we should just build a toolchain on CI with that patch?

aciidgh commented 5 years ago

Yes, that would be the best way to test if the patch works or not.

gottesmm commented 5 years ago

Looks like dispatch needs an update since it doesn't use a build-preset. I am preparing a new build-preset for it.

gottesmm commented 5 years ago

https://github.com/apple/swift/pull/20109

gottesmm commented 5 years ago

@shahmishal once this lands, can you change dispatch to use this instead of using a hard coded build script line?