cocoa-xu / evision

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

Fail to download the precompiled binary of 0.1.0 #70

Closed zacky1972 closed 2 years ago

zacky1972 commented 2 years ago

I ran the following Elixir script:

System.put_env("EVISION_PREFER_PRECOMPILED", "true")
System.put_env("EVISION_PRECOMPILED_VERSION", "0.1.0")
System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache")
Mix.install([
  {:evision, "~> 0.1.0", github: "cocoa-xu/evision", tag: "v0.1.0"}
])

Then, I got the following error:

* Getting evision (https://github.com/cocoa-xu/evision.git - v0.1.0)
remote: Enumerating objects: 4412, done.        
remote: Counting objects: 100% (834/834), done.        
remote: Compressing objects: 100% (260/260), done.        
remote: Total 4412 (delta 599), reused 741 (delta 526), pack-reused 3578        
Resolving Hex dependencies...
Dependency resolution completed:
New:
  dll_loader_helper 0.1.7
  elixir_make 0.6.3
* Getting elixir_make (Hex package)
* Getting dll_loader_helper (Hex package)
==> dll_loader_helper
Compiling 1 file (.erl)
Compiling 1 file (.ex)
Generated dll_loader_helper app
==> elixir_make
Compiling 1 file (.ex)
Generated elixir_make app
==> evision
CMake Warning:
  Ignoring empty string ("") provided on the command line.

-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using PRIV_DIR: /Users/zacky/Library/Caches/mix/installs/elixir-1.14.0-rc.1-erts-13.0.3/8262caacbab21b886e01a468491819cb/_build/dev/lib/evision/priv
-- EVISION_PREFER_PRECOMPILED is true: try to download and use the precompiled library
-- precompiled tarball URL: https://github.com/cocoa-xu/evision/releases/download/0.1.0/evision-darwin-arm64-0.1.0.tar.gz
-- precompiled tarball cache file: /Users/zacky/.cache/evision-darwin-arm64-0.1.0.tar.gz
CMake Error at CMakeLists.txt:78 (message):
  Cannot download precompiled package from
  https://github.com/cocoa-xu/evision/releases/download/0.1.0/evision-darwin-arm64-0.1.0.tar.gz:
  "HTTP response code said error"

  You may download it manually and put it in
  /Users/zacky/Library/Caches/mix/installs/elixir-1.14.0-rc.1-erts-13.0.3/8262caacbab21b886e01a468491819cb/_build/dev/lib/evision/priv/evision-darwin-arm64-0.1.0

-- Configuring incomplete, errors occurred!
See also "/Users/zacky/Library/Caches/mix/installs/elixir-1.14.0-rc.1-erts-13.0.3/8262caacbab21b886e01a468491819cb/_build/dev/lib/evision/cmake_evision/CMakeFiles/CMakeOutput.log".
See also "/Users/zacky/Library/Caches/mix/installs/elixir-1.14.0-rc.1-erts-13.0.3/8262caacbab21b886e01a468491819cb/_build/dev/lib/evision/cmake_evision/CMakeFiles/CMakeError.log".
incomplete build of OpenCV found in '/Users/zacky/Library/Caches/mix/installs/elixir-1.14.0-rc.1-erts-13.0.3/8262caacbab21b886e01a468491819cb/_build/dev/lib/evision/cmake_opencv_4.5.5', please delete that directory and retry
make: *** [/Users/zacky/Library/Caches/mix/installs/elixir-1.14.0-rc.1-erts-13.0.3/8262caacbab21b886e01a468491819cb/_build/dev/lib/evision/priv/evision.so] Error 1
could not compile dependency :evision, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile evision", update it with "mix deps.update evision" or clean it with "mix deps.clean evision"
** (Mix.Error) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.

    (mix 1.14.0-rc.1) lib/mix.ex:513: Mix.raise/2
    (elixir_make 0.6.3) lib/mix/tasks/compile.make.ex:154: Mix.Tasks.Compile.ElixirMake.run/1
    (mix 1.14.0-rc.1) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.0-rc.1) lib/mix/tasks/compile.all.ex:92: Mix.Tasks.Compile.All.run_compiler/2
    (mix 1.14.0-rc.1) lib/mix/tasks/compile.all.ex:72: Mix.Tasks.Compile.All.compile/4
    (mix 1.14.0-rc.1) lib/mix/tasks/compile.all.ex:59: Mix.Tasks.Compile.All.with_logger_app/2
    (mix 1.14.0-rc.1) lib/mix/tasks/compile.all.ex:33: Mix.Tasks.Compile.All.run/1
    (mix 1.14.0-rc.1) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4

It seems to try to download https://github.com/cocoa-xu/evision/releases/download/0.1.0/evision-darwin-arm64-0.1.0.tar.gz.

I guess the correct URL is https://github.com/cocoa-xu/evision/releases/download/v0.1.0/evision-darwin-arm64-0.1.0.tar.gz.

cocoa-xu commented 2 years ago

Hi @zacky1972, sorry for the delayed reply and sorry that I didn't try to use the precompiled version after I released v0.1.0.

The URL template in the main branch is correct, so I decided to abandon v0.1.0 and release v0.1.1 instead.

Meanwhile, given that the released version will now have its own git tag, I decided to deprecate the EVISION_PRECOMPILED_VERSION environment variable because the version is already implied in the deps (i.e., in the tag keyword).

Please use the following lines instead. It should work now. :)

System.put_env("EVISION_PREFER_PRECOMPILED", "true")
System.put_env("EVISION_PRECOMPILED_CACHE_DIR", "#{System.user_home!()}/.cache")
Mix.install([
  {:evision, "~> 0.1.1", github: "cocoa-xu/evision", tag: "v0.1.1"}
])
Screenshot 2022-08-25 at 13 03 28
zacky1972 commented 2 years ago

It works well! Thanks!

cocoa-xu commented 2 years ago

Not a problem! I'll close this issue for now. :)