tinkerbell / lint-install

Consistently install reasonable linter rules for open-source projects
Apache License 2.0
6 stars 7 forks source link

Fail gracefully on architectures with unsupported binaries #8

Closed tstromberg closed 2 years ago

tstromberg commented 2 years ago

hadolint on Linux arm64 is a notable example.

jacobweinstock commented 2 years ago

Hey, @tstromberg or @mmlb any chance either of you could point us who aren't that familiar with this repo to how we could get started with helping on this issue?

mmlb commented 2 years ago

hadolint only supports x86_64 so the makefile should probably detect that its running in an unsupported arch and skip execution... how exactly is tbd.

https://github.com/tinkerbell/lint-install/blob/main/Makefile#L13-L18 is the entry point for the currently known troublesome tools.

mmlb commented 2 years ago

One option could be something like (for hadolint on https://github.com/tinkerbell/lint-install/blob/main/Makefile.tmpl#L45 lets say)

HADOLINT_BIN := out/linters/hadolint-$(HADOLINT_VERSION)-$(LINT_ARCH)
ifeq ($(LINT_OS),Darwin)
    ifeq ($(LINT_ARCH),arm64)
HADOLINT_BIN := $(shell which true)
    endif
endif
...

I think would work as one option. Then the rest of the makefile would skip fetching hadolint because true (presumably /bin/true or other path exists) and then it'd call /bin/true .... which is effectively a nop.

tstromberg commented 2 years ago

PR #35 addresses the issue, FWIW.