Open michaellenaghan opened 1 year ago
I found an explanation in a closed bug, #421. In --parallel
mode swift-format
opens a lot of files all at once — and blows past the default maxfiles
limit of 256.
Using something like:
ulimit -Sn 4096
in the session "fixes" the problem — until you exit the session (or reboot).
A fix that survives reboot is... more involved.
Tracked in Apple’s issue tracker as rdar://126948350
Hello,
Is there a workaround for this ? Right now this makes the --parallel
option unusable on large projects, which kind of defeats its purpose.
@ghugues I wrap swift-format
in a bash
script. This is what the bash
script does:
# `--parallel` opens more files than the default `ulimit` allows.
ulimit -Sn 1024 && swift-format format --configuration ./swift-format.json --in-place --parallel --recursive .
Since updating to Xcode 14.3 — I think that's right, but I'm not sure — I've been seeing a flood of errors whenever I use
--parallel
. Here's a sampling of the error messages:As you can see, most errors mention the config file, but some mention other files. Those other files do in fact exist:
This command line produces the errors:
This one does not:
This morning I upgraded
swift-format
from 508.0.0 to 508.0.1 and I still see the errors.