You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.
I'm testing out Swift scripting using Marathon, by trying to create a script to build and launch apps.
But it the scripts takes up all available memory, until my computer turns unresponsive. Here is the script:
import Foundation
import Files
import ShellOut
// Compile and launch project for physical device
// This compiles an archive
print("Building archive")let _ =tryshellOut(to:"xcodebuild", arguments:["-project QDB.xcodeproj -scheme QDB -archivePath build/physical archive"])
// This compiles .ipa
print("Building ipa")let _ =tryshellOut(to:"xcodebuild", arguments:["-exportArchive -archivePath ./build/physical.xcarchive -exportPath ./build/ -exportOptionsPlist ./export.plist"])
// Install .ipa on physical device
print("Installing to device")let _ =tryshellOut(to:"cfgutil", arguments:["install-app build/QDB.ipa"])
If I run each shell command seperately in Terminal, they execute quite quickly, without high CPU/memory usage. But through Marathon, using ShellOut, the memory usage just increases and increases.
The first print() statement is never executed either, so it looks like it has to process the entire script somehow, before it outputs the print statements.
Not sure if this issue is related ShellOut or Marathon, but since it won't print the print statements, it looks like something related to how Marathon executes scripts.
Here you can see the running script and the memory/CPU usage.
The text was updated successfully, but these errors were encountered:
Maybe it could be a feature request for ShellOut to make it not build a string of the result.
The other weird behaviour is that it needs to execute all three shellOut statements, before the print statemenst are displayed in terminal.
I would excpect the print outs to be displayed as the script is executed line by line. Without this feature, it's a bit difficult to display progress printouts to the user of the script.
Glad to hear the memory issue is fixed. You probably need to manually flush stdout.
The API might have changed, but you could try this workaround vapor/vapor#796 (comment)
For better readability you could create a helper which automatically flushes the contents.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I'm testing out Swift scripting using Marathon, by trying to create a script to build and launch apps.
But it the scripts takes up all available memory, until my computer turns unresponsive. Here is the script:
If I run each shell command seperately in Terminal, they execute quite quickly, without high CPU/memory usage. But through Marathon, using ShellOut, the memory usage just increases and increases.
The first
print()
statement is never executed either, so it looks like it has to process the entire script somehow, before it outputs the print statements.Not sure if this issue is related ShellOut or Marathon, but since it won't print the print statements, it looks like something related to how Marathon executes scripts.
Here you can see the running script and the memory/CPU usage.
The text was updated successfully, but these errors were encountered: