Package Details: signal-desktop-beta 7.6.0beta3-1

Git Clone URL: https://aur.archlinux.org/signal-desktop-beta.git (read-only, click to copy)
Package Base: signal-desktop-beta
Description: Signal Private Messenger for Linux - Beta version.
Upstream URL: https://signal.org
Keywords: secure-messenger signal signal-desktop
Licenses: GPL3
Conflicts: signal-desktop-beta-bin
Submitter: Edu4rdSHL
Maintainer: Edu4rdSHL
Last Packager: Edu4rdSHL
Votes: 15
Popularity: 0.27
First Submitted: 2020-08-17 19:09 (UTC)
Last Updated: 2024-04-19 12:37 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 .. 10 Next › Last »

mkurz commented on 2023-01-21 20:00 (UTC) (edited on 2023-01-21 20:04 (UTC) by mkurz)

@Edu4rdSHL Thanks!

Just to let you know, it is not just a common issue across AUR helpers, putting the export into the prepare function is violating the PKGBUILD specification. prepare() is for preparing the source code, not doing something that is needed to build the package. Not just yay or paru fail, even a common use case for makepkg will fail when putting the export into the prepare() function like you did. Have a look at the makepkg manpage:

$ man makepkg
...
       -e, --noextract
           Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is
           handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result. Keep in mind that creating a
           patch may be a better solution to allow others to use your PKGBUILD.
...
       -o, --nobuild
           Download and extract files, run the prepare() function, but do not build them. Useful with the --noextract option if you wish to tweak the
           files in $srcdir/ before building.

Now, let's do what the man page says. First just let's download and prepare the source:

$ makepkg -o
==> Making package: signal-desktop-beta 6.3.0beta1-4 (Sa 21 Jän 2023 20:44:22)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
...
==> Validating source files with sha512sums...
...
==> Extracting sources...
...
==> Starting prepare()...
...
==> Sources are ready.

Nice, sources are downloaded and prepared. Now, lets imagine we modify the source ourselves, we are finished doing that and now we want to actually build the package:

