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-8828] Swift arguments file doesn't support sources with spaces #51336

Closed
keith opened this issue Sep 24, 2018 · 3 comments
Closed

[SR-8828] Swift arguments file doesn't support sources with spaces #51336

keith opened this issue Sep 24, 2018 · 3 comments

Comments

@keith
Copy link
Collaborator

@keith keith commented Sep 24, 2018

Previous ID SR-8828
Radar rdar://44142091
Original Reporter @keith
Type Bug
Status Resolved
Resolution Done
Environment

Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
Target: x86_64-apple-darwin17.7.0

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

md5: d1e550194ff868538e7ca9c954cb325b

Issue Description:

If you provide Swift with a file to use as the arguments, file paths with spaces are not correctly handled. Example:

touch "foo bar.swift"
echo "foo bar.swift" > arguments.txt
swiftc @arguments.txt
<unknown>:0: error: no such file or directory: 'bar.swift'

I assume since there is an argument per line these files should correctly handle spaces?

Original change #16362

@keith
Copy link
Collaborator Author

@keith keith commented Sep 24, 2018

It actually looks like clang doesn't support this either, so maybe this is an intentional limitation

@allevato
Copy link
Collaborator

@allevato allevato commented Sep 24, 2018

Swift and Clang share the same command line parsing code (it comes from the LLVM code base), so the behavior should be identical in both. (There was a minor difference relating to how the driver passes arguments to the front-end <https://github.com/apple/swift/pull/19321\>, but I don't believe that applies to your example.)

In your example, AFAIK the filename needs to be quoted in the response file itself in order for the parser to understand that "foo bar.txt" is supposed to be treated as a single argument instead of two arguments.

@belkadan
Copy link
Contributor

@belkadan belkadan commented Sep 25, 2018

Yep. davidungar (JIRA User) fixed this in #19314 and brought it into the 4.2 branch in #19321

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

No branches or pull requests

3 participants