Eric Radman : a Journal

Multiplatform Testing

Hosted build pipelines have are useful because they provide a repeatable test environment, but they leave a gap in a development workflow since they are only run after changes are pushed to a branch.

Distributed Execution

reposync provides a mechanism for replicating a local repository to remote hosts for immedate testing.

$ reposync list
 hostname   rsync_path
----------  ----------
ai1-gx412   openrsync
alpine      rsync
dragonfly   rsync
macmini-m1  rsync
sfdev1      rsync
$ reposync run './configure; make test'

In addition, each platform will raise different warnings by supplying alternate build arguments

make CFLAGS="-Wall" Treat all warnings as errors
make CFLAGS="-O2 -Werror" On some platforms, raise additional warnings when optimizations are applied
scan-build make LLVM static analysis

Emulated Architectures

Sometimes a very slow architecture is useful for shaking out race conditions and tight timeout settings. This can be emulated using Qemu.

Build Docker image riscv64 emulation

FROM riscv64/debian

RUN apt-get update
RUN apt-get -y install build-essential curl
RUN apt-get -y install gawk procps file vim git tmux
RUN mkdir /build
WORKDIR /build
docker build --platform linux/riscv64 -t riscv64-build .

Build/run using Qemu

docker run -it --rm \
  --user "$(id -u):$(id -g)" \
  -v $HOME/git/entr:/build \
  --platform linux/riscv64 \
  -t riscv64-build \
  /bin/sh -c './configure && make test && ./system_test.sh'