macadmins / osquery-extension

An osquery extension for endpoint engineers
Apache License 2.0
97 stars 32 forks source link

Makefile not working on GitHub build extension action #40

Closed erikng closed 1 year ago

erikng commented 1 year ago

I merged a PR to make a new release, but it's failing when running the "clean" portion of the makefile. I'm not sure why "rm -rf" cares that the folder doesn't exist and exits 2, but it triggers the job to fail.

erikng commented 1 year ago

I'll try and work on it tomorrow if no one has any ideas.

roperzh commented 1 year ago

the root cause seems to be the BUILD file at the root of the repo, and the fact that the worker is probably running in a file system that's case insensitive.

I'm able to repro locally on my macOS machine, I get the same error even trying to create a directory with the name build:

$ mkdir -p build/linux
mkdir: build: Not a directory

$ rm -rf BUILD

$ mkdir -p build/linux

$ echo $?
0

I'm not familiar with Bazel at all, but form the docs:

Note: The BUILD file can be named either BUILD or BUILD.bazel. If both files exist, BUILD.bazel takes precedence over BUILD. For simplicity's sake, the documentation refers to these files simply as BUILD files.

I can submit a PR giving that a try

roperzh commented 1 year ago

I'm not 100% sure that will work, but in the meantime I submitted a PR with the rename: https://github.com/macadmins/osquery-extension/pull/41

roperzh commented 1 year ago

After installing Bazel, I can confirm that I was able to run make build successfully with the changes in the PR. I will note this in the PR as well

erikng commented 1 year ago

It worked. New release is out.

roperzh commented 1 year ago

thank you!