vrchat-community / creator-companion

The Entry Point for Making Things in VRChat
https://vrchat.com/home/download
60 stars 425 forks source link

[BUG] Getting versions from Unity Hub on macOS needs a longer timeout #504

Closed tbodt closed 2 months ago

tbodt commented 3 months ago

Describe the bug

vpm check unity returns

[10:10:39 INF] Found No Supported Editors
[10:10:39 INF] Unity is not installed.

because

$ time /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless editors -i
2024-07-06 10:09:14.469 Unity Hub[5752:31887199] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
2021.3.16f1 (Apple silicon), installed at /Applications/Unity/Hub/Editor/2021.3.16f1/Unity.app
2022.3.22f1 (Apple silicon), installed at /Applications/Unity/Hub/Editor/2022.3.22f1/Unity.app
5.3.6p5 (Intel), installed at /Applications/Unity/Hub/Editor/5.3.6p5/Unity.app

real    0m13.104s
user    0m8.879s
sys 0m1.951s

and as I found in a decompiler there's a 5 second timeout on this command.

To Reproduce

vpm check unity

Expected behavior

success

Screenshots

No response

Related Product

VCC (VRChat Creator Companion)

Product Version

vpm 0.1.25

OS

macOS / Linux

Additional context

No response

tbodt commented 3 months ago

Worked around by giving a path to this shell script as the path for unity hub

#!/bin/bash
hub="/Applications/Unity Hub.app/Contents/MacOS/Unity Hub"
if [[ "$1" == "--" && "$2" == "--headless" && $3 == "editors" ]]; then
    cat /tmp/editors
    (
        "$hub" "$@" > /tmp/editors
    ) & disown
    exit
fi
"$hub" "$@"
orels1 commented 2 months ago

This should be out soon as a new VPM CLI release

orels1 commented 2 months ago

A new version of VPM CLI has been released with an increased time out. The version is 0.1.26 Thanks for reporting the issue!