(It has been a while but the time has come for a new blog entry. Yes, I need to fix my blog.)
I've been trying - and failing - to get the old official ActivityPub test suite up and running in a container. I figure if it's in a container it's easier for people to run without having to become familiar with guix or scheme, but it might also be enough to persuade someone to bring the test suite up to data and maintain it. I've failed to get it running though. I have now run into this issue already in the pubstrate repo. Maybe you can take it further?
Getting to this point is a headache because guix and docker both seem to want to fight over who is in ch...
(It has been a while but the time has come for a new blog entry. Yes, I need to fix my blog.)
I've been trying - and failing - to get the old official ActivityPub test suite up and running in a container. I figure if it's in a container it's easier for people to run without having to become familiar with guix or scheme, but it might also be enough to persuade someone to bring the test suite up to data and maintain it. I've failed to get it running though. I have now run into this issue already in the pubstrate repo. Maybe you can take it further?
Getting to this point is a headache because guix and docker both seem to want to fight over who is in charge, so while guix can output a docker image, it doesn't run well inside docker and some operations can take a very long time.
There are almost certainly better, easier ways to do this, but I don't know enough guix to know what they are.
So, here's what you can do to get to get pubstrate nearly running in a container.
Instructions
Run git clone https://gitlab.com/dustyweb/pubstrate and cd into that directory.
Add a basic Dockerfile with the following contents:
FROM ubuntu:lunar
RUN apt-get update && apt-get install -y guix guile-3.0-dev
WORKDIR /usr/src/app
COPY . .
Build the container with:
docker build -t pubstrate-builder .
Run the container with:
docker run -it --privileged pubstrate-builder bash
In the new bash shell you've just started, run this to start the guix-daemon in the background:
guix-daemon --build-users-group=_guixbuild &
Now update guix (be patient!) by running (this operation requires the --privileged flag in docker run, which is why it isn't be done in the Dockerfile):
guix pull
Load the guix profile by executing these two lines:
GUIX_PROFILE="/root/.config/guix/current". "$GUIX_PROFILE/etc/profile"
Build pubstrate (be patient again!) with:
guix environment -l guix.scm
This is where it fails.
As far as I can tell, make check-TESTS in 8sync fails. pubstrate depends on a specific git commit of 8sync - commit 7972787723d08a491379b63e6e5dc1cc6a3fac87 - and make check-TESTS looks like it fails in that version. The run-hive function signature in the latest 8sync releases seems quite different, so switching to a different, later version of 8sync seems non-trivial.
Here's the tail of the log:
wrote `8sync/systems/web.go'
wrote `8sync/contrib/sha-1.go'
wrote `8sync/systems/irc.go'
WARNING: (#{8sync}# repl): imported module (fibers) overrides core binding `sleep'
wrote `8sync/systems/websocket/utils.go'
wrote `8sync/systems/websocket/server.go'
wrote `8sync/systems/websocket/client.go'
wrote `8sync/systems/websocket/frame.go'
wrote `8sync/actors.go'
phase `build' succeeded after 3.1 seconds
starting phase `check'
make check-TESTS
make[1]: Entering directory '/tmp/guix-build-guile-8sync-git.drv-0/source'
make[2]: Entering directory '/tmp/guix-build-guile-8sync-git.drv-0/source'
FAIL: tests/test-rmeta-slot.scm
FAIL: tests/test-actors.scm
============================================================================
Testsuite summary for 8sync 0.4.2
============================================================================
# TOTAL: 2
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
Please report to cwebber@dustycloud.org
============================================================================
make[2]: *** [Makefile:856: test-suite.log] Error 1
make[2]: Leaving directory '/tmp/guix-build-guile-8sync-git.drv-0/source'
make[1]: *** [Makefile:964: check-TESTS] Error 2
make[1]: Leaving directory '/tmp/guix-build-guile-8sync-git.drv-0/source'
make: *** [Makefile:1164: check-am] Error 2
Test suite failed, dumping logs.
— ./test-suite.log ––––––––––––––––––––––––––––
===================================
8sync 0.4.2: ./test-suite.log
TOTAL: 2
PASS: 0
SKIP: 0
XFAIL: 0
FAIL: 2
XPASS: 0
ERROR: 0
.. contents:: :depth: 2
FAIL: tests/test-actors
Backtrace:
4 (primitive-load "/tmp/guix-build-guile-8sync-git.drv-0/…")
In ice-9/eval.scm:
155:9 3 (_ #(#(#<directory (tests utils) 7ffff1d2eaa0>)))
159:9 2 (_ #(#(#<directory (tests utils) 7ffff1d2eaa0>)))
263:9 1 (_ #(#(#<directory (tests utils) 7ffff1d2eaa0>) #f))
155:9 0 (_ _)
ice-9/eval.scm:155:9: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f
%%%% Starting test test-actors (Writing full log to "test-actors.log")
of expected passes 9
Some deprecated features have been used. Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information. Set it to "no" to suppress
this message.
FAIL tests/test-actors.scm (exit status: 1)
FAIL: tests/test-rmeta-slot
Backtrace:
4 (primitive-load "/tmp/guix-build-guile-8sync-git.drv-0/…")
In ice-9/eval.scm:
155:9 3 (_ #(#(#<directory (tests utils) 7ffff7563500>)))
159:9 2 (_ #(#(#<directory (tests utils) 7ffff7563500>)))
263:9 1 (_ #(#(#<directory (tests utils) 7ffff7563500>) #f))
155:9 0 (_ _)
ice-9/eval.scm:155:9: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f
%%%% Starting test test-rmeta-slot (Writing full log to "test-rmeta-slot.log")
of expected passes 7
FAIL tests/test-rmeta-slot.scm (exit status: 1)
error: in phase ‘check’: uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("check" "-j" "8") exit-status: 2 term-signal: #f stop-signal: #f>
phase `check’ failed after 0.3 seconds
command "make" "check" "-j" "8" failed with status 2
Good luck!