Navigation Menu

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-7399] Cannot build with many/long source file paths #49942

Closed
ChristopherRogers opened this issue Apr 10, 2018 · 6 comments
Closed

[SR-7399] Cannot build with many/long source file paths #49942

ChristopherRogers opened this issue Apr 10, 2018 · 6 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

@ChristopherRogers
Copy link
Contributor

Previous ID SR-7399
Radar None
Original Reporter @ChristopherRogers
Type Bug
Status Resolved
Resolution Invalid
Environment

Xcode 9.3 (9E145), Xcode 10 beta 4 (10L213o)

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

md5: f4155e0d0aaa049357eeb67e9f969e03

relates to:

  • SR-4517 Teach the driver (and frontend?) to handle response files
  • SR-280 swiftc - Can't compile project with +1500 Swift files

Issue Description:

When building with lots of Swift files, you can wind up making the arguments to the Swift compiler go over ARGMAX/kern.argmax and cause posix_spawn() to fail. ("error: unable to spawn process (Argument list too long)")

This may seem kinda silly to report but we've actually have had to investigate and workaround this before in our CI environment. We worked around it by shortening the base directory name we were building from. Now it's starting to pop up again with certain jobs (directories) that have a slightly longer name. Eventually we may have too many Swift files to workaround this. At the moment, we have 2,317 Swift files in our main target.

This occurs with both the new and current build systems but I was able to find this error message with the new build system. (It may have just been hidden somewhere with the current one.)

@belkadan
Copy link
Contributor

Can you be more specific? Which command line is too long: the one from Xcode to swiftc, or the one from the parent swiftc process (the "driver") to the actual compilation process (the "frontend")? Only happening with WMO makes me suspect the latter, but that was SR-280 and should be fixed.

@ChristopherRogers
Copy link
Contributor Author

Sorry, this doesn't seem to be limited to WMO. Testing now with Xcode 10 beta 4 in the new incremental batch mode, I can get the same error to occur. It's happening for the initial command from Xcode to swiftc, not from the driver to the frontend.

@belkadan
Copy link
Contributor

Okay, we've got that tracked by rdar://problem/35879960. Since it's an Xcode change rather than a Swift one at this point, I'm going to close this bug.

@swift-ci
Copy link
Collaborator

Comment by Tayphoon (JIRA)

We still see this issue on mac mini (Late 2012), Xcode 10.1 (10B61).

error: unable to spawn process (Argument list too long)

@swift-ci
Copy link
Collaborator

Comment by Anton Poltoratskyi (JIRA)

I received the same issue in Xcode 10.1. The project currently have 1900+ files. "error: unable to spawn process (Argument list too long)"

@belkadan
Copy link
Contributor

Again, this is an Xcode-side issue, not a Swift-side issue. Commenting here won't make the Xcode engineers work any faster!

(We're not all the same people at Apple. :-) )

@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