How to develop Finch

- Finch

Overview

This entry describes the basic commands and the configurations for developing Finch on Intel Mac.

Notes

Basic Settings

When you build Finch on M3 MacBook Air, vmType and rosetta in ~/.finch/finch.yaml must be set as follows.

haytok ~/workspace/finch [main]
> cat ~/.finch/finch.yaml
cpus: 4
memory: 6GiB
vmType: vz
rosetta: true

Basic commands

Init VM

haytok finch
> ./_output/bin/finch vm init
INFO[0000] Initializing and starting Finch virtual machine...
INFO[0110] Finch virtual machine started successfully

Check VM status

haytok finch
> ./_output/bin/finch vm status
Nonexistent

Stop VM

haytok finch 
> ./_output/bin/finch vm stop
INFO[0000] Stopping existing Finch virtual machine...
INFO[0005] Finch virtual machine stopped successfully

Start VM

haytok finch 
> ./_output/bin/finch vm start
INFO[0000] Starting existing Finch virtual machine...
INFO[0039] Finch virtual machine started successfully

Remove VM

haytok finch 
> ./_output/bin/finch vm remove
INFO[0000] Removing existing Finch virtual machine...
INFO[0000] Finch virtual machine removed successfully

Access VM

haytok finch [main]
> LIMA_HOME=/Users/haytok/workspace/finch/_output/lima/data/ /Users/haytok/workspace/finch/_output/lima/bin/limactl shell finch
[haytok@lima-finch finch]$

Tests

Run specific tests

go test -run TestSettingsVMAction_run

Configuration 1

The following network error may occur when executing the make command.

pkg/lima/wrapper/lima_wrapper.go:10:2: github.com/lima-vm/lima@v0.20.0: Get "https://proxy.golang.org/github.com/lima-vm/lima/@v/v0.20.0.zip": dial tcp: lookup proxy.golang.org: i/o timeout

This error can be resolved by setting environment variables.

haytok finch
> export GOPROXY=direct

Reference

Configuration 2

Setup for local tests using local common-tests repository.

go mod edit -replace github.com/runfinch/common-tests=../common-tests

Edit