Gittyup icon indicating copy to clipboard operation
Gittyup copied to clipboard

Source directory being used for theme files again, panic at runtime

Open alerque opened this issue 1 year ago • 11 comments

Some form of the issue we saw in #167 is back for 1.4.0. Packages I built on an offline build system (Arch Linux official package builder) are throwing an error at run time:

PANIC: unprotected error in call to Lua API (cannot open /build/gittyup/src/Gittyup/conf/System.lua: No such file or directory)

This is looking for a Lua file at the path it would have been during the build process instead of looking for it where it should be installed. The file is installed at /usr/share/gittyup/Gittyup/themes/System.lua in the final package, but that location is not found and the panic happens because it only looks in where the source directory was at build time. In this case that is in a chroot on a different system and hence is not available at run time.

alerque avatar May 21 '24 14:05 alerque

Same for me

PANIC: unprotected error in call to Lua API (cannot open /home/user/.cache/paru/clone/gittyup/src/Gittyup/conf/System.lua: No such file or directory)
[1]    108341 IOT instruction (core dumped)  gittyup

Cannot installa anymore

ftaiolivista avatar May 24 '24 15:05 ftaiolivista

Can you show the debug output in the console? Not sure yet if there is a cmake option to enable them without the gui.

Murmele avatar May 28 '24 06:05 Murmele

@alerque do you have the same problem?

Murmele avatar May 28 '24 06:05 Murmele

Now it seems to work. No more errors installing aur package (gittyup 1.4.0-1). I'm using paru.

ftaiolivista avatar May 28 '24 07:05 ftaiolivista

Thanks for testing

Murmele avatar May 28 '24 07:05 Murmele

Sorry. I cleaned up paru cache and reinstalled gittyup and now it fail to start.

PANIC: unprotected error in call to Lua API (cannot open /home/vista/.cache/paru/clone/gittyup/src/Gittyup/conf/System.lua: No such file or directory)
[1]    85660 IOT instruction (core dumped)  gittyup .

Before was working because the file was present in the paru cache someway

ftaiolivista avatar Jun 12 '24 13:06 ftaiolivista

Having the same issue (on Manjaro Linux)

I can install it but then I cannot launch it, see error below

PANIC: unprotected error in call to Lua API (cannot open /tmp/pamac-build-user/gittyup/src/Gittyup/conf/System.lua: No such file or directory)
[1]    53284 IOT instruction (core dumped)  gittyup

The src folder in tmp gets deleted in the "Cleaning up" step of the install. When I then manually add it back (clone it from git), I can launch the app again.

But it seems like the tmp folder should not be the place where these files should live.

stingray21 avatar Jun 20 '24 14:06 stingray21

Building and launching works with @yochananmarqos's PKGBUILD https://github.com/yochananmarqos/pkgbuilds/blob/master/gittyup/PKGBUILD

see: https://aur.archlinux.org/packages/gittyup

stingray21 avatar Aug 13 '24 16:08 stingray21

@alerque can you include ↑ these ↑ changes into PKGBUILD?

loziniak avatar Sep 26 '24 17:09 loziniak

@stingray21 and @loziniak the changes in @yochananmarqo's PKGBUILD are not tennable for release to the AUR. You are welcome to use them yourself, but there are several things happening in there that are against Arch packaging guidelines, including installing vendored versions of QT/libgit/etc. to /usr/lib that don't belong to the package at all. It "works" for some scenarios but is not a viable fix for the AUR package.

And yes @Murmele this is still an issue, the Lua paths still end up dependency on the build-time source location, not the target install location.

alerque avatar Dec 20 '24 08:12 alerque

This bug has something to do with build modes. I was able to avoid it by some combination of not requesting cmake to generate ninja files (removing -G ninja) and changing the build type from None to Release. It's possible that the latter of those things in correctly affecting this in that it is avoiding some debug mode that forces assets to be in the source directory. I don't know why or how that is happening with a fully qualified path and I don't see anything at all the source that suggests how -D CMAKE_BUILD_TYPE is being used to affect Lua include paths.

Notably not generating Ninja build scripts means there is no access to the test suite, so this isn't quite a satisfactory full work around.

Does that help identify where this is coming from? If it's a known mechanism for debug builds that might be okay, although it should probably be done with relative paths not absolute ones.

alerque avatar Dec 20 '24 11:12 alerque