Describe the bug
A clear and concise description of what the bug is.
Running flank on Xcode 12 / bitrise causing Flank Error.
Flank fails on searching test names in a .xctest.
To Reproduce
Steps to reproduce the behavior:
Xcode 12 and bitrise
RunTests
Found xctest: /Users/vagrant/deploy/Debug-iphoneos/UITests-Runner.app/PlugIns/UITests.xctest
isMacOS = true (mac os x)
nm -U “/Users/vagrant/deploy/Debug-iphoneos/UITests-Runner.app/PlugIns/UITests.xctest/UITests”
nm -gU “/Users/vagrant/deploy/Debug-iphoneos/UITests-Runner.app/PlugIns/UITests.xctest/UITests” | xargs -s 262144 xcrun swift-demangle
Error: xargs: xcrun: Argument list too long
Command failed: nm -gU “/Users/vagrant/deploy/Debug-iphoneos/UITests-Runner.app/PlugIns/UITests.xctest/UITests” | xargs -s 262144 xcrun swift-demangle
[33;1mFlank exited with status code `1`: A general failure occurred. Possible causes include: a filename that does not exist or an HTTP/network error.[0m
Expected behavior
A clear and concise description of what you expected to happen.
Flank shouldn't fail why searching .xctest for test names.
Details (please complete the following information):
Have you tested on the latest Flank snapshot?
Post the output of
flank --version.
21.01.1
Additional context
Add any other context about the problem here.
Error occurs inparseSwiftTests()method.
val cmd = if (isMacOS) {
"nm -gU ${binary.quote()} | xargs -s $argMax xcrun swift-demangle"
} else {
"export LD_LIBRARY_PATH=~/.flank; export PATH=~/.flank:\$PATH; nm -gU ${binary.quote()} | xargs -s $argMax swift-demangle"
}
We should be able to reproduce this by faking a very long argument list.
Ideally there's a way to refactor the code so it works with infinitely large amounts of arguments.
Possibly we could build a custom version of swift-demangle from source that operates on input from disk instead of args? There may be better ideas.
As a temporary workaround, I just changed xargs -s $argMax xcrun swift-demangle to xargs -n1 xcrun swift-demangle. Obviously, this slows it down by a couple mins but it was a quick patch to make it work
Most helpful comment
As a temporary workaround, I just changed
xargs -s $argMax xcrun swift-demangletoxargs -n1 xcrun swift-demangle. Obviously, this slows it down by a couple mins but it was a quick patch to make it work