Skip to content

Conversation

petermm
Copy link
Contributor

@petermm petermm commented Aug 11, 2025

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

So let's just remove the warning.

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

So let's just remove the warning.

Signed-off-by: Peter M <[email protected]>
@UncleGrumpy
Copy link
Contributor

UncleGrumpy commented Aug 11, 2025

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
Copy link
Contributor

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

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

@petermm
Copy link
Contributor Author

petermm commented Aug 11, 2025

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

@UncleGrumpy
Copy link
Contributor

UncleGrumpy commented Aug 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants