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-1861] Swift build crashes C Modulemap packages #5361

Closed
swift-ci opened this issue Jun 21, 2016 · 5 comments
Closed

[SR-1861] Swift build crashes C Modulemap packages #5361

swift-ci opened this issue Jun 21, 2016 · 5 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-1861
Radar None
Original Reporter dan (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Tested with the 05-09 and 06-06 snapshots, along with the Xcode 8.0 Swift preview. Can reproduce on all of them. Also fails on Linux (tested in a Ubuntu 14.04 docker container).

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: c01e64dbf76dcd9e984ed6534fa107bb

duplicates:

  • SR-1453 Improve error messages when building invalid packages

Issue Description:

Steps to reproduce:

git clone https://github.com/Zewo/CLibpq && cd CLibpq
swift build

Output:

<unknown>:0: error: unexpected 'commands' value (expected map)
<unknown>:0: error: unable to load build file
error: exit(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a.xctoolchain/usr/bin/swift-build-tool -f /Users/dan/Developer/projects/Zewo/Development/CLibpq/.build/debug.yaml

Breaks with other similar-style c packages as well ([Clibbson](https://github.com/danappelxx/clibbson), [CMysql](https://github.com/zewo/cmysql)); but doesn't break with packages that have C sources ([CLibvenice](https://github.com/venicex/clibvenice), [CHTTPParser](https://github.com/zewo/chttpparser)).

@swift-ci
Copy link
Contributor Author

Comment by Dan Appel (JIRA)

We discussed this a little bit in the SPM slack and found that building these packages standalone is not really supported yet. Hence, the solution here would be to add the functionality to build C modulemap packages. In my opinion, the expected behavior in this case would be to test the modulemap's validity by making a dummy swift module and attempting to import the c module in it, which would then throw errors regarding headers and linking if they were to arise.

@ddunbar
Copy link
Member

ddunbar commented Jun 22, 2016

I agree with Dan it would be awesome to test the module map validity in this case... In the shorter term we should at least not fail with a confusing error message

@Bouke
Copy link
Contributor

Bouke commented Jul 1, 2016

Added a PR for improving the error message: #462

@Bouke
Copy link
Contributor

Bouke commented Jul 13, 2016

The PR for better error message has been merged.

@ankitspd
Copy link
Member

ankitspd commented Aug 2, 2016

Fixed by #462

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants