Skip to content

Instantly share code, notes, and snippets.

@gwpl
Last active May 25, 2019 22:12
Show Gist options
  • Save gwpl/0e4a3ae4d4e21e429b324808cdca3e46 to your computer and use it in GitHub Desktop.
Save gwpl/0e4a3ae4d4e21e429b324808cdca3e46 to your computer and use it in GitHub Desktop.
2017-12-17 Daedalus on ArchLinux - building notes by Grzegorz Wierzowiecki

To easy finding this gist Let me put here links that suggested me to downgrade jemalloc to resolve my issues:

plus how issues looked like to easy finding in search engines:

$ pacaur -S daedalus-bridge  # same for pacaur -S cardano-sl

(...)

cardano-sl-db-1.0.3: build (lib)
Log files have been written to: /home/XXX/.cache/pacaur/cardano-sl/src/cardano-sl/.stack-work/logs/
Progress: 1/12
--  While building custom Setup.hs for package cardano-sl-db-1.0.3 using:
      /home/XXX/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0 build lib:cardano-sl-db --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/XXX/.cache/pacaur/cardano-sl/src/cardano-sl/.stack-work/logs/cardano-sl-db-1.0.3.log

    Configuring cardano-sl-db-1.0.3...
    Preprocessing library cardano-sl-db-1.0.3...
    [ 5 of 13] Compiling Pos.DB.Pure      ( Pos/DB/Pure.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0/build/Pos/DB/Pure.o )
    <command line>: can't load .so/.DLL for: /home/XXX/.cache/pacaur/cardano-sl/src/cardano-sl/.stack-work/install/x86_64-linux-tinfo6/lts-9.1/8.0.2/lib/x86_64-linux-ghc-8.0.2/libHSrocksdb-haskell-1.0.0-ASh627zSIahH8QxTbLrgnb-ghc8.0.2.so (/usr/lib/libjemalloc.so.2: cannot allocate memory in static TLS block)
==> ERROR: A failure occurred in build().
    Aborting...
:: failed to build daedalus-bridge package(s)
# Notes, how to build cardano-sl , daedalus-bridge, daedalus from 2017-12-17 by Grzegorz Wierzowiecki
#
# First of all thank you to all Arch contributors under related packages staring from
# https://aur.archlinux.org/pkgbase/cardano-sl/ daedalus, daedalus-bridge, ncurses5-compat-libs and following dependencies
# so all their advices combined, plus others in resources referenced below enabled me to build daedalus Today.
#
# Following @tensor5 advice (here https://aur.archlinux.org/pkgbase/cardano-sl/ in comments from 2017-12-17)
# , remove gperftools , recompile rocksdb :
pacman -R gperftools
pacman -R rocksdb && pacaur -S rocksdb
# Downgrading jemalloc to 4.5.0 (optional, only if you get described error)
# In my case it was required to downgrade jemalloc to 4.5.0,
# as I was getting error "can't load .so/.DLL for: /home/XXX/.cache/pacaur/cardano-sl/src/cardano-sl/
# .stack-work/install/x86_64-linux-tinfo6/lts-9.1/8.0.2/lib/x86_64-linux-ghc-8.0.2/
# libHSrocksdb-haskell-1.0.0-ASh627zSIahH8QxTbLrgnb-ghc8.0.2.so
# (/usr/lib/libjemalloc.so.2: cannot allocate memory in static TLS block)" (I broke line as it was very long)
# following advices :
# * https://github.com/jemalloc/jemalloc/issues/955
# * https://github.com/commercialhaskell/stack/issues/3220
#
# using attached here PKGBUILD file
mkdir jemalloc-4.5.0 && cd jemalloc-4.5.0 && cp ../'PKGBUILD for jemalloc 4.5.0' PKGBUILD \
&& makepkg && sudo pacman -U jemalloc-1:4.5.0-3-x86_64.pkg.tar.xz
# In order to build and install dependency of ncourses
# you need to add key to keyring to trust package author.
# You have few ways, e.g.
# * just follow advices how to do this and how to add required key to keyring to trust package author,
# people discuss this on package page https://aur.archlinux.org/packages/ncurses5-compat-libs/
# * get more insights regarding Two PGP Keyrings for Package Management on ArchLinux
# http://allanmcrae.com/2015/01/two-pgp-keyrings-for-package-management-in-arch-linux/
#
# With this knowledge you should be able to install dependency package:
# https://aur.archlinux.org/packages/ncurses5-compat-libs/
# e.g.
pacaur -S ncurses5-compat-libs
# Now ready to build
pacaur -S daedalus # or daedalus-bridge cardano-sl , whatever you like!
# $Id$
# Grzegorz :
# I've made this file by
# * taking this for 5.0.1 https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/jemalloc
# * changing pkgver=4.5.0 and sha256sum to match. (release notes: https://github.com/jemalloc/jemalloc/releases/tag/4.5.0 )
# I also attach original PKGBUILD for 5.0.1 as reference.
# Below changed contents of this file:
#
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Kovivchak Evgen <oneonfire@gmail.com>
pkgname=jemalloc
epoch=1
pkgver=4.5.0
pkgrel=3
pkgdesc='General-purpose scalable concurrent malloc implementation'
arch=('x86_64')
license=('BSD')
url='http://www.canonware.com/jemalloc/'
depends=('glibc')
provides=('libjemalloc.so')
optdepends=('perl: for jeprof')
source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2")
sha256sums=('9409d85664b4f135b77518b0b118c549009dc10f6cba14557d170476611f6780')
build() {
cd $pkgname-$pkgver
./configure --prefix=/usr
make
}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
# $Id$
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Kovivchak Evgen <oneonfire@gmail.com>
pkgname=jemalloc
epoch=1
pkgver=5.0.1
pkgrel=3
pkgdesc='General-purpose scalable concurrent malloc implementation'
arch=('x86_64')
license=('BSD')
url='http://www.canonware.com/jemalloc/'
depends=('glibc')
provides=('libjemalloc.so')
optdepends=('perl: for jeprof')
source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2")
sha256sums=('4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9')
build() {
cd $pkgname-$pkgver
./configure --prefix=/usr
make
}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment