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-5801] Inaccurate documentation of how to run swift-build #4956

Closed
swift-ci opened this issue Aug 30, 2017 · 1 comment
Closed

[SR-5801] Inaccurate documentation of how to run swift-build #4956

swift-ci opened this issue Aug 30, 2017 · 1 comment
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-5801
Radar None
Original Reporter gmilos (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 96f7d8c35f0e825d2bcbd6e43a64b04a

relates to:

  • SR-5467 The .build/debug symlink doesn't work for SwiftPM development

Issue Description:

SwiftPM Development.md states that the following should work:

$ cd /tmp && mkdir hello && cd hello

$ /path/to/swiftpm/.build/debug/swift-package init

$ /path/to/swiftpm/.build/debug/swift-build

However, in recent (yesterday's master) SwiftPM this fails with:

sbs:/tmp$
cd /tmp && mkdir hello && cd hello
sbs:/tmp/hello$
/tmp/swiftpm-proj/.build/debug/swift-package init
Creating library package: hello
Creating Package.swift
Creating README.md
Creating .gitignore
Creating Sources/
Creating Sources/hello/hello.swift
Creating Tests/
Creating Tests/LinuxMain.swift
Creating Tests/helloTests/
Creating Tests/helloTests/helloTests.swift
sbs:/tmp/hello$
/tmp/swiftpm-proj/.build/debug/swift-build
error: manifest parse error(s):
/tmp/hello/Package.swift:4:8: error: no such module 'PackageDescription'
import PackageDescription
^

This is because search paths are set in such a way, that `lib` dir is expected to be next to `debug`.

The following works:

sbs:/tmp/hello$
/tmp/swiftpm-proj/.build/x86_64-unknown-linux/debug/swift-build
Compile Swift Module 'hello' (1 sources)

Or, likely better solution:

sbs:/tmp/libtest (master)$
cd /tmp/swiftpm-proj/.build/
sbs:/tmp/swiftpm-proj/.build (emit-library-instead-of-x-linker-shared)$
ln -s /tmp/swiftpm-proj/.build/.bootstrap/lib

sbs:/tmp/swiftpm-proj/.build (emit-library-instead-of-x-linker-shared)$
cd /tmp/hello/

sbs:/tmp/hello$
/tmp/swiftpm-proj/.build/debug/swift-build
Compile Swift Module 'hello' (1 sources)

@ankitspd
Copy link
Member

#1331

@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

2 participants