cocoa-xu / evision

Evision: An OpenCV-Erlang/Elixir binding
https://evision.app
Apache License 2.0
322 stars 22 forks source link

Evision 0.1.34 causes runtime crash on Windows release #228

Closed sankaku-deltalab closed 4 months ago

sankaku-deltalab commented 4 months ago

Problem

When releasing a project that includes Evision 0.1.34 on Windows, it crashes at runtime.

I managed to avoid this issue by editing the configuration file generated by mix release.init and changing from embedded mode to interactive mode.

Repository replicating the workaround for the issue: https://github.com/sankaku-deltalab/try_evision_release

Part of erl_crash.dump

=ERROR REPORT==== 12-Feb-2024::22:40:01.077000 ===
Error in process <0.1265.0> with exit value:
{undef,[{dll_loader_helper,add_dll_directory,
                           [<<"f:/_/_build/prod/rel/try_evision_release/lib/evision-0.1.34/priv/x64/vc17/bin">>],
                           []},
        {evision_nif,load_nif,0,
                     [{file,"lib/generated/evision_nif.ex"},{line,15}]},
        {init,'-run_on_load_handler/2-fun-0-',1,
              [{file,"init.erl"},{line,1499}]}]}

Steps to Reproduce the Problem

  1. Create a Project: Create a new Elixir project. For example, use the command mix new <project_name>.
  2. Add Dependency: Edit the mix.exs file and add version 0.1.34 of evision to the deps function. Example: {:evision, "~> 0.1.34"}.
  3. Get Dependencies: Run the mix deps.get command in the root directory of the project to fetch the necessary dependencies.
  4. Create a Release: Execute the MIX_ENV=prod mix release command to create a production release.
  5. Start the Application: Launch the application from the built release using the _build/prod/rel/<project_name>/bin/<project_name> start command.

Environment

cocoa-xu commented 4 months ago

Hi @sankaku-deltalab, thanks for reporting this issue. I can confirm that it's also reproducible on my Windows environment. I'll try to see if I could fix that, and I'll push a new release once it's done. :)

cocoa-xu commented 4 months ago

Hi @sankaku-deltalab, I've released v0.1.35, and it should have addressed this issue. You may need to cleanup previous builds by deleting _build/prod/lib/evision and _build/prod/rel/try_evision_release/lib/evision-0.1.35.

Please feel free to reopen this issue if it doesn't work for you.