I know that the locking logic in rebar3 is kinda complex, but it seems like a massive oversight not to lock thing that end up in the release.
Is there any way to get this to happen?
I know that the locking logic in rebar3 is kinda complex, but it seems like a massive oversight not to lock thing that end up in the release.
Is there any way to get this to happen?
Hardened rebar.lock is the most stupid part of the rebar3. Like the ârequirementsâ in hex_metadata.config
We are forced to live with this JS-like nonsense.
In which case are dependencies not included? Do you have an example?
Putting the deps inside the prod profile.
Iâve never used Rebar like that. I always put the dependencies on the top level (i.e. in the implicit default profile).
Rebar does have the as <profile> meta task but unfortunately rebar3 as prod lock (or unlock) doesnât seem to use the dependencies in the prod profile.
For now I think your only option is to move anything that is âprodâ to the top level list (which IMO makes sense).
If I understand it correctly prod is also just a convention, not really an official profile in Rebar. Itâs even explained exactly for your use case in the last notice in this section of the documentation.
Except that I donât want these dependencies except at (released, deployed, production) runtime. Theyâre various observability/metrics things that donât work locally. I was hoping to avoid pulling them when theyâre not gonna be used.
documentation
Sigh. OK.
The problem with that suggestion is that the relx block needs to go inside the prod profile, otherwise Rebar3 shell tries to run applications from relx block?
I think rebar4 needs to have better profile management, with an explicitly supported release, prod, production profile or whatever.
another way to avoid ârebar3 shellâ starting applications from the release in relx is to configure the list of apps to start:
{shell, [{apps, [App]}]}.
Thanks for reminding me of another oversight in rebar3 I should make sure those doing rebar4 are aware of and may be able to address ![]()
So a release profile that is used when you run rebar3 release? The same as we run in the test profile when running rebar3 ct?
If you think that can be made to work in an unsurprising way. Itâs probably what most people expect, since other language ecosystems (off the top of my head: Rust, .NET) have an explicit distinction between development/debug and production/release.
Oh, well release isnât meant only to be production. It has a dev mode for building with symlinks for example.
Compared to Rust it is more like how you get a binary built into the default profile unless you run the build with --release.
Maybe the issue is relx modes donât tell rebar3 anything about deps. So you may have relx running in {dev_mode, false} but it doesnât mean your rebar3 prod deps are in use.