Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnityHub new 3.0 package change #176783

Closed
njakes opened this issue Jun 7, 2022 · 20 comments · Fixed by #204005
Closed

UnityHub new 3.0 package change #176783

njakes opened this issue Jun 7, 2022 · 20 comments · Fixed by #204005

Comments

@njakes
Copy link

njakes commented Jun 7, 2022

Project description
Unity is changing the way they deliver the editor via the UnityHub. They have shifted away from the appimage and have started Debian and RHEL repositories. They are not producing the appimage anymore.

Would it be possible to add the new UnityHub to NixOS?

The new download instructions are here:
https://docs.unity3d.com/hub/manual/InstallHub.html#install-hub-linux

@Kranzes
Copy link
Member

Kranzes commented Jun 7, 2022

Extracting the binary from the .deb is fairly simple and has been done in similar situations in nixpkgs before.

@Suyashtnt
Copy link

Is there any quick fix to use unity right now?

@njakes
Copy link
Author

njakes commented Jul 5, 2022

Not that I have found. You could use an old version of the appimage if you still have one. The flatpak is available but is a really old version.

@GeorgesAlkhouri
Copy link
Member

I am currently building a derivation locally to extract the binary from the .deb package and make it run. Lets see how long it takes

@huantianad
Copy link
Contributor

@GeorgesAlkhouri have you had any success? I have my attempt but it yells about illegal hardware instruction and crashes when I try to use it

@GeorgesAlkhouri
Copy link
Member

I thought that unityhub is an electron app. My current attempt results in a NODE_MODULE_VERSION f mismatch from electron.
Here is my gist.

I build it via nix-build -E '((import <nixpkgs> {}).callPackage (import ./default.nix) { })' --keep-failed --no-out-link.

@huantianad
Copy link
Contributor

Yeah it is electron but I'm just trying to package the prepackaged electron binary instead of using system electron

@GeorgesAlkhouri
Copy link
Member

Yes you are right. When trying to use the included electron binary it will result in the same error. Hm when I have some time I will investigate with strace. Or maybe you had any luck?

@huantianad
Copy link
Contributor

Unfortunately not, I've seen one other mention of the same error with electron with no solution, and I'm not sure how to do deeper debugging personally.

@huantianad
Copy link
Contributor

I've managed to do something: by adding libudev to LD_LIBRARY_PATH, I can get it to not SIGILL, but now instead it just hangs... I'll keep trying but I'm not sure what it is this time.

@huantianad
Copy link
Contributor

I've made a tad more progress, I forgot to enable gnome-keychain so that was causing the hang, but now it's segfaulting 😓 I do see it looking for libnvtegrahv.so but I'm not sure what that even is

@huantianad
Copy link
Contributor

huantianad commented Aug 4, 2022

Finally, got it working. It boots up and I can install everything properly. The remaining issue is that hub-installed versions of Unity aren't patched so the hub fails to launch them. It seems that since the previous version used appimages, the library paths were passed to the editor as well as the hub, but I'm not sure how to do it with this. Do I need buildFHSUserEnv? I'll try that but I'm not sure if there's a more optimal solution.

@GeorgesAlkhouri
Copy link
Member

Looking at the appimage code buildFHSUserEnv seems to be the way. image

@huantianad
Copy link
Contributor

huantianad commented Aug 9, 2022

Weird error I'm getting when I'm trying to open say Preferences or the Package Manager in the unity editor.... I have no idea what this is from, am I missing gtk stuff?
Caught fatal signal - signo:11 code:128 errno:0 addr:(nil)
--
2 | Obtained 27 stack frames.
3 | #0  0x007f9571e3dbf0 in __sigaction
4 | #1  0x007f95757da099 in g_type_check_instance
5 | #2  0x007f95757ce854 in g_signal_handlers_disconnect_matched
6 | #3  0x00558232df9a13 in DisconnectGtkSignal(void*, GtkCallbackResponse (*)(), void*)
7 | #4  0x005582326a438d in MenuItem::~MenuItem()
8 | #5  0x005582326a8a23 in RemoveItemFromMenu(std::list<MenuItem, std::allocator<MenuItem> >*, core::basic_string_ref<char>)
9 | #6  0x005582326a8a63 in RemoveItemFromMenu(std::list<MenuItem, std::allocator<MenuItem> >*, core::basic_string_ref<char>)
10 | #7  0x005582326a88a3 in MenuController::RemoveMenuItem(core::basic_string_ref<char>)
11 | #8  0x0055823133c64c in Menu_CUSTOM_RemoveMenuItem(ScriptingBackendNativeStringPtrOpaque*)
12 | #9  0x000000426fa749 in (wrapper managed-to-native) UnityEditor.Menu:RemoveMenuItem (string)
13 | #10 0x000000426f899e in UnityEditor.EditorApplication/<>c__DisplayClass103_0:<CallDelayed>b__0 ()
14 | #11 0x007f93cd846228 in mono_get_runtime_build_info
15 | #12 0x007f93cd9e4f0e in mono_runtime_invoke
16 | #13 0x007f93cd9e4e58 in mono_runtime_invoke
17 | #14 0x00558231c1de63 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
18 | #15 0x00558231c199a7 in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
19 | #16 0x00558231d45fdf in Scripting::UnityEditor::EditorApplicationProxy::Internal_InvokeTickEvents(ScriptingExceptionPtr*)
20 | #17 0x00558232d5b303 in Application::TickTimer()
21 | #18 0x00558232df8d5a in MainMessageIteration(void*)
22 | #19 0x007f957531cd04 in g_main_context_dispatch
23 | #20 0x007f957531d0a8 in g_main_context_iterate.constprop.0
24 | #21 0x007f957531d393 in g_main_loop_run
25 | #22 0x007f95723fa375 in gtk_main
26 | #23 0x00558232df7f17 in main
27 | #24 0x007f9571e2924e in __libc_start_call_main
28 | #25 0x007f9571e29309 in __libc_start_main
29 | #26 0x00558230fe0029 in _start

@huantianad
Copy link
Contributor

huantianad commented Sep 23, 2022

Hopefully the final bit of the saga, it turns out the GTK issue I had isn't unique to NixOS, it occurs on other distros too, see the Unity bug report.

In that case, it seems my derivation for the updated Unity Hub is working properly in all other regards, and can be found here. All the extraLibs need to be cleaned up, I may have added a few unnecessary ones, and there's a lot of leftover testing with the QML paths 😅. If it looks good, perhaps we can update Unity Hub in nixpkgs too?

I've also made a gist describing how to use Rider with Unity on NixOS as well, might help someone out.

@ericdallo
Copy link
Member

ericdallo commented Nov 23, 2022

Thanks for that @huantianad, looking forward to seeing that on master!

@huantianad
Copy link
Contributor

Hehe thanks for the reminder, forgot to make a PR for updating the package!

@ericdallo
Copy link
Member

I just copied your derivation meanwhile and was the only thing it make unity work (installing the 2021.3.4), thanks!

@headblockhead
Copy link

headblockhead commented Dec 1, 2022

Hello @huantianad! I use Unity and just tried out your unityhub.nix file. It works great! However, I cannot find your PR. Would you be able to point me in the right direction? I would love to see this in nixpkgs soon!

@huantianad
Copy link
Contributor

@headblockhead I've been kinda busy recently with other prs and such, but I'm definitely planning to make a PR in nixpkgs, if not later today, definitely by this weekend. Thanks for the support :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants