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-5800] Ubuntu 14.04 with upgraded clang requires swiftdoc file to import a module #48370

Open
ankitspd opened this issue Aug 30, 2017 · 8 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself Linux Platform: Linux serialization Area → compiler: Serialization & deserialization

Comments

@ankitspd
Copy link
Member

Previous ID SR-5800
Radar rdar://problem/34188554
Original Reporter @aciidb0mb3r
Type Bug
Environment

swift-DEVELOPMENT-SNAPSHOT-2017-08-21-a-ubuntu14.04

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, Linux, Serialization
Assignee None
Priority Medium

md5: 741e76216c715a881c7f217db42ea78c

Issue Description:

Importing a module without its swiftdoc fails on Ubuntu 14.04 if clang is updated using apt-get. This doesn't happen on macOS or Ubuntu 16.04. This is what I did:

sudo apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main"
sudo apt-get update
sudo apt-get install clang-3.8
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 380
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 380

This works on all platform:

touch hello.swift
echo "import hello" > main.swift
swiftc -module-name hello -emit-module -parse-as-library -c hello.swift
swiftc -I. main.swift 

This fails on Ubuntu 14.04 with clang from apt-get but works on Ubuntu 16.04/macOS:

rm -rf hello.swiftdoc
swiftc -I. main.swift 
main.swift:1:8: error: no such module 'hello'
import hello
       ^

The Package Manager does not ship swiftdoc file for the PackageDescription module in the toolchain, should it start doing so? What about the existing toolchains?

https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20170828/006111.html

@belkadan
Copy link
Contributor

1. It shouldn't fail.
2. But you should be shipping the swiftdocs, because they have the doc comments.

@belkadan
Copy link
Contributor

I can't see what this would have to do with the updated Clang, though.

@ankitspd
Copy link
Member Author

I don't know why we never shipped doc file. @ddunbar is there a reason or should we just start doing that?

@ddunbar
Copy link
Member

ddunbar commented Aug 30, 2017

No good reason, let's start. Still seems like it might be worth understanding why this fails.

@belkadan
Copy link
Contributor

Yep, would like to keep the bug open. Need to get my hands on a 14.04 system, though.

@ankitspd
Copy link
Member Author

I used this image on vmware: http://releases.ubuntu.com/14.04/ubuntu-14.04.5-server-amd64.iso
Let me know if I can provide any other information. This could be very annoying for Swift 4 users on release.

@ankitspd
Copy link
Member Author

Filed https://bugs.swift.org/browse/SR-5802 for the package manager.

@belkadan
Copy link
Contributor

@swift-ci create

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

No branches or pull requests

3 participants