nccgroup / sobelow

Security-focused static analysis for the Phoenix Framework
Apache License 2.0
1.66k stars 92 forks source link

Getting a compilation error on sobelow 0.11.0 #83

Closed skylerparr closed 3 years ago

skylerparr commented 3 years ago

This is the error I'm seeing:

** (UndefinedFunctionError) function Jason.encode!/2 is undefined (module Jason is not available)
    Jason.encode!(%{findings: %{high_confidence: [], low_confidence: [], medium_confidence: []}, sobelow_version: "0.11.0", total_findings: 0}, [pretty: true])
    lib/sobelow.ex:142: Sobelow.print_output/0
    lib/sobelow.ex:120: Sobelow.run/0
    (mix 1.10.3) lib/mix/task.ex:330: Mix.Task.run_task/3
    (mix 1.10.3) lib/mix/cli.ex:82: Mix.CLI.run_task/2

Worked fine with sobelow 0.10.3. Not sure what changed; running:

  jason 1.2.2
  sobelow 0.11.0
GriffinMB commented 3 years ago

How are you installing Sobelow?

This is probably an error with installation. With the latest update, Sobelow needs to be installed as an escript if you are using it as a standalone utility. See the release notes for details: https://sobelow.io/#v0110

skylerparr commented 3 years ago

The new installation approach looks like it was the issue. I was able to run it locally with the new installation method. We'll try it on our build server later this week.

Previously we were installing it via:

mix archive.install hex sobelow --force