DataDog / datadog-static-analyzer

Datadog Static Analyzer
https://docs.datadoghq.com/static_analysis/
Apache License 2.0
100 stars 12 forks source link

Analyzer fails on alpine based containers #245

Open crewone opened 7 months ago

crewone commented 7 months ago

Describe the bug Using alpine linux on a CI provider, the static analuzer fails.

DATADOG_STATIC_ANALYZER_URL: https://github.com/DataDog/datadog-static-analyzer/releases/latest/download/datadog-static-analyzer-x86_64-unknown-linux-gnu.zip

$ unzip /tmp/ddog-static-analyzer.zip -d /tmp
Archive:  /tmp/ddog-static-analyzer.zip
  inflating: datadog-static-analyzer-server
  inflating: datadog-static-analyzer
  inflating: datadog-export-rulesets
$ mv /tmp/datadog-static-analyzer /usr/local/datadog-static-analyzer
$ /usr/local/datadog-static-analyzer -i . -o /tmp/report.sarif -f sarif
Error relocating /lib/ld-linux-x86-64.so.2: unsupported relocation type 37
juli1 commented 7 months ago

Thanks for reporting the issue, we are going to reproduce it and attempt to find a fix within the next few days.

juli1 commented 7 months ago

I investigated further and even with gcompat the binary has issues running because of the dependencies with deno.

While it's not a priority for the immediate future to support Alpine we want to at least document how to run on Alpine.

crewone commented 7 months ago

Anything you can share here, to make it work? Otherwise I will have to convert the container to something other than alpine.

juli1 commented 7 months ago

Not at this time. I would recommend to use something else than alpine. The current version runs great on GitHub action which uses ubuntu:22.04

Alex-Wauters commented 5 months ago

The official datadog/ci build image is based on alpine however, could it be made to support static code analysis or provide a variant which has the latest version of ci + static code binaries?

https://hub.docker.com/r/datadog/ci