Skip to content

Update gitignore to ignore config files that we don't want interfering with builds

Davis Bickford requested to merge dbickford-remove-asdf-config into master

asdf tool version config files are included in git and should not be.

The .tool-versions file is causing problems for users who have go installed via asdf.

What is happening:

  • make lint command is called inside gitlab-runner
  • goargs is pulled in
  • a custom linting analyzer is generated using the version of go that is set in .tool-versions in the goargs repo
  • the current version of golang in the terminal, set by asdf, will attempt to use the goargs analyzer
  • if the terminal's go version does not match the goargs go version, the following error will happen:
ERRO Unable to load custom analyzer goargs:.tmp/goargs.so, plugin.Open("/Users/davisbickford/workspace/gitlab/runner-repos-for-testing-lint/gitlab-runner/.tmp/goargs"): plugin was built with a different version of package runtime
ERRO Running error: unknown linters: 'goargs', run 'golangci-lint help linters' to see the list of supported linters
make: *** [lint] Error 3

QA Steps (need a couple QA people, someone with asdf golang install and someone without)

MR in gitlab-runner pointing to this branch - static analysis job succeeds

Person with asdf golang install

  • On a computer with golang installed via asdf
  • terminal into the gitlab-runner repo
  • run asdf local golang 1.18.7 ; rm .tmp/goargs.so ; make clean ; make lint
  • confirm you get the error up above regarding the custom analyzer
  • within the gitlab-runner repo, update this line in Makefile to clone this branch instead:
    • git clone --branch dbickford-remove-asdf-config https://gitlab.com/gitlab-org/language-tools/go/linters/goargs.git --no-tags --depth 1 $(TOOL_BUILD_DIR)
  • back in the terminal, run rm .tmp/goargs.so ; make clean ; make lint
  • this time, no error. Bonus points if you put put a linting issue in a file to confirm output works.

Person with NON-asdf golang install

Edited by Davis Bickford

Merge request reports