NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 24 forks source link

AUR package issue with PGP key #5

Closed adastx closed 2 years ago

adastx commented 2 years ago
~ ✗  paru -S ctpv-git
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1) ctpv-git-r146.2d36fa4-1

:: Proceed to review? [Y/n]:

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
 nothing new to review
fetching devel info...
==> Making package: ctpv-git r146.2d36fa4-1 (Sat 02 Jul 2022 09:24:21 CEST)
==> Retrieving sources...
  -> Updating ctpv git repo...
==> Validating source files with sha512sums...
    ctpv ... Skipped
==> Verifying source file signatures with gpg...
    ctpv git repo ... FAILED (unknown public key 6E656AC5B97B5133)
==> ERROR: One or more PGP signatures could not be verified!
error: failed to download sources for 'ctpv-git-r146.2d36fa4-1':
error: packages failed to build: ctpv-git-r146.2d36fa4-1
NikitaIvanovV commented 2 years ago

Could you run gpg --recv-keys 6E656AC5B97B5133 and see if it works?

adastx commented 2 years ago
~ ✗  gpg --recv-keys 6E656AC5B97B5133
gpg: key 6E656AC5B97B5133: public key "Nikita Ivanov (Git and GitHub) <nikita.vyach.ivanov@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

~ ➜  paru ctpv
1 aur/ctpv-git r146.2d36fa4-1 [+0 ~0.00]
    Terminal previewer
:: Packages to install (eg: 1 2 3, 1-3):
:: 1
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1) ctpv-git-r146.2d36fa4-1

:: Proceed to review? [Y/n]:

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
 nothing new to review
fetching devel info...
==> Making package: ctpv-git r146.2d36fa4-1 (Sun 03 Jul 2022 13:53:36 IST)
==> Retrieving sources...
  -> Updating ctpv git repo...
Fetching origin
==> Validating source files with sha512sums...
    ctpv ... Skipped
==> Verifying source file signatures with gpg...
    ctpv git repo ... FAILED (the public key 701DE74D84F87EE1BC91CD216E656AC5B97B5133 is not trusted)
==> ERROR: One or more PGP signatures could not be verified!
error: failed to download sources for 'ctpv-git-r146.2d36fa4-1':
error: packages failed to build: ctpv-git-r146.2d36fa4-1
adastx commented 2 years ago

Okay I changed the trust of the key as shown here

Now I get the following build error:

==> Making package: ctpv-git r152.2220d63-1 (Tue 05 Jul 2022 13:26:51 IST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/config.o src/config.c
make -C embed
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/error.o src/error.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/lexer.o src/lexer.c
make[1]: Entering directory '/home/adam/.cache/paru/clone/ctpv-git/src/ctpv/embed'
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter  -L/usr/lib -lmagic -lcrypto  embed.c   -o embed
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/preview.o src/preview.c
src/preview.c: In function ‘run’:
src/preview.c:134:13: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  134 |             write(STDOUT_FILENO, buf, len);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/server.o src/server.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/shell.o src/shell.c
make[1]: Leaving directory '/home/adam/.cache/paru/clone/ctpv-git/src/ctpv/embed'
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/ulist.o src/ulist.c
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -O2 -MD -Wall -Wextra -Wno-unused-parameter   -c -o src/utils.o src/utils.c
src/shell.c:6:10: fatal error: ../gen/helpers.h: No such file or directory
    6 | #include "../gen/helpers.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/shell.o] Error 1
make: *** Waiting for unfinished jobs....
src/server.c:12:10: fatal error: ../gen/server.h: No such file or directory
   12 | #include "../gen/server.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/server.o] Error 1
==> ERROR: A failure occurred in package().
    Aborting...
error: failed to build 'ctpv-git-r146.2d36fa4-1':
error: packages failed to build: ctpv-git-r146.2d36fa4-1

Note: I was able to use ctpv fine by just cloning and running sudo make install, but it would be nice to use the AUR package

NikitaIvanovV commented 2 years ago

Do you use GNU Make and which version?

Edit: Nevermind, you managed to build the program by manually running make just fine, so it probably is the right version.

NikitaIvanovV commented 2 years ago

Could you try building and installing the package without paru?

git clone https://aur.archlinux.org/ctpv-git.git
cd ctpv-git/
makepkg -si
adastx commented 2 years ago

makepkg -si didn't work until I added options=('!makeflags') to the pkgbuild (source)

I use the following flags:

export MAKEFLAGS="-j$(nproc)"

Which comes from this section in the arch wiki.

Clearing this with export MAKEFLAGS=, and then running makepkg -si works fine. So the issues seems to be with trying to compile in parallel.

It looks like the solution could be forcing single threaded in the pkgbuild, which the wiki section describes:

Some PKGBUILDs specifically override this with -j1, because of race conditions in certain versions or simply because it is not supported in the first place. Packages that fail to build because of this should be reported on the bug tracker (or in the case of AUR packages, to the package maintainer) after making sure that the error is indeed being caused by MAKEFLAGS.

NikitaIvanovV commented 2 years ago

Indeed, I just tried to use the -j option and it failed to compile too. Thank you for finding the bug! I will not make any changes to the PKGBUILD because I managed to fix the bug in the Makefile (now -j option doesn't break anything).