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-4517] Teach the driver (and frontend?) to handle response files #47094

Closed
dabrahams opened this issue Apr 6, 2017 · 10 comments
Closed

[SR-4517] Teach the driver (and frontend?) to handle response files #47094

dabrahams opened this issue Apr 6, 2017 · 10 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-4517
Radar None
Original Reporter @dabrahams
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Driver
Assignee dabelknap (JIRA)
Priority Medium

md5: e57ec2457f89238a26e71b98a5cb32cf

is duplicated by:

  • SR-6639 [Driver] Support for response files in the compiler

relates to:

  • SR-7399 Cannot build with many/long source file paths

Issue Description:

I tried modifying the command-line that builds the standard library to specify a primary file, and it wouldn't work until I manually listed all the files instead of using @<responsefile>.txt

@belkadan
Copy link
Contributor

belkadan commented Apr 7, 2017

The compiler doesn't handle response files at all. line-directive expands them.

I'm not sure what you're trying to do, either. You can't pass -primary-file with -Xfrontend. It has to go before the particular file that's the primary one.

@dabrahams
Copy link
Collaborator Author

The compiler doesn't handle response files at all. line-directive expands them.

That is what I suspected, and it's absolutely, obviously, the wrong design. This means any Windows users who don't want to use line-directive can't build swift code if the command line gets too long.

I'm not sure what you're trying to do, either.

I'm trying to do what Doug suggested.

You can't pass -primary-file with -Xfrontend. It has to go before the particular file that's the primary one.

It was going before the file that was the primary one. That doesn't make it exclusive with -Xfrontend, which preceded it—unless maybe there are rules behind the Swift command line that aren't clearly documented (at least, not where I can find them). It's all quite mysterious, so marking this invalid seems a bit... premature.

@dabrahams
Copy link
Collaborator Author

/cc erg (JIRA User) this is what I was talking about the other day.

@belkadan
Copy link
Contributor

-Xfrontend arguments are additional arguments to pass to the frontend; they have nothing to do with the non-Xfrontend arguments you pass.

Please don't try to play games with the driver.

@belkadan
Copy link
Contributor

Oh, and the compiler doesn't handle response files because the correct way to handle response files would be to accept any arguments, not just input files, and that's Difficult To Implement.

@belkadan
Copy link
Contributor

I have nothing against doing it, though.

@belkadan
Copy link
Contributor

llvm::cl::ExpandResponseFiles will probably help here.

@belkadan
Copy link
Contributor

Retitled to reflect the actual feature we can do. Inserting -primary-file via -Xfrontend just isn't ever going to be safe or supported.

@swift-ci
Copy link
Collaborator

Comment by Austin Belknap (JIRA)

Addressed this issue in PR: #15853. Still needs review.

@belkadan
Copy link
Contributor

Cherry-picked Austin's changes to the 4.2 branch: #17409

@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
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself 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