Httplab example error

I run snapcraft in $GOPATH/src/github.com/httplab/
I’m using the latest ubuntu 18. What am I doing wrong?

Here is my yaml file.


name: test-httplab-josephbudd
version: git
summary: An interactive web server.
description: >
  HTTPLab let you inspect HTTP requests and forge responses.
 
grade: devel
confinement: devmode

base: core18
 
parts:
  httplab:
    plugin: go
    go-importpath: github.com/gchaincl/httplab
    source: .
    source-type: git
 
apps:
  test-httplab-josephbudd:
    command: bin/httplab

Here is the end of the dump from snapcraft.


snapd is not logged in, snap install commands will use sudo
go 1.11.5 from Michael Hudson-Doyle (mwhudson) installed
Channel latest/stable for go is closed; temporarily forwarding to stable.
Pulling httplab 
Cloning into '/root/parts/httplab/src'...
done.
go get -t -d ./github.com/gchaincl/httplab/...
Building httplab 
go build -o /root/parts/httplab/go/bin/httplab github.com/gchaincl/httplab/cmd/httplab
# runtime/cgo
exec: "gcc": executable file not found in $PATH
Failed to run 'go build -o /root/parts/httplab/go/bin/httplab github.com/gchaincl/httplab/cmd/httplab' for 'httplab': Exited with code 2.
Verify that the part is using the correct parameters and try again.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
An error occurred when trying to execute 'sudo -i snapcraft snap' with 'multipass': returned exit code 2.

Looks like the build machine is missing the gcc compiler.

exec: "gcc": executable file not found in $PATH

Try this.

version: git
summary: An interactive web server.
description: >
  HTTPLab let you inspect HTTP requests and forge responses.
 
grade: devel
confinement: devmode

base: core18
 
parts:
  httplab:
    plugin: go
    go-importpath: github.com/gchaincl/httplab
    source: .
    source-type: git
    build-packages:
      - gcc
 
apps:
  test-httplab-josephbudd:
    command: bin/httplab

Thank you Popey! That seems to have worked. I have no error message this time.

1 Like