Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Segmentation Fault during yarn run on Arch Linux #1145

Closed
AndydeCleyre opened this issue Jul 16, 2018 · 2 comments · Fixed by #1203
Closed

Segmentation Fault during yarn run on Arch Linux #1145

AndydeCleyre opened this issue Jul 16, 2018 · 2 comments · Fixed by #1203
Assignees
Labels
bug Oops, this is a bug

Comments

@AndydeCleyre
Copy link

Ledger Live Version and Operating System

  • tested on Ledger Live 1.0.1
  • Platform and version: Arch Linux

I'm trying to make a PKGBUILD for Arch Linux that actually builds from source.

Here's an in-progress version of the PKGBUILD, while I focus on getting the build function to work:

# Maintainer: Andy Kluger < https://t.me/andykluger >
# Contributor: Stephen Argent <steve [at] tuxcon [dot] com>

pkgname=ledger-live-desktop
pkgver=1.0.1
pkgrel=1
git_rev='c7c5c51e1dd0136251485114e6020ab354789a23'
pkgdesc='Ledger Hardware Wallet management software'
arch=('x86_64')
url="https://github.com/LedgerHQ/${pkgname}"
license=('MIT')
provides=("ledger-live-bin=${pkgver}")
conflicts=("ledger-live-bin=${pkgver}")
makedepends=(yarn python2)
depends=(nodejs-lts-carbon)
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=('c57670765d219d5492b5392b4a22058c93467d236e4ae860a504b795bf923e3f')

prepare() {
  sed -i "s/export GIT_REVISION=\`git rev-parse HEAD\`/export GIT_REVISION='${git_rev}'/" "${pkgname}-${pkgver}/scripts/compile.sh"
}

build() {
  cd "${pkgname}-${pkgver}"
  # yarn dist
  yarn dist:dir
}

package() {
  echo "package ops go here . . ."
  # something like:
  # mkdir -p "$pkgdir/usr/bin"
  # cp ${package} "$pkgdir/usr/bin/ledger-wallet"
  # chmod +x $pkgdir/usr/bin/ledger-wallet
}

Then I attempt to build with:

sudo pacman -S --asdeps nodejs-lts-carbon yarn
makepkg -s

Expected behavior

Build results are placed in a dist folder.

Actual behavior

==> Making package: ledger-live-desktop 1.0.1-1 (Sun 15 Jul 2018 10:06:49 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found ledger-live-desktop-1.0.1.tar.gz
==> Validating source files with sha256sums...
    ledger-live-desktop-1.0.1.tar.gz ... Passed
==> Extracting sources...
  -> Extracting ledger-live-desktop-1.0.1.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
yarn run v1.7.0
$ bash ./scripts/dist-dir.sh
$ bash ./scripts/compile.sh
[1/4] Resolving packages...
warning Resolution field "webpack-sources@1.0.1" is incompatible with requested version "webpack-sources@^1.1.0"
warning Resolution field "webpack-sources@1.0.1" is incompatible with requested version "webpack-sources@^1.1.0"
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > downshift@1.31.16" has unmet peer dependency "prop-types@>=15".
warning " > react-spring@5.3.18" has unmet peer dependency "prop-types@15.x.x".
warning "@storybook/react > babel-loader@7.1.4" has incorrect peer dependency "babel-core@6".
[----------------------------------------------------------------------------------------------------------------------------------------------------] 0/74949./scripts/compile.sh: line 10: 14873 Segmentation fault      (core dumped) yarn
error Command failed with exit code 139.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
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...

Steps to reproduce the behavior

From a user account on Arch:

sudo pacman -S --needed --noconfirm base-devel && sudo pacman -S --asdeps --noconfirm nodejs-lts-carbon yarn
mkdir buildit
cd buildit
# create PKGBUILD file with contents from above
makepkg -s

Or, from any distro with buildah (similar with docker):

ctr=`sudo buildah from docker://base/archlinux`
sudo buildah run $ctr sh
# inside container now
pacman -Syu --noconfirm && pacman -S --needed --noconfirm base-devel nodejs-lts-carbon yarn
useradd -m -G wheel builder && echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/builder && su builder
cd && mkdir buildit && cd buildit
# create PKGBUILD file with contents from above (install preferred text editor)
makepkg -s
@gre gre added the bug Oops, this is a bug label Jul 16, 2018
@meriadec meriadec self-assigned this Jul 16, 2018
@AndydeCleyre
Copy link
Author

No change in results, but updated the version and the sed operation for the new release:

# Maintainer: Andy Kluger < https://t.me/andykluger >
# Contributor: Stephen Argent <steve [at] tuxcon [dot] com>

pkgname=ledger-live-desktop
pkgver=1.0.2
pkgrel=1
git_rev='5b2ffabc47ddd1504fb8482d2657224cfb88fd51'
pkgdesc='Ledger Hardware Wallet management software'
arch=('x86_64')
url="https://github.com/LedgerHQ/${pkgname}"
license=('MIT')
provides=("ledger-live-bin=${pkgver}")
conflicts=("ledger-live-bin=${pkgver}")
makedepends=(yarn python2)
depends=(nodejs-lts-carbon)
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=('794767f6e91a3048017407ad91d1315e729989f31bef31f5ec1ec6c8a6b59776')

prepare() {
  sed -i "s/GIT_REVISION=\$(git rev-parse HEAD)/GIT_REVISION='${git_rev}'/" "${pkgname}-${pkgver}/scripts/compile.sh"
}

build() {
  cd "${pkgname}-${pkgver}"
  # yarn dist
  yarn dist:dir
}

package() {
  echo "package ops go here . . ."
  # something like:
  # mkdir -p "$pkgdir/usr/bin"
  # cp ${package} "$pkgdir/usr/bin/ledger-wallet"
  # ls -l $pkgdir/usr/bin/ledger-wallet
  # chmod +x $pkgdir/usr/bin/ledger-wallet
  # ls -l $pkgdir/usr/bin/ledger-wallet
}

I think I did this right, but I guess it's worth pointing out that I'm replacing the git revision variable with a hard-coded value, as the git dir is not present in the release download, causing compile.sh to fail in its attempt to set the git revision.

@meriadec
Copy link
Member

hey @AndydeCleyre, thanks for your feedback. I ran some tests yesterday with your script, and didn't manage to reproduce the problem on my side (4.17.5-1-ARCH). But we'll provide PKGBUILD for Arch like distributions to AUR as soon as deployment is automated, so you'll be able to test against them.

@amougel amougel added this to the Ledger Live 1.0.4 milestone Jul 17, 2018
meriadec added a commit to meriadec/ledger-live-desktop that referenced this issue Jul 19, 2018
meriadec added a commit to meriadec/ledger-live-desktop that referenced this issue Jul 19, 2018
meriadec added a commit to meriadec/ledger-live-desktop that referenced this issue Jul 19, 2018
This was referenced Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Oops, this is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants