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 Good for newcomers Edit

Comments

@swift-ci
Copy link
Contributor

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

Comment by Anton Pogonets (JIRA)

Sample attached

@belkadan
Copy link

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

Comment by Anton Pogonets (JIRA)

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

@ankitspd
Copy link
Member

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

@ankitspd
Copy link
Member

@swift-ci create

@swift-ci
Copy link
Contributor Author

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?

@ankitspd
Copy link
Member

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

@swift-ci
Copy link
Contributor Author

Comment by Anton Pogonets (JIRA)

Cool thanks

@swift-ci
Copy link
Contributor Author

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 Good for newcomers Edit 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 Good for newcomers Edit
Projects
None yet
Development

No branches or pull requests

4 participants