Upgrading p4-fusion

The following steps are required to update the version of p4-fusion we use inside our gitserver and server images.

  1. Find the desired release
  2. Update the version here
  3. From within cmd/gitserver, build the image, which will build the binary. NOTE: On M1 macs you’ll need to build for amd64, see details below
docker build -t p4-fusion --target=p4-fusion .
  1. Copy the binary out of the container:
docker create p4-fusion
# This will output a container hash
docker cp CONTAINER_HASH:/usr/local/bin/p4-fusion ./
  1. Compute the sha256 sum of the binary
cat p4-fusion | sha256sum
  1. Upload the binary to https://console.cloud.google.com/storage/browser/sourcegraph-artifacts/p4-fusion, following the path pattern seen there.

  2. Update the sha256 sum and filename here.

Push the changes, the PR should look something like this one. In most cases you won’t need to modify the Helix Core API so that can be ignored.

Extra steps required for M1 macs

You’ll need to configure docker so that the images build for amd64, not arm64.

docker buildx create --use
docker buildx build -t p4-fusion --platform linux/amd64 --target=p4-fusion .