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-947] Confusing error with swiftc if -o argument is directory #43559

Open
swift-ci opened this issue Mar 15, 2016 · 3 comments
Open

[SR-947] Confusing error with swiftc if -o argument is directory #43559

swift-ci opened this issue Mar 15, 2016 · 3 comments
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-947
Radar rdar://problem/15975285
Original Reporter dbokser (JIRA User)
Type Improvement

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Driver
Assignee None
Priority Medium

md5: 353e17676ab0f8589148ea7012e37ce2

is duplicated by:

Issue Description:

If the the directory "test" exists and the following command is run:

swiftc test.swift

or more explicitly:
swiftc test.swift -o test

Then this error is outputted:
ld: can't open output file for writing: test, errno=21 for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

(Note: -v doesn't provide anything helpful). It was only after Googling that I discovered that errno 21 is already existing directory.

It would be nice to have a better error message like "Cannot create executable `test` because directory `test` already exists."

@belkadan
Copy link
Contributor

The other option would be to use the same inferred name we would have used (the module name or "main"), but to put the output in the specified directory.

@modocache
Copy link
Mannequin

modocache mannequin commented Nov 18, 2016

This issue could be considered a subset of https://bugs.swift.org/browse/SR-2399. Maybe we should merge the two?

@belkadan
Copy link
Contributor

Good call, marked that as a dup.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the feature A feature request or implementation label Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself feature A feature request or implementation improvement legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Projects
None yet
Development

No branches or pull requests

3 participants