[SR-947] Confusing error with swiftc if -o argument is directory #43559
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
Attachment: Download
Additional Detail from JIRA
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."
The text was updated successfully, but these errors were encountered: