Skip to content

Conversation

@spixi
Copy link

@spixi spixi commented May 4, 2025

/tmp is often mounted as noexec, but required for Node.js to be executable. Starting UnityHub with a noexec TMPDIR will fail.

Therefore, I suggest changing
Exec=/opt/unityhub/unityhub %U
to
Exec=env TMPDIR=/var/tmp /opt/unityhub/unityhub %U

Moreover, the URI scheme is not installed correctly, however, the unityhub scheme is required for the logon process. There is a missing update to the XDG mimetype database.

This commit will fix both issues.

@spixi spixi changed the title Fix dev-games/unityhub dev-games/unityhub: Fix startup issues May 4, 2025
@stkw0
Copy link
Contributor

stkw0 commented May 4, 2025

Thank for the PR.
Seems that the commit doesn't follow the standard message format and is not signed. See https://wiki.gentoo.org/wiki/Project:GURU/Information_for_Contributors for

@spixi
Copy link
Author

spixi commented May 4, 2025

Thank for the PR. Seems that the commit doesn't follow the standard message format and is not signed. See https://wiki.gentoo.org/wiki/Project:GURU/Information_for_Contributors for

Thank you, I amended and force-pushed the commit.

@stkw0
Copy link
Contributor

stkw0 commented May 4, 2025

ping @StefanCristian @revanj as the maintainers of dev-games/unityhub

@StefanCristian
Copy link
Contributor

ping @StefanCristian @revanj as the maintainers of dev-games/unityhub

Will check later today.

dodir usr/bin
dosym -r /opt/unityhub/unityhub /usr/bin/unityhub

xdg_desktop_database_update
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spixi Cannot be used in src_install.

`>>> Install dev-games/unityhub-3.11.1-r1 into /var/tmp/portage/dev-games/unityhub-3.11.1-r1/image

  • ERROR: dev-games/unityhub-3.11.1-r1::guru failed (install phase):
  • xdg_desktop_database_update must be used in pkg_post* phases.
  • Call stack:
  • ebuild.sh, line 136:  Called src_install
    
  • environment, line 611: Called xdg_desktop_database_update
  • environment, line 1773: Called die
  • The specific snippet of code:
  •       die "xdg_desktop_database_update must be used in pkg_post* phases.";
    
  • If you need support, post the output of emerge --info '=dev-games/unityhub-3.11.1-r1::guru',
  • the complete build log and the output of emerge -pqv '=dev-games/unityhub-3.11.1-r1::guru'.
  • The complete build log is located at '/var/tmp/portage/dev-games/unityhub-3.11.1-r1/temp/build.log'.
  • The ebuild environment file is located at '/var/tmp/portage/dev-games/unityhub-3.11.1-r1/temp/environment'.
  • Working directory: '/var/tmp/portage/dev-games/unityhub-3.11.1-r1/work'
  • S: '/var/tmp/portage/dev-games/unityhub-3.11.1-r1/work'`

Add them in pkg_post*

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I will have a look at this during this week.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we inherit xdg, there is no reason to run these functions manually at all. The eclass exports pkg_preinst, pkg_postinst & pkg_postrm, and we don't overwrite them.

mv usr/share/doc/{${PN},${P}} || die
mv ./* "${ED}" || die

dodir usr/bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spixi you can use insinto /usr/bin here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is literally taken from unityhub-3.11.1.ebuild, but I will check this out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is literally taken from unityhub-3.11.1.ebuild, but I will check this out.

When we do changes, preferably we fix all the issues we can, and especially for the changes to be as public as possible. While in the process, we keep the discussions public as well 👍

Regrettably the older ebuild was replaced forcefully by someone else, but this is good timing to help out everyone who starts to contribute to Gentoo, to fix the old commiter's mistakes 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to use insinto.

This is a binary package, so we just move the contents over.

But we need to create the directory for dosym, as that it's not created automatically.

mv ./* "${ED}" || die

dodir usr/bin
dosym -r /opt/unityhub/unityhub /usr/bin/unityhub
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spixi no need to hardcode, you can use ${PN} (no quotes) instead of unityhub

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

dosym -r /opt/unityhub/unityhub /usr/bin/unityhub

xdg_desktop_database_update
xdg_mimeinfo_database_update
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out. I will move the xdg steps to pkg_postinst (and pkg_postrm).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, you can just remove it. In this case should be enough inheriting xdg eclass as it already exports the relevant functions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, you can just remove it. In this case should be enough inheriting xdg eclass as it already exports the relevant functions.

If the previous ebuild (that already had xdg) was not effective, we might need further investigation on why it's not configured properly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested and it is already working. When merging or unmerging it shows:

 * Updating .desktop files database ...                                                                                          [ ok ]
 * Updating icons cache ...     

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested and it is already working. When merging or unmerging it shows:

 * Updating .desktop files database ...                                                                                          [ ok ]
 * Updating icons cache ...     

I was as well under the impression it was working before, yes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange. For me it did not register the unityhub URI scheme, which had the following effect:

  • UnityHub starts (after fixing the TMPDIR issue)
  • Firefox opens for credential request
  • No callback from Firefox to UnityHub

I had to run xdg-mime default unityhub.desktop x-scheme-handler/unityhub manually to fix this issue.

I will investigate this further. Sorry for the inconvenience so far.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon correctly appeared in mate-menu, but I had to edit the .desktop file in mozo, because of the noexec TMPDIR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange. For me it did not register the unityhub URI scheme, which had the following effect:

  • UnityHub starts (after fixing the TMPDIR issue)
  • Firefox opens for credential request
  • No callback from Firefox to UnityHub

I had to run xdg-mime default unityhub.desktop x-scheme-handler/unityhub manually to fix this issue.

I will investigate this further. Sorry for the inconvenience so far.

No inconvenience! I was just wondering why did your portage not get that error with src_install() xdg 🤔

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants