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

[SR-10986] clang modules are not uniqued if multiple paths define them #53376

Closed
compnerd opened this issue Jun 20, 2019 · 4 comments
Closed
Labels
Android Platform: Android bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux Windows Platform: Windows

Comments

@compnerd
Copy link
Collaborator

Previous ID SR-10986
Radar None
Original Reporter @compnerd
Type Bug
Status Closed
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Android, ClangImporter, Linux, Windows
Assignee None
Priority Medium

md5: 79b836f684bc951b9a3f0f690bbb9bde

Issue Description:

When building Foundation with an installed libdispatch, the libdispatch module is loaded multiply and not uniqued resulting in clang complaining the module is defined multiple times.

@compnerd
Copy link
Collaborator Author

CC: @belkadan

@compnerd
Copy link
Collaborator Author

This will be lost over time, so just pasting the log here for posterity:

2019-06-20T18:14:19.7187852Z cmd.exe /C "cd /D D:\a\1\a oundation && swiftc -emit-library -resource-dir d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk/usr/lib/swift -Xcc --sysroot=C:/Microsoft/AndroidNDK64/android-ndk-r16b/sysroot -incremental -j 2 -target armv7-none-linux-androideabi -module-name Foundation -module-link-name Foundation -emit-module-path D:/a/1/a/foundation/swift/Foundation.swiftmodule -DDEPLOYMENT_RUNTIME_SWIFT -DDEPLOYMENT_ENABLE_LIBDISPATCH -I D:/a/1/a/icu-android-arm/ICU-64/usr/include -I d:\a\1\s\swift-corelibs-libdispatch -I d:\a\1\a\libdispatch/src/swift -Xcc -fblocks -enable-testing -O -Xcc -FD:/a/1/a/foundation -output-file-map D:/a/1/a/foundation/Foundation.dir/output-file-map.json -resource-dir d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk/usr/lib/swift -tools-directory C:/Microsoft/AndroidNDK64/android-ndk-r16b/toolchains/llvm/prebuilt/windows-x86_64/bin -Xclang-linker --gcc-toolchain=C:/Microsoft/AndroidNDK64/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -Xclang-linker --sysroot=C:/Microsoft/AndroidNDK64/android-ndk-r16b/platforms/android-21/arch-arm -Xclang-linker -fuse-ld=gold.exe -target armv7-none-linux-androideabi D:/a/1/a/foundation/CoreFoundation/libCoreFoundation.a -lD:/a/1/a/xml2-android-arm/libxml2-development/usr/lib/libxml2.a -llog -ldl -lm -ldispatch D:/a/1/a/icu-android-arm/ICU-64/usr/lib/libicuuc64.so D:/a/1/a/icu-android-arm/ICU-64/usr/lib/libicuin64.so D:/a/1/a/xml2-android-arm/libxml2-development/usr/lib/libxml2.a -L d:\a\1\a\libdispatch -L d:\a\1\a\libdispatch/src -ldispatch -lswiftDispatch -Xlinker -rpath -Xlinker d:\a\1\a\libdispatch/src D:/a/1/a/foundation/libuuid.a -Xlinker -rpath -Xlinker "\$ORIGIN" -o D:/a/1/a/foundation/Foundation.dir/libFoundation.so @D:/a/1/a/foundation/Foundation.dir/Foundation.rsp"
2019-06-20T18:14:19.7188655Z d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk\usr\lib\swift\dispatch\module.modulemap:1:8: error: redefinition of module 'Dispatch'
2019-06-20T18:14:19.7189189Z
2019-06-20T18:14:19.7189665Z module Dispatch {
2019-06-20T18:14:19.7189827Z
2019-06-20T18:14:19.7190139Z ^
2019-06-20T18:14:19.7190518Z
2019-06-20T18:14:19.7190921Z d:\a\1\s\swift-corelibs-libdispatch\dispatch\module.modulemap:1:8: note: previously defined here
2019-06-20T18:14:19.7191036Z
2019-06-20T18:14:19.7191525Z module Dispatch {
2019-06-20T18:14:19.7191607Z
2019-06-20T18:14:19.7192188Z ^
2019-06-20T18:14:19.7192432Z
2019-06-20T18:14:19.7192624Z d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk\usr\lib\swift\dispatch\module.modulemap:8:8: error: redefinition of module 'DispatchIntrospection'
2019-06-20T18:14:19.7192787Z
2019-06-20T18:14:19.7192975Z module DispatchIntrospection [system] [extern_c] {
2019-06-20T18:14:19.7193104Z
2019-06-20T18:14:19.7193245Z ^
2019-06-20T18:14:19.7193372Z
2019-06-20T18:14:19.7193542Z d:\a\1\s\swift-corelibs-libdispatch\dispatch\module.modulemap:8:8: note: previously defined here
2019-06-20T18:14:19.7195475Z
2019-06-20T18:14:19.7195840Z module DispatchIntrospection [system] [extern_c] {
2019-06-20T18:14:19.7196010Z
2019-06-20T18:14:19.7196163Z ^
2019-06-20T18:14:19.7196296Z
2019-06-20T18:14:19.7196478Z d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk\usr\lib\swift\dispatch\module.modulemap:13:8: error: redefinition of module 'CDispatch'
2019-06-20T18:14:19.7196617Z
2019-06-20T18:14:19.7196773Z module CDispatch [system] [extern_c] {
2019-06-20T18:14:19.7196907Z
2019-06-20T18:14:19.7197101Z ^
2019-06-20T18:14:19.7197233Z
2019-06-20T18:14:19.7197388Z d:\a\1\s\swift-corelibs-libdispatch\dispatch\module.modulemap:13:8: note: previously defined here
2019-06-20T18:14:19.7197560Z
2019-06-20T18:14:19.7197713Z module CDispatch [system] [extern_c] {
2019-06-20T18:14:19.7197845Z
2019-06-20T18:14:19.7199847Z ^
2019-06-20T18:14:19.7200103Z
2019-06-20T18:14:19.7200287Z D:/a/1/s/swift-corelibs-foundation/Foundation/FileManager+POSIX.swift:987:41: error: cannot convert value of type 'UInt64' to expected argument type 'dev_t' (aka 'UInt32')
2019-06-20T18:14:19.7200427Z
2019-06-20T18:14:19.7200661Z return _dev_major(file1.st_rdev) == _dev_major(file2.st_rdev)
2019-06-20T18:14:19.7200790Z
2019-06-20T18:14:19.7200936Z ~~~~~~^~~~~~~
2019-06-20T18:14:19.7201102Z
2019-06-20T18:14:19.7201245Z dev_t( )
2019-06-20T18:14:19.7201366Z
2019-06-20T18:14:19.7201516Z d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk\usr\lib\swift\dispatch\module.modulemap:1:8: error: redefinition of module 'Dispatch'
2019-06-20T18:14:19.7201848Z
2019-06-20T18:14:19.7201987Z module Dispatch {
2019-06-20T18:14:19.7202109Z
2019-06-20T18:14:19.7202256Z ^
2019-06-20T18:14:19.7202376Z
2019-06-20T18:14:19.7202548Z d:\a\1\s\swift-corelibs-libdispatch\dispatch\module.modulemap:1:8: note: previously defined here
2019-06-20T18:14:19.7202679Z
2019-06-20T18:14:19.7202844Z module Dispatch {
2019-06-20T18:14:19.7203177Z
2019-06-20T18:14:19.7203345Z ^
2019-06-20T18:14:19.7203467Z
2019-06-20T18:14:19.7203636Z d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk\usr\lib\swift\dispatch\module.modulemap:8:8: error: redefinition of module 'DispatchIntrospection'
2019-06-20T18:14:19.7203758Z
2019-06-20T18:14:19.7203895Z module DispatchIntrospection [system] [extern_c] {
2019-06-20T18:14:19.7204015Z
2019-06-20T18:14:19.7204165Z ^
2019-06-20T18:14:19.7204286Z
2019-06-20T18:14:19.7204566Z d:\a\1\s\swift-corelibs-libdispatch\dispatch\module.modulemap:8:8: note: previously defined here
2019-06-20T18:14:19.7204707Z
2019-06-20T18:14:19.7204868Z module DispatchIntrospection [system] [extern_c] {
2019-06-20T18:14:19.7205210Z
2019-06-20T18:14:19.7205654Z ^
2019-06-20T18:14:19.7205801Z
2019-06-20T18:14:19.7205968Z d:\a\1\a\Library\Developer\Platforms\Android.platform\Developer\SDKs\Android.sdk\usr\lib\swift\dispatch\module.modulemap:13:8: error: redefinition of module 'CDispatch'
2019-06-20T18:14:19.7206094Z
2019-06-20T18:14:19.7206237Z module CDispatch [system] [extern_c] {
2019-06-20T18:14:19.7206378Z
2019-06-20T18:14:19.7206514Z ^
2019-06-20T18:14:19.7206636Z
2019-06-20T18:14:19.7206796Z d:\a\1\s\swift-corelibs-libdispatch\dispatch\module.modulemap:13:8: note: previously defined here
2019-06-20T18:14:19.7206921Z
2019-06-20T18:14:19.7207062Z module CDispatch [system] [extern_c] {
2019-06-20T18:14:19.7207428Z
2019-06-20T18:14:19.7207778Z ^
2019-06-20T18:14:19.7208501Z

@belkadan
Copy link
Contributor

I think the Clang people have said that this is by design: unlike frameworks, modules found by include paths must be unique. :-/

@compnerd
Copy link
Collaborator Author

Ugh, okay, then we need to work around this in the build system :/

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Platform: Android bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

2 participants