Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUR package open-webui fails building but works with makepkg #1328

Open
Dasug opened this issue Jan 30, 2025 · 1 comment
Open

AUR package open-webui fails building but works with makepkg #1328

Dasug opened this issue Jan 30, 2025 · 1 comment

Comments

@Dasug
Copy link

Dasug commented Jan 30, 2025

Affected Version

paru v2.0.3.rebuild.1.r1.g90656a9 - libalpm v15.0.0

Description

Building AUR package open-webui ( https://aur.archlinux.org/packages/open-webui ) fails with paru but works when using makepkg.
The packages build step runs the following commands:

build() {
    _ensure_local_nvm
    cd "${pkgname}-${pkgver}"
    export NODE_OPTIONS="--max_old_space_size=4096"
    npm install
    npm run format
    npm run i18n:parse
    npm run build
}

According to the upstream package.json file, npm install installs (among many other packages) the packages prettier and prettier-plugin-svelte. The npm run format step then calls prettier from the just installed nodejs package. When building the package through paru this call fails since the prettier command could not be found, however when building with makepkg it runs just fine. See attached outputs further below:

Have you checked previous issues?
I have searched the previous issues for open-webui, which did not yield any results, as well as for node and nodejs. I found #1058 which while it is related to nodejs, I think it is unrelated to this specific issue, though I could be misunderstanding it. All other issues do not seem to be related to this problem. I also skimmed through the headlines of all currently open issues and could not find any other issue that seems related to this one. I might always have missed one though.

Output

LANG=en_US paru -S open-webui
~ LANG=en_US paru -S open-webui 
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1) open-webui-0.5.7-1

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

:: Downloading PKGBUILDs...
 (1/1) open-webui-0.5.7-1                            [---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:: Accept changes? [Y/n]: Y
fetching devel info...
==> Making package: open-webui 0.5.7-1 (Thu Jan 30 01:49:34 2025)
==> Retrieving sources...
  -> Downloading open-webui-0.5.7.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 50.7M    0 50.7M    0     0  6405k      0 --:--:--  0:00:08 --:--:-- 6865k
  -> Found open-webui.service
  -> Found open-webui.conf
==> Validating source files with sha1sums...
    open-webui-0.5.7.tar.gz ... Passed
    open-webui.service ... Passed
    open-webui.conf ... Passed
==> Making package: open-webui 0.5.7-1 (Thu Jan 30 01:49:43 2025)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found open-webui-0.5.7.tar.gz
  -> Found open-webui.service
  -> Found open-webui.conf
==> Validating source files with sha1sums...
    open-webui-0.5.7.tar.gz ... Passed
    open-webui.service ... Passed
    open-webui.conf ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting open-webui-0.5.7.tar.gz with bsdtar
bsdtar: Failed to set default locale
==> Starting prepare()...
Downloading and installing node v20.18.2...
Downloading https://nodejs.org/dist/v20.18.2/node-v20.18.2-linux-x64.tar.xz...
##################################################################################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
manpath: can't set the locale; make sure $LC_* and $LANG are correct
Now using node v20.18.2 (npm v10.8.2)
Creating default alias: default -> lts/iron (-> v20.18.2)
==> Sources are ready.
open-webui-0.5.7-1: parsing pkg list...
==> Making package: open-webui 0.5.7-1 (Thu Jan 30 01:49:50 2025)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
manpath: can't set the locale; make sure $LC_* and $LANG are correct

added 462 packages, and audited 463 packages in 31s

94 packages are looking for funding
  run `npm fund` for details

3 low severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> open-webui@0.5.7 format
> prettier --plugin-search-dir --write "**/*.{js,ts,svelte,css,md,html,json}"

sh: line 1: prettier: command not found
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'open-webui-0.5.7-1': 
error: packages failed to build: open-webui-0.5.7-1

LANG=en_US makepkg: see attached makepkg.log, too large to paste into the issue.

paru.conf
#
# $PARU_CONF
# /etc/paru.conf
# ~/.config/paru/paru.conf
#
# See the paru.conf(5) manpage for options

#
# GENERAL OPTIONS
#
[options]
PgpFetch
Devel
Provides
DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil
#AurOnly
#BottomUp
#RemoveMake
#SudoLoop
#UseAsk
#SaveChanges
#CombinedUpgrade
#CleanAfter
#UpgradeMenu
#NewsOnUpgrade

#LocalRepo
#Chroot
#Sign
#SignDb
#KeepRepoCache

#
# Binary OPTIONS
#
#[bin]
#FileManager = vifm
#MFlags = --skippgpcheck
#Sudo = doas
pacman.conf
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
Color
#NoProgressBar
CheckSpace
#VerbosePkgLists
ParallelDownloads = 5

# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel    = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#   - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[core-testing]
#Include = /etc/pacman.d/mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

#[extra-testing]
#Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

[multilib]
Include = /etc/pacman.d/mirrorlist

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

#[arch4edu]
#Server = https://de.arch4edu.mirror.kescher.at/$arch
#Server = https://mirror.sunred.org/arch4edu/$arch
makepkg.conf
#!/hint/bash
#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
          'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#-- The package required by makepkg to download VCS sources
#  Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr'
            'fossil::fossil'
            'git::git'
            'hg::mercurial'
            'svn::subversion')

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"

