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-8139] Executable init template is broken when there is a dash in package name #4774

Closed
ankitspd opened this issue Jun 28, 2018 · 3 comments
Labels

Comments

@ankitspd
Copy link
Member

Previous ID SR-8139
Radar rdar://problem/41495606
Original Reporter @aciidb0mb3r
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug, StarterBug
Assignee None
Priority Medium

md5: b562053905e304d47bcc8b64d7e9d829

Issue Description:

Recent Swift package manager doesn't like projects with dashes.

Steps To Reproduce:

1. (set -e; rm -rf foo-bar; mkdir foo-bar; cd foo-bar; swift package init --type executable && swift test)

Results:

swift test couldn't find `foo_bar` executable, whereas `foo-bar` executable got built.

@swift-ci
Copy link
Contributor

Comment by Jhonny Bill Mena (JIRA)

I "fixed" by just changing in writeExecutableTestsFile function

let fooBinary = productsDirectory.appendingPathComponent("\(moduleName)")

to

let fooBinary = productsDirectory.appendingPathComponent("\(pkgname)")

All tests passed. I don't know if this change brings further consequences, can anyone tell?

@ankitspd
Copy link
Member Author

Yep, that is the correct fix. Please create a PR with a test case.

@swift-ci
Copy link
Contributor

Comment by Jhonny Bill Mena (JIRA)

#1697

@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