Using and troubleshooting builds

Getting started

Clone the repository (the examples assume we're extracting to ~/projects)

mkdir ~/projects

cd ~/projects

git clone git@gitlab.webhare.com:webhare/webhare.git

Make and install:

~/projects/webhare/whtree/bin/wh mic

In general, we recommend adding 'wh' to your path. The easiest way to do this, which also earns you the 'whcd' command an some autocompletion, is by adding:

eval `~/projects/webhare/whtree/bin/wh setupmyshell`

to your ~/.profile or ~/.bash_profile.

Setup default interface port for WebHare:

wh setup 8000

Run `wh fixmodules` once to update NPM dependencies.

Visit the provided URL and finish the install wizard.

Building docker

# Recommended: set up a cache server for faster (re)builds

docker network create ci_network

docker run -d --restart always --name ccache --network ci_network --network-alias ccache -v ccache-memcache:/opt/memcache-data webhare/ccache-memcached-server:latest

# start the docker build

wh builddocker

Advanced build flags

WHBUILD_DEBUG=1 - Use whbuild.debug and build versions with extra debugging

Troubleshooting common build failures

Try repeating the make command. If you only see 'error' or 'waiting for finished jobs' you may have to scroll up a bit to find the error (make often runs multiple tasks at the same time. if one task reported an error, it will finish the other running jobs so you may need to look for the error).

Before you try anything else, make sure you are up-to-date and try the fixbuild option and see if it fixes your issue:

# This executes various cleanupsteps that usually fix ICU or NPM issues
wh fixbuild

"No rule to make target"

These errors are usually fixed by running `wh make clean-deps`

If tests are failing and you want to ignore this, run `NOTEST=1 wh mic`.

"TestLocalization: VersionTest yielded errors"

If 'got' is lower than 'expected', you need to update your ICU library. On OSX, a 'brew update' will update your brew definitions, after which it should carry out this update.

If 'got' is higher than 'expected', update or let us know.

"Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.55.dylib Referenced from: /wh/whbuild/blex/tests/dynamic.dylib"

This error, and similar errors, may be caused by updating libraries (especially when the error refers to an older version of the library, like icu v55 above). Try `wh make clean-libs` to remove all compiled libraries

lib/hsm_wh_icu.dylib Error 1

There were probably errors building the icu provider, and the autodependency checking tends to be bad at picking up icu recompiles, at least on OSX.

Run `wh make clean-icu-provider` to specifically reset the ICU module. If ICU issues persist, consider downgrading to an earlier version. On OSX with brew:

# Show available versions
brew list --versions icu4c
# this will return something like: icu4c 59.1_1 60.2

# Pick an earlier version
brew switch icu4c 59.1_1

libssh2: Unknown `--is-lightweight' option

This is usually caused by broken or out-of-date command line tools on OSX.

Update Xcode, start Xcode and make sure you accepted the EULA and it got a chance to download updated command line tools.

After this, you'll probably have to go through a 'wh fixbuild'.

If you're about to give up:

# Discard build directory and resetup the build proces
rm -rf ~/projects/whbuild && wh setupbuild && wh mic

but of course, we'd like to hear from you where you got stuck so we can help prevent this in the future.

Comments