hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
14.98k stars 3.33k forks source link

Makefile: test: find -executable not a valid BSD find argument #7243

Open rickard-von-essen opened 5 years ago

rickard-von-essen commented 5 years ago

Unfortunately BSD find doesn't have -executable so this check is in practice skipped on macOS and other BSD's. Introduced in 03620d15c2f005783ccba7f5ab78aad1baf49c6c

$ make test
==> Checking that code complies with gofmt requirements...
Check passed.
find: -executable: unknown primary or operator
find: -executable: unknown primary or operator
==> Checking that only certain files are executable...
azr commented 5 years ago

Yes, the commit should have been clearer here. I went for the -executable command as it works in circle-ci and appveyor [1] and I would rather have the ci-tools have the last word. At HashiCorp, we are making circle-ci the main ci tool and the -perm parameter doesn't work in circle-ci

That said, I would also rather have it work everywhere. One thing we can do is check wether the system is bsd/darwin and switch the option in that case.

1: that said appveyor doesn't run make ci ( yet ? )

rickard-von-essen commented 5 years ago

One thing we can do is check wether the system is bsd/darwin and switch the option in that case.

That is probably the best solution.

marco-m commented 3 years ago

As an additional data point, also the default build (that is, make without targets) is broken on macOS:

$ make
...
(lot of `mapstructure-to-hcl2` taking minutes ...)
...
==> Checking for necessary tools...
realpath is not on the path. Exiting...
make: *** [bin] Error 1