#-- Compiler and Linker Flags
#CPPFLAGS=""
# used to have -march=x86-64 -mtune=generic
CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS="-flto=auto"
RUSTFLAGS="-C opt-level=2 -C target-cpu=native"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j$(nproc)"
#-- Debugging flags
DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
#DEBUG_RUSTFLAGS="-C debuginfo=2"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:     Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
#  A negated option will do the opposite of the comments below.
#
#-- strip:      Strip symbols from binaries/libraries
#-- docs:       Save doc directories specified by DOC_DIRS
#-- libtool:    Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs:  Leave empty directories in packages
#-- zipman:     Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:      Remove files specified by PURGE_TARGETS
#-- debug:      Add debugging flags as specified in DEBUG_* variables
#-- lto:        Add compile flags for building with link time optimization
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)

#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(sha256)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#-- Directory to store source code in for debug packages
DBGSRCDIR="/usr/src/debug"

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/makepkglogs
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"
#-- Specify a key to use for package signing
#GPGKEY=""

#########################################################################
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z --threads=0 -)
COMPRESSZST=(zstd -c -z -q --threads=0 -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q)
COMPRESSLZ=(lzip -c -f)

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
PKGEXT='.pkg.tar.zst'
SRCEXT='.src.tar.gz'

#########################################################################
# OTHER
#########################################################################
#
#-- Command used to run pacman as root, instead of trying sudo and su
#PACMAN_AUTH=()
PKGBUILD
# Maintainer: Aseem Athale <athaleaseem@gmail.com>

_appprefix="/opt"
_appdataprefix="/var/opt"

pkgname=open-webui
pkgver=0.5.7
pkgrel=1
pkgdesc="Web UI and OpenAI API for various LLM runners, including Ollama"
arch=('any')
url="https://github.com/open-webui/open-webui"
license=('MIT')
depends=('python312')
makedepends=('npm' 'nvm')
optdepends=('ollama' 'tika-server')
conflicts=('open-webui-git')
source=("${pkgname}-${pkgver}.tar.gz"::"${url}/archive/refs/tags/v${pkgver}.tar.gz"
    "open-webui.service"
    "open-webui.conf")

install="${pkgname}.install"
sha1sums=('3520586bf05dd6e800c2a9cfa68950435097c5d2'
          '9b789adb8d91f15ece2187af4aec810847d4b0b2'
          'fb015c224b9529988823f0e24d65ab4a004d30c0')
options=(!strip !debug)

_ensure_local_nvm() {
    # let's be sure we are starting clean
    which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
    export NVM_DIR="${srcdir}/.nvm"

    # The init script returns 3 if version specified
    # in ./.nvrc is not (yet) installed in $NVM_DIR
    # but nvm itself still gets loaded ok
    source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
}

prepare() {
    _ensure_local_nvm
    nvm install lts/iron
}

build() {
    _ensure_local_nvm
    cd "${pkgname}-${pkgver}"
    export NODE_OPTIONS="--max_old_space_size=4096"
    npm install
    npm run format
    npm run i18n:parse
    npm run build
}

