Search code examples
elixirelixir-mixhex-pm

Elixir dependency does not generate app file


I am about to release 0.2.0 of my myhtmlex library. But I am having trouble testing my new package release, as the test application does not generate an app file.

And to test my integration, I wrote a script to test my hex releases in test-applications.

You can check the source here: https://github.com/Overbryd/myhtmlex/tree/package-test

The steps to reproduce this are:

  1. Build the hex package mix hex.build
  2. Unpack the resulting tar-archive
  3. Create a new test-application depending on that hex package with {:myhtmlex, path: "../local-tar-archive"}
  4. Build the test-application mix compile but it fails with:

    ==> myhtmlex
    Compiling 3 files (.ex)
    ==> myhtmlex_pkg_test
    Unchecked dependencies for environment dev:
    * myhtmlex (../myhtmlex-local)
      could not find an app file at "_build/dev/lib/myhtmlex/ebin/myhtmlex.app". This may happen if the dependency was not yet compiled, or you specified the wrong application name in your deps, or the dependency indeed has no app file (then you can pass app: false as option)
    ** (Mix) Can't continue due to errors on dependencies
    

Cross-post from: https://elixirforum.com/t/dependency-does-not-generate-app-file/12703


Solution

  • Starting with hex >= 0.17.3 and using mix hex.build --unpack -o package-test directly solved this for me.

    If you want to read up on the details of this, the issue was resolved here: https://github.com/hexpm/hex/issues/515