exatomvm icon indicating copy to clipboard operation
exatomvm copied to clipboard

Remove missing avm_deps directory warning

Open petermm opened this issue 5 months ago • 4 comments

Confusing DX for beginners, and I honestly don't know/understand what it's for.

So let's just remove the warning.

petermm avatar Aug 11 '25 13:08 petermm

I believe stm32 and wasm are the only platforms that currently need the avm_deps directory. This is for placing a copy of atomvmlib (or just the module beams that are actually used by the app) to be packed into the final application avm file. But this would apply any time that the standard libraries are not included in the AtomVM deployment, like a custom esp32 build that did not include a library partition.

UncleGrumpy avatar Aug 11 '25 19:08 UncleGrumpy

I honestly don't know/understand what it's for.

Sounds like we need to improve the documentation about this ;-)

UncleGrumpy avatar Aug 11 '25 19:08 UncleGrumpy

Yeah - I found this, which makes some sense, assuming it's correct.

### Preparation (Optional)

In order to avoid warnings from the Elixir compiler, you can make all of the symbols used from AtomVM libraries available to your application at build time.  This has the advantage of making the compiler less noisy.  However, it has the side effect of making your application files larger than they need to be, which can increase the time to deploy your applications to flash storage, for example, on a device.

If you want to take this path, create a directory called `avm_deps` in the top level of this project directory:

    shell$ mkdir avm_deps

Download a copy of the AtomVM library (`atomvmlib-<version>.avm`) from the AtomVM Github [release repository](https://github.com/atomvm/AtomVM/releases/).  Copy this file into the `avm_deps` directory.

Afterwards, you should see something like:

    shell$ ls -l avm_deps
    total 264
    -rw-rw-r--  1 frege  wheel  11380 May  8 16:32 atomvmlib-v0.6.0.avm

https://github.com/atomvm/atomvm_examples/blob/98f3c9cbd35e603f3208f4029d4d973af5521609/elixir/README.md?plain=1#L31

petermm avatar Aug 11 '25 19:08 petermm

We should change that to a required step for stm32, and possibly WASM (I have not tested emscripten for a while so I am fuzzy on deployment) and optional for other platforms. That is a separate PR anyway, just mentioning it now for the record.

Also unrelated to your changes, this brings up another benefit of using atomvm_packeam as a dependency, unused modules could be pruned, reducing the size of packed application, speeding up flashing times and lowering flash consumption.

UncleGrumpy avatar Aug 11 '25 22:08 UncleGrumpy