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-8671] ARG_MAX limit exceeded when compiles huge project #5341

Open
swift-ci opened this issue Aug 31, 2018 · 9 comments
Open

[SR-8671] ARG_MAX limit exceeded when compiles huge project #5341

swift-ci opened this issue Aug 31, 2018 · 9 comments
Labels
bug good first issue

Comments

@swift-ci
Copy link
Contributor

@swift-ci swift-ci commented Aug 31, 2018

Previous ID SR-8671
Radar rdar://problem/43940293
Original Reporter Pogonets (JIRA User)
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 3
Component/s Package Manager
Labels Bug, StarterBug
Assignee None
Priority Medium

md5: 7fd3bd1478f560273a7837164b9d76a9

Issue Description:

macOS have a relative small ARG_MAX limit (256kb)

When you compile huge project with SwiftPM they pass all sources one by one as arguments. Each file is passed as absolute path. And with count of files ~1000 (800 in our case) command line args become too long to even start command.

Error message is meaningless by the way

unable to spawn process (File exists)

This issue even easier to reach when linking multiple swift modules to single dynamic library (all object files from all modules passed to compiler as single line).

This is pretty common issue for build tools and usually solved with response files. Response files supported by clang, ld.gold and many other tools.

@swift-ci
Copy link
Contributor Author

@swift-ci swift-ci commented Aug 31, 2018

Comment by Anton Pogonets (JIRA)

Sample attached

@belkadan
Copy link

@belkadan belkadan commented Aug 31, 2018

We did the compiler work to support this last year, but I don't think the package manager changes made it in. @aciidb0mb3r, you have a dup for this, right?

@swift-ci
Copy link
Contributor Author

@swift-ci swift-ci commented Aug 31, 2018

Comment by Anton Pogonets (JIRA)

@belkadan sounds cool. Is compiler use such syntax when forward invocations to linker?

@aciidb0mb3r
Copy link
Member

@aciidb0mb3r aciidb0mb3r commented Aug 31, 2018

Jordan: Nope, we were tracking using response file to pass the list of object files (which landed recently).

@aciidb0mb3r
Copy link
Member

@aciidb0mb3r aciidb0mb3r commented Aug 31, 2018

@swift-ci create

@swift-ci
Copy link
Contributor Author

@swift-ci swift-ci commented Aug 31, 2018

Comment by Anton Pogonets (JIRA)

@aciidb0mb3r So as I understand it is already fixed for linking when module with dependencies have too many object files. But not for single module when compiling sources. Is it correct? Are you plan to fix second case?

@aciidb0mb3r
Copy link
Member

@aciidb0mb3r aciidb0mb3r commented Aug 31, 2018

Pogonets (JIRA User): Right and yep, we're tracking the second case with this bug report.

@swift-ci
Copy link
Contributor Author

@swift-ci swift-ci commented Aug 31, 2018

Comment by Anton Pogonets (JIRA)

Cool thanks

@swift-ci
Copy link
Contributor Author

@swift-ci swift-ci commented Dec 31, 2020

Comment by Strega's Gate (JIRA)

I just hit this issue on windows.
Package sample kept for reference here discussion here.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@tomerd tomerd added good first issue and removed Package Manager labels May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue
Projects
None yet
Development

No branches or pull requests

4 participants