check() {
    _ensure_local_nvm
    cd "${pkgname}-${pkgver}"
    export NODE_OPTIONS="--max_old_space_size=4096"
    npm run test:frontend
}

package() {
    # Install systemd service
    install -Dm644 "./$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"

    # Install license
    install -Dm 644 "$srcdir/${pkgname}-${pkgver}"/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"

    # Install the default config file to /usr/share/$pkgname/open-webui.conf
    install -d "$pkgdir/usr/share/$pkgname"
    install -Dm644 "./$pkgname.conf" "$pkgdir/usr/share/$pkgname/$pkgname.conf"

    # Copy source to app's home directory
    parent_dir="$pkgdir/${_appprefix}"  # /opt

    install -d "$pkgdir/${_appprefix}/$pkgname"
    install -d "$pkgdir/${_appdataprefix}/$pkgname"
    install -d "$pkgdir/${_appdataprefix}/$pkgname/data"

    # copy over files
    cp -R "$srcdir/${pkgname}-${pkgver}/." "$pkgdir/${_appprefix}/$pkgname"

    # clean up stuff we don't need
    rm -rf "$pkgdir/${_appprefix}/$pkgname/node_modules"
    rm -rf "$pkgdir/${_appprefix}/$pkgname/.git"

    # Fix permissions
    echo "Setting permissions for $pkgdir${_appprefix}/$pkgname"
    chmod 755 "$pkgdir/${_appprefix}/$pkgname"
    find "$pkgdir/${_appprefix}/$pkgname" -type d -exec chmod 755 {} \;
    find "$pkgdir/${_appprefix}/$pkgname" -type f -exec chmod 644 {} \;

    echo "Setting permissions for $pkgdir${_appdataprefix}/$pkgname"
    chmod 700 "$pkgdir/${_appdataprefix}/$pkgname"
    find "$pkgdir/${_appdataprefix}/$pkgname" -type d -exec chmod 700 {} \;
    find "$pkgdir/${_appdataprefix}/$pkgname" -type f -exec chmod 664 {} \;
}
@yobson1
Copy link

yobson1 commented Feb 10, 2025

This package: https://aur.archlinux.org/packages/bs-manager-git also fails with paru but works fine if I clone and makepkg -si and also uses nvm to manage the node version it uses. If I manually edit the PKGBUILD to also

export NVM_DIR="${srcdir}/.
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
nvm use 22

in build() it works with paru -Bi .

PKGBUILD
# Maintainer: Pierce Thompson <pierce at insprill dot net>

pkgname=bs-manager-git
pkgver=v1.4.13.r20.g5462c88
pkgrel=1
pkgdesc="An all-in-one tool for managing Beat Saber versions, maps, mods, and more"
arch=("x86_64")
url="https://github.com/Zagrios/bs-manager"
license=('GPL')
depends=()
makedepends=('git' 'nvm' 'npm')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=('!strip') # DepotDownloader breaks without this
source=(
'git+https://github.com/Zagrios/bs-manager.git'
"${pkgname%-git}.desktop"
)
sha256sums=(
'SKIP'
'cb35ac15f308e0dca35aa2a948f3102eb96ec0c9faa1771b91d5a49309398874'
)

pkgver() {
  cd "${pkgname%-git}"
  git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${pkgname%-git}"

  command -v nvm >/dev/null && nvm deactivate && nvm unload
  export NVM_DIR="${srcdir}/.nvm"
  source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
  nvm install 22
}

build() {
  cd "${pkgname%-git}"

  npm install
  npm run build
  npx electron-builder --config electron-builder.config.js --publish never --linux pacman --x64
}

package() {
  cd "${pkgname%-git}"

  install -d "$pkgdir/opt/${pkgname%-git}"
  cp -r "release/build/linux-unpacked/". "$pkgdir/opt/${pkgname%-git}/"

  install -Dm644 "$srcdir/${pkgname%-git}.desktop" "$pkgdir/usr/share/applications/${pkgname%-git}.desktop"
  install -Dm644 "resources/readme/SVG/icon.svg" "$pkgdir/usr/share/pixmaps/${pkgname%-git}.svg"
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/${pkgname%-git}"
  install -Dm644 "README.md" -t "$pkgdir/usr/share/doc/${pkgname%-git}"
}

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

No branches or pull requests

2 participants