bettio

bettio

Monolithic Repo and Multiple Packages - how to avoid having 100 git repos for 100 packages?

Let me introduce the context before of my questions.

In order to support some new kind of hardware in AtomVM, a driver should be written first.

It basically means writing an Elixir/Erlang module for managing that device.
E.g. In order to support lora radio chip “sx126x” I did a module called Sx126XDriver, same thing for “bq25896” power management chip and so on.

Most of the times I end having 1 driver = 1 module.

Then I would like to make some packages, it would be nice having a package for each single driver, so when I build a new project I don’t have to pull drivers for devices I don’t have.

How can I avoid having 100 git repos for 100 packages?

What I was thinking about is:

a) When dependency is on git:

  • mix.exs deps: use sparse option when package is on git, e.g.: sparse: “apps/sx126x_driver” (should I use apps as a container directory?)
  • rebar3 deps: use git_subdir

b) Otherwise on hex: just use regular hex packages, use CI for publishing in a automated way packages to hex.

  • Are you aware of any relevant issue with such a similar workflow?
  • Do you have any suggestion for doing this in the best way?
  • Do you have any suggestion for providing the best possible developer experience to package users?
  • Should I prefix/suffix each package with some common prefix/suffix to indicate they are comming from the same megarepo? Such as in my case: avm_drivers_sx126x, avm_drivers_bq25896, etc…

Otherwise do you have any opinion against a similar pattern?

@Nerves folks: did you have any similar experience?

I’m looking forward opinions about this approach.

Most Liked

mat-hek

mat-hek

Membrane Core Team

How about keeping all drivers in a single package and enabling/disabling them in config.exs? There’s always some maintenance burden with that many packages, even if you automate releases.

rhcarvalho

rhcarvalho

You can also use depth: 1 to avoid downloading the full repo history in case there are heavy binaries.

I’d say up to you, but once people start depending on the directory structure it’s better not to change it.

This may help with discoverability, but there are other ways to deal with that too, like cross linking, or new features in ExDoc supporting cross package search.

bettio

bettio

git subtree would keep the main complexity I would like to avoid: having an excessive number of git repos.

Also, personal opinion here: git subtree introduces additional friction during development.

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement