https://pantsbuild.org/ logo
r

refined-addition-53644

12/13/2022, 11:52 AM
I have a weird issue where hadolint fails when pants run it but works if I run it manually by directly calling
hadolint
I don’t even get very helpful error message from pants. No idea what
exit code -11
supposed to mean.
Copy code
12:48:24.11 [ERROR] Completed: Lint with Hadolint - hadolint failed (exit code -11).
The only issue I can think of is I only recently updated to macos ventura. Although it wasn’t failing just after the update. It’s only with some changes I have made that it fails. If I revert to a previous commit, it works. It’s all so mysterious sadly
w

wide-midnight-78598

12/13/2022, 1:48 PM
Anything when you run in debug mode?
./pants whatever -ldebug
Also, when you use --keep-sandboxes=on_failure and then manually the generated
__run.sh
script, does it work or failover?
r

refined-addition-53644

12/13/2022, 1:49 PM
yeah have been looking at that. Nothing really. The only thing is see is
Copy code
Signal 15 (SIGTERM) was raised. Exiting with failure.
👀 1
w

wide-midnight-78598

12/13/2022, 1:49 PM
Well that can't be good - does it work or fail when you run in the sandbox using the run script?
r

refined-addition-53644

12/13/2022, 1:50 PM
let me try the run script
w

wide-midnight-78598

12/13/2022, 1:50 PM
Also also, when you do it manually - are you using the same version of hado as Pants? (I can't recall if it installs something, or if it uses the system binary)
r

refined-addition-53644

12/13/2022, 1:50 PM
yeah I checked hado version on mac and inside pants and they are the same which was v2.10.0 I also tried to use the hadolint v2.12.0 which says something about buidling macos ventura but that doesn’t help. In the process though I opened a pull request on pants to update it to v2.12.0 https://github.com/pantsbuild/pants/pull/17791
w

wide-midnight-78598

12/13/2022, 1:51 PM
mac m1?
r

refined-addition-53644

12/13/2022, 1:52 PM
No just intel
w

wide-midnight-78598

12/13/2022, 1:52 PM
I don't think it's related to this - but putting this here so I don't have to search for it later: https://pantsbuild.slack.com/archives/C046T6T9U/p1665673558191199?thread_ts=1665581842.605619&cid=C046T6T9U
No just intel
NVM then, my example was an arm problem
r

refined-addition-53644

12/13/2022, 1:56 PM
The only thing I got from the
__run.sh
run
Copy code
./__run.sh: line 5: 55455 Segmentation fault: 11
I feel like it has something to do with the ventura but not sure how to reproduce it
Something’s wrong with binary pants downloads for hadolint in the sandbox
Copy code
➜  pants-sandbox-g7Yhuj ./hadolint-Darwin-x86_64
[1]    56882 segmentation fault  ./hadolint-Darwin-x86_64
w

wide-midnight-78598

12/13/2022, 2:06 PM
Sorry, which version of pants?
r

refined-addition-53644

12/13/2022, 2:06 PM
2.14.0
w

wide-midnight-78598

12/13/2022, 2:07 PM
https://github.com/pantsbuild/pants/blob/2.14.x/src/python/pants/backend/docker/lint/hadolint/subsystem.py Could you manually `curl`/`wget` your version of hadolint that is specified here and run it? Let's go to first principles here
r

refined-addition-53644

12/13/2022, 2:08 PM
yeah doing that exactly 😉
coke 1
So I downloaded the version directly from github and that has also segmentation fault but then I installed the same version (2.12.0) from brew, it works
🤯 1
h

hundreds-father-404

12/13/2022, 2:16 PM
hm are there newer versions available?
w

wide-midnight-78598

12/13/2022, 2:20 PM
Hmmmmmmm
@refined-addition-53644 Are you able to try 2.12 in pants? https://www.pantsbuild.org/docs/reference-hadolint#version
Hmm, guess you also need to add known_versions?
r

refined-addition-53644

12/13/2022, 2:26 PM
yeah I did
That pull request has been generated because I spent time in generating known_versions
w

wide-midnight-78598

12/13/2022, 2:30 PM
🎉
THanks!
👍 1
I'm starting with a new docker project that I'll want hadolint on - and I'm on Ventura 🙂
🤞 1
h

hundreds-father-404

12/13/2022, 2:36 PM
so it works with 2.12?
r

refined-addition-53644

12/13/2022, 2:37 PM
No it doesn’t when using pants or directly downloading from github. It only works when I install using brew
2
So it looks like building from source is what’s working since I think that’s what brew does.
h

hundreds-father-404

12/13/2022, 2:39 PM
hm if there isn't yet a ticket, it'd probably be helpful to open a bug report in their repo. A lot of times maintainers don't own that specific hardware so don't know when things break
how about other versions other than 2.12?
w

wide-midnight-78598

12/13/2022, 2:42 PM
Copy code
⏺ ~/Downloads % ./hadolint-Darwin-x86_64                                                                                                                                                                                                                                  ⎇ 
zsh: segmentation fault  ./hadolint-Darwin-x86_64
Wow... yeah
r

refined-addition-53644

12/13/2022, 2:42 PM
This was supposed to be fixed but it looks like it hasn’t been. There is a beta release https://github.com/hadolint/hadolint/issues/897 I tried all older versions and they don’t work either now.
h

hundreds-father-404

12/13/2022, 2:42 PM
cool that beta release should work with Pants
w

wide-midnight-78598

12/13/2022, 2:43 PM
Beta appears to work on my machine
It's unfortunate, it was crashes that got me to stop using hadolint a year or so ago 😢
😢 2
6 Views