tinkerbell/lint-install

Fail gracefully on architectures with unsupported binaries

Closed this issue · 4 comments

hadolint on Linux arm64 is a notable example.

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

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

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.

PR #35 addresses the issue, FWIW.