Up to Main Index                               Up to Journal for May, 2024

                      JOURNAL FOR SUNDAY 26TH MAY, 2024

SUBJECT: It’s alive!
   DATE: Sun 26 May 22:48:11 BST 2024

Back in mid March my Raspberry Pi 3B went off-line :( ’Twas the power supply
that failed — it was over 10 years old and came from “ModMyPi” before they
became “The Pi Hut”. Anyway, after procrastinating over spending £7.60+P&P, I
ordered an official Raspberry Pi 2.5A power supply. Yes, bloody ridiculous
when you have to seriously consider spending a tenner…

Today, procrastinations complete after only 10 weeks, I turned the RPi3B back
on and it fired right up. I’ve updated it’s packages and built the latest Go
1.22.3 from source on it.

For unknown reasons, package updates for the Raspberry Pi OS 32-bit testing
distribution stopped on 27th February. 64-bit testing packages remained fine.
As I run several Raspberry Pi with 32-bit testing I tried several times to
draw somebody’s attention to the issue. New and updated packages started
arriving again on the 18th May. Don’t know if it was my posting to the forums
again or not, but thank you to whoever sorted out the issue :)

After many hours and 4 failures trying to build Go from source on the RPi3B,
the final build took around an hour. Stressing the RPi3B for hours and the new
power supply stayed nice and cool.

During the builds I hit a default 10 minute timeout for the ‘../test’ tests.
Odd, that didn’t happen with any other builds before Go 1.22? *sigh*

I ended up adding another environment variable, GO_TEST_TIMEOUT_SCALE, to the
build command. For reference, the final build command I used on the RPi3B was:

    GOTMPDIR=~/tmp TMPDIR=~/tmp ./all.bash | tee ./build.log

Building Go on a Raspberry Pi from source. This has always been an issue on
the more constrained RPi. Although Go can be built, even on a RPi Zero, and I
have instructions[1] for doing so. It looks like I need to review and update
those instructions. For one, it seems the way RPiOS uses a 64-bit kernel with
32-bit userland is confusing the Go build. For two, it seems building Go now
uses a LOT more disk space in the /tmp directory. For the last RPi Zero build
of Go 1.21.5 I had used the following incantation:

    GOARM=5 GOTMPDIR=~/tmp TMPDIR=~/tmp ./all.bash

This is annoying as GOARM=6 should work on the RPi zero. I need to investigate
this more and try with Go 1.22.3. However, compiling Go on the RPi Zero takes
about 9½ hours :/

Throwing in a “ulimit -s 1024” before the build to limit the stack size helps
a lot too.

Hrmm, updating the RPi Zero to Go 1.22.3 would be an ideal time to take notes
and update the instructions. Something else I noticed, the build needs to be
pointed at a particular version of Go using GOROOT_BOOTSTRAP. Previously the
build would pick a usable version. Now I have to specify GOROOT_BOOTSTRAP,
otherwise you get an error like the following displayed:

    can’t load package: package ./cmd/dist: found packages build.go (main)
    and notgo120.go (building_Go_requires_Go_1_20_6_or_later) in

My current version of Go is symlinked to ~/golang, the symlink can then be
changed to point to any Go version I have installed for testing. Very handy.

I was going to spend today programming, instead I ended up writing and playing
with Raspberry Pi :/


  [1] Building Go from source on a raspberry pi: /annex/building-go-on-rpi.html

  Up to Main Index                               Up to Journal for May, 2024