$ makepkg -e
==> Making package: signal-desktop-beta 6.3.0beta1-4 (Sa 21 Jän 2023 20:49:43)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
...
[build:webpack   ] Error: error:0308010C:digital envelope routines::unsupported
[build:webpack   ]     at new Hash (node:internal/crypto/hash:71:19)
[build:webpack   ]     at Object.createHash (node:crypto:130:10)
...
[build:webpack   ] error Command failed with exit code 1.
[build:webpack   ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[build:webpack   ] ERROR: "build:webpack:sticker-creator" exited with 1.
[build:webpack   ] error Command failed with exit code 1.
[build:webpack   ] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build:webpack" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
==> ERROR: A failure occurred in build().
    Aborting...

BOOOM! Same error when just using makepkg! The npm variable was not set anymore, because in the second command the prepare function did not run anymore. You can also read more about that in this discussion: https://github.com/Jguer/yay/issues/1006 where people write things like "DO NOT USE PREPARE JUST TO SET VARIABLES. You are violating the PKGBUILD specification, and as a result your PKGBUILD sucks."

Thanks for fixing! Highly appreciated!

Edu4rdSHL commented on 2023-01-21 19:34 (UTC) (edited on 2023-01-21 19:42 (UTC) by Edu4rdSHL)

If it builds with makepkg and in a clean chroot environment, then there's nothing to fix on my side but in the program that fails to do that. I'm not going to modify things to fix builds on broken AUR helpers.

Edit: it seems to be a common issue across AUR helpers, I tried building it with paru, and it fails as well. I will apply the fix to avoid these issues.

mkurz commented on 2023-01-21 19:31 (UTC) (edited on 2023-01-21 19:34 (UTC) by mkurz)

@Edu4rdSHL this package is broken when installing it with yay. I didn't realize that because I always build it myself using makepkg. However now that you fixed the aarch64 stuff and I wanted to upgrade it using yay it will fail with the error described by jnnk: https://aur.archlinux.org/packages/signal-desktop-beta?O=20#comment-893530 It will not just fail for aarch64, but for everyone using yay no matter which architecture.

Before I go into details, the fix is to move the

export NODE_OPTIONS=--openssl-legacy-provider

from the prepare() to the build() function.

Now the details. Let's start how you can reproduce the problem.

  1. Start a fresh shell (bash)
  2. IMPORTANT: Make sure you don't have the NODE_OPTIONS env variable set: unset NODE_OPTIONS
  3. Now run yay -S signal-desktop-beta. It will fail.

But: If you clone the git repo of this aur and run makepkg -sic it will work. But why does it work when running makepkg directly, but fail when using yay -S? That is because yay runs the prepare() and the build() function each in their own, new subshell process. So if you export a variable in the first subshell (running the prepare()) function, the subshell will exit after the function ran and the env variable will not propagate to the next subshell. So in build() the NODE_OPTIONS variable (which you set in prepare()) will be empty, which leads to the error of the referenced comment. You can easily test this by putting echo "NODE OPTIONS: $NODE_OPTIONS" at the top of the build() function, you will see that when running yay -S it will be empty, but it will be set correctly when using makepkg. You could also echo "PID of this script: $$" at the top of the prepare() and the same echo at the top of the build() function. You will see that when using yay there will be different pid's for each function, however when using makepkg the same pid shows up because there the whole script runs in the same subshell/process.

Here is the full patch, would be nice if you could apply that! Thanks! Also let me mention the signal-desktop-arm package suffers from the same problem, see it's comments: https://aur.archlinux.org/packages/signal-desktop-arm

diff --git a/PKGBUILD b/PKGBUILD
index 34840f5..81444f3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -30,9 +30,6 @@ sha512sums=('40dc86257be73eaa156180d2c725c58a6c16dabd6588cbce492ce30296e5db9307f
 prepare() {
   cd "${_pkgname}-${pkgver//beta*}-beta.${pkgver##*beta}"

-  # temporary fix for openssl3
-  export NODE_OPTIONS=--openssl-legacy-provider
-
   git lfs install

   # Allow higher Node versions
@@ -44,6 +41,9 @@ prepare() {
 build() {
   cd "${_pkgname}-${pkgver//beta*}-beta.${pkgver##*beta}"

+  # temporary fix for openssl3
+  export NODE_OPTIONS=--openssl-legacy-provider
+
   yarn generate
   yarn prepare-beta-build
   USE_SYSTEM_FPM=$([ $(uname -m) == "aarch64" ] && echo true || echo false) bash -c 'yarn build'

mkurz commented on 2023-01-16 12:31 (UTC)

Thanks @Edu4rdSHL!

Edu4rdSHL commented on 2023-01-16 03:15 (UTC)

Done on -4

mkurz commented on 2023-01-15 20:50 (UTC)

@Edu4rdSHL please apply following diff, bash -c ... is needed!

diff --git a/PKGBUILD b/PKGBUILD
index dcb3b9f..8b40e47 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -46,7 +46,7 @@ build() {

   yarn generate
   yarn prepare-beta-build
-  USE_SYSTEM_FPM=$([ $(uname -m) == "aarch64" ] && echo true || echo false) yarn build
+  USE_SYSTEM_FPM=$([ $(uname -m) == "aarch64" ] && echo true || echo false) bash -c 'yarn build'
 }

 package() {

mkurz commented on 2023-01-13 21:54 (UTC)

@Edu4rdSHL Yes, just checked, because you removed bash -c it's not working correctly on aarch64 anymore, because it will NOT return "true". (You probably didn't realize the error because it still will correctly on your machine)

mkurz commented on 2023-01-13 21:51 (UTC) (edited on 2023-01-13 21:51 (UTC) by mkurz)

@Edu4rdSHL In your latest commit you removed ... bash -c '...' - but without using bash -c it is not working correctly. You need bash -c, I am pretty sure, otherwise it's always empty. Can you check! And THANK YOU! Makes life a bit more easiert now :)

Edu4rdSHL commented on 2023-01-13 19:50 (UTC)

Support for aarch64 has been added with some additional tweaks, please let me know if everything is working as expected.

Thanks a lot @mkurz for the help on it.

hotschi commented on 2023-01-11 19:46 (UTC)

@mkurz Thanks a lot for your help! With your patch I was finally able to build and run this package on Asahi-Linux!