icanzilb / timeui

Profile apps from the command line — duration, cpu & memory usage.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seems that "timeui" crash on start on macOS Ventura 13.1, built with Xcode 14.2

vashpan opened this issue · comments

macOS: Ventura 13.1
Xcode: 14.2
timeui: 0.0.3

$ swift run timeui
Building for debugging...
Build complete! (0.17s)
Fatal error: The operation couldn’t be completed. (Swift.String error 1.)

Same error appears when install using install.sh script (ignoring the fact that it's broken as well, it needs 'sudo' to copy anything to /usr/local/bin - maybe recent macOS hardened this location?)

Oh yes, that's a bug — the app crashes when there's no argument given. Try running ./run-demo.sh to see how to use. Ideally, I'll also accept a PR to add a proper error message :)

Hmm, ./run-demo.sh works indeed, but I tried to run it with other apps - and it didn't work 🤔

For example: ./.build/release/timeui sleep 5 or ./.build/release/timeui ping -c 5 www.google.com - both fails with the same error.

Am I still missing something?

I see, the first argument is an executable path (as in run-demo.sh), I think to run sleep or ping you need to try timeui /usr/bin/env sleep 5 (can't try that now myself but it's a valid point maybe timeui should try that automatically if the argument isn't a path

Indeed, I browsed the code a little bit and indeed you first try to figure out path of the executable, not the command itself. Is there a reason for that? Or maybe there's some technical difficulty for that?

Nah, not really — my use case is mostly timing running actual binaries that I'm working on, probably never needed to time one of the system commands myself. I think if you need it, you can easily add a PR for it

It's not only for system commands per-se, but you can run, for example some scripts via command something like that python3 foo.py or some build systems, like make. Closer to iOS dev, it could be fastlane command, etc.

I'll try to contribute in my spare time as this is a nice little tool 🙂 You can mark this issue as feature for example...