Repository navigation
Open projects signed in, without the official Hub (Unity CLI) - #66
Closed
ManeFunction wants to merge 16 commits into
Closed
ManeFunction wants to merge 16 commits into
ManeFunction wants to merge 16 commits into
Conversation
wxWakeUpPipe::WakeUpNoLock() wrote to the pipe and only then cleared m_pipeIsEmpty. When the main thread drained the pipe in between, the flag stayed false forever, so no later SIGCHLD was written to the pipe. Child processes were never reaped and wxExecute() waited for them indefinitely, which left opening a project through the Unity CLI stuck. Make the flag atomic and claim it before writing.
…ress pulse wxProgressDialog::Pulse() yields to the event loop, which on GTK may handle the command's SIGCHLD, so OnTerminate could destroy the progress window and the CommandProcess while Pulse() and OnPulse() were still using them. Close the window and delete the process from CallAfter instead.
Marks the patched code and keeps the patch under patches/wxWidgets, so a future wxWidgets update doesn't silently drop it.
globals.h looked the home folder up three times and the Unity CLI code a fourth time, none checking that getpwuid() succeeded. Look it up once, falling back to $HOME.
The JSON helpers took the first matching key anywhere in the document, so a nested "path" in cli-install.json could shadow the real one. Look values up by the path of member names instead, e.g. data.loggedIn for auth status.
The script was spliced together from many string literals around the manifest URL. Pass the URL as an argument instead.
… refresh Locate(), Find() and recentEnough described three states (missing, too old, ready) that every caller rebuilt by hand, and each lookup ran `unity --version` again: twice at startup and once per project open. Probe() now returns a UnityCliStatus that holds the CLI only when it is ready, and the main window keeps the last one, refreshed on startup, Reload and after installing or signing in.
…launch into one function OpenProjectInEditor() decides whether to open a project through the CLI, and falls back to launch_editor(), which now owns the Editor's command line. The main window no longer builds the command line or passes a fallback callback, and UnityCli no longer exposes CanOpen() and Open().
Creating a project launched the Editor directly, so it started signed out and started the official Hub. With a ready CLI, the Editor now creates the project in batch mode, which needs no sign-in, behind a progress window that can cancel it, and the project then opens through the CLI. If creating fails, it offers to create the project directly instead. The create dialog now hands back the editor and template instead of a command line, which launch_editor_create() builds.
UnityCliController owns the Install CLI and Login CLI buttons, the install prompt and the install-then-sign-in flow, and keeps the last CLI status. The main window only creates it and forwards its button events.
Owner
|
As I mentioned in this other PR (#63 (comment)), this project does not allow AI-generated code dumps. In addition, I don't want to fork wxWidgets but it appears that you have made source modifications to it. As such, I cannot accept this PR. Sorry. |
Contributor
Author
|
It's OK, I understand this decision. In that case I'll switch to my own fork, using Unity that is not logged-in has some level of discomfort. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few years ago, the main problem with UnityHubNative was that it launched the official Unity Hub, which defeated the whole point of using a native alternative. That’s why I stopped using it back then. This problem was described in the issue #28.
Now that I’ve returned to the project, I’ve tested its current behavior on macOS and Linux with the latest Unity Hub and the entire Unity 6 lineup (from 6.0 to 6.6), and it looks like the problem has changed. Unity Hub no longer launches automatically, but the Unity Editor cannot handle authentication unless the official Hub is running. As a result, any Editor launched without the official Hub starts with the user logged out, leaving the Asset Store and Unity Services unavailable.
After doing some research, I found that we can launch the Editor using the new Unity CLI, designed for AI agents. I’ve integrated this CLI-based launch method into UnityHubNative, with a fallback to the previous one. I’ve also added a helper to guide users through installing the new Unity CLI using the official installer if they don’t have it already installed.
Additional fixes
patches/wxWidgets/wakeuppipe-lost-wakeup.patch, documented inpatches/wxWidgets/README.md). A race inwxWakeUpPipe::WakeUpNoLock()could permanently skip wake-ups. wxWidgets then stopped noticing that child processes had exited, so CLI commands seemed to hang forever. The flag is now atomic and is claimed before the write.Testing
Notes
latest.jsonreturns 404, and onlylatest-beta.jsonexists. That is why the installer falls back to the beta channel.