ok-ryoko / turret

Build rootless OCI images of Linux-based distros declaratively
Apache License 2.0
0 stars 0 forks source link

Go CI workflow is failing #1

Closed ok-ryoko closed 1 year ago

ok-ryoko commented 1 year ago

Code of conduct

Problem statement

The workflow is failing to lint Go source code with golangci-lint. Here’s the log output:

Run make check
  make check
  shell: /usr/bin/bash -e {0}
if ! command -v golangci-lint; then \
    echo 'missing golangci-lint; run \\'make setup\\''; \
    exit 1; \
fi
/home/runner/go/bin/golangci-lint
golangci-lint --version
golangci-lint has version v1.52.2 built with go1.20.4 from (unknown, mod sum: "h1:FrPElUUI5rrHXg1mQ7KxI1MXPAw5lBVskiz7U7a8a1A=") on (unknown)
golangci-lint --verbose run
level=info msg="[config_reader] Config search paths: [./ /home/runner/work/turret/turret /home/runner/work/turret /home/runner/work /home/runner /home /]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="[lintersdb] Active 13 linters: [errcheck exhaustive goimports gosec gosimple govet ineffassign staticcheck typecheck unconvert unparam unused wrapcheck]"
level=info msg="[loader] Go packages loading at mode 575 (compiled_files|deps|imports|name|exports_file|files|types_sizes) took 36.828023956s"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 2.251649ms"
level=info msg="[linters_context/goanalysis] analyzers took 45.977321458s with top 10 stages: buildir: 28.84060319s, exhaustive: 11.598320816s, inspect: 1.247150824s, printf: 1.051049577s, ctrlflow: 892.510776ms, fact_deprecated: 779.253693ms, fact_purity: 496.259631ms, nilness: 460.806959ms, SA5012: 346.564871ms, typedness: 262.807079ms"
level=warning msg="[runner] Can't run linter goanalysis_metalinter: inspect: failed to load package buildah: could not load export data: no export data for \"github.com/containers/buildah\""
level=info msg="[runner] processing took 4.4µs with stages: max_from_linter: 700ns, max_same_issues: 500ns, skip_dirs: 500ns, nolint: 300ns, path_prettifier: 300ns, fixer: 200ns, skip_files: 200ns, max_per_file_from_linter: 200ns, filename_unadjuster: 200ns, cgo: 200ns, exclude-rules: 200ns, source_code: 200ns, identifier_marker: 200ns, sort_results: 100ns, exclude: 100ns, autogenerated_exclude: 100ns, uniq_by_line: 100ns, path_shortener: 100ns, severity-rules: 0s, diff: 0s, path_prefixer: 0s"
level=info msg="[runner] linters took 22.556754891s with stages: goanalysis_metalinter: 22.55628128s"
level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: inspect: failed to load package buildah: could not load export data: no export data for \"github.com/containers/buildah\"\n\n"
level=info msg="Memory: 595 samples, avg is 160.1MB, max is 548.6MB"
level=info msg="Execution took 59.394437963s"
make: *** [Makefile:13: check] Error 3
Error: Process completed with exit code 2.

Supporting information

ok-ryoko commented 1 year ago

The workflow was failing because one or more external libraries were not installed in the Ubuntu 22.04 image. Minimal dependency sets for importing the Go buildah package are documented here. In our case, we needed libbtrfs-dev, libdevmapper-dev and libgpgme11-dev.