FS#67212 - [zsh-theme-powerlevel10k] - gitstatus failed to initialize

Attached to Project: Community Packages
Opened by Dean Wallace (duffydack) - Tuesday, 07 July 2020, 00:25 GMT
Last edited by Christian Rebischke (Shibumi) - Tuesday, 07 July 2020, 12:02 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Christian Rebischke (Shibumi)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:
Bug in ver 1.12.0-1 Prompt functions, but on every shell start spits out, '[ERROR]: gitstatus failed to initialize.'

Additional info:
* Pkg version 1.12.0-1
* Installed -git version in AUR, no issues.
* I checked /usr/share/zsh-theme-powerlevel10k/gitstatus/usrbin/gitstatusd-linux-x86_64, it does exist.

/usr/share/zsh-theme-powerlevel10k/gitstatus/usrbin/gitstatusd-linux-x86_64: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d65502f9fcc77899bfacfa52ba167cef71d84c5b, for GNU/Linux 3.2.0, stripped

Steps to reproduce:
* Upgrade to zsh-theme-powerlevel10k 1.12.0-1
This task depends upon

Closed by  Christian Rebischke (Shibumi)
Tuesday, 07 July 2020, 12:02 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.12.0-2
Comment by Leo Mao (leomao) - Tuesday, 07 July 2020, 01:10 GMT
I think "_libgit2ver" should be updated.
Comment by Eli Schwartz (eschwartz) - Tuesday, 07 July 2020, 01:25 GMT
This seems plausible indeed:

```
# Whenever pkgver is updated, _libgit2ver below must also be updated.
-pkgver=1.11.0
+pkgver=1.12.0
_libgit2ver="tag-005f77dca6dbe8788e55139fa1199fc94cc04f9a"
```
Comment by BrLi (brli) - Tuesday, 07 July 2020, 06:47 GMT
Also, may consider add release version of https://github.com/romkatv/gitstatus to source array and replace it with the one in p10k tree, which might not be that updated.
(in the case p10k 1.12.0 ships gitstatus 1.2.0(3 days ago), while the latest release is 1.2.2, with the same release day as p10k.
Comment by Leo Mao (leomao) - Tuesday, 07 July 2020, 07:35 GMT
I think the author explicitly states that p10k should use the gitstatus shipped within the repo instead of the latest version.
Comment by Roman Perepelitsa (romkatv) - Tuesday, 07 July 2020, 07:37 GMT
> I think the author explicitly states that p10k should use the gitstatus shipped within the repo instead of the latest version.

Correct.

As far as I can tell, version 1.12.0-1 of zsh-theme-powerlevel10k community package has two bugs. The first has been identified by eschwartz above. The second is mentioned in https://bugs.archlinux.org/task/67213.
Comment by BrLi (brli) - Tuesday, 07 July 2020, 07:44 GMT
a working pkgbuild fix is as attached, diff provided:

@leomao, as it seems, that the author just compare the value of the two variables (of the sed lines above) to decide if it is an "updated" gitstatusd binary, where they are not at all aligned with the release version.

as report in the log generated via `GITSTATUS_LOG_LEVEL=DEBUG gitstatus_start_p9k_ POWERLEVEL9K`:

```
+_gitstatus_daemon_p9k_:63:cursh cursh then> HOME=/home/brli /usr/share/zsh-theme-powerlevel10k/gitstatus/usrbin/gitstatusd-linux-x86_64 -G v1.0.0 -v DEBUG -t 16
Version mismatch. Wanted (pattern): "v1.0.0". Actual: "v1.2.0".
```
Comment by Roman Perepelitsa (romkatv) - Tuesday, 07 July 2020, 07:45 GMT
Instead of adding more hacks (such as patching sources with sed), I would suggest removing the hack that is the culprit of the broken package. See my comment above.
Comment by Christian Rebischke (Shibumi) - Tuesday, 07 July 2020, 12:01 GMT
Fixed.. the gitstatusd version was one reason, the other reason was this commit here:

https://github.com/romkatv/powerlevel10k/commit/b0158178925484c058e6175e174b639237532c63

Removing this line seems to fix the issue (even with the new gitstatusd version):


- mv "${pkgdir}/usr/share/zsh-theme-powerlevel10k/gitstatus/usrbin/"{gitstatusd,gitstatusd-linux-$CARCH}

@BrLi thanks for the patches, I will have a look over them and may apply them.

Closing this for now

Loading...