Comments (10)
Is the creation of the bin scripts that big of an issue? With dev mode {dev_mode, true}.
relx will use links for setting up the lib directory, so it is doing much less, but will still generate the bin scripts.
from relx.
Well, there are cases when a developer just needs to create the rel/boot script without any other side effects. In this case relx is very helpful at figuring out the dependencies and the content of the *.rel file, but the fact that it doesn't have an option of not producing any other side effects is a bit troublesome. Not every application installation is embedded, and there are cases when release management is not needed, so it would be very helpful to have an option of just producing a rel file.
from relx.
Right, if you set generate_start_script
to false, include_erts
to false and dev_mode
to true you will only be generating the rel/boot/script files and linking to the libs.
from relx.
Ideally there should be a way of creating just a release file without links or any other artifacts, e.g.:
{providers, [rlx_prv_config, rlx_prv_release, rlx_prv_discover]}.
{include_erts, false}.
{dev_mode, nolinks}.
{generate_start_script, false}.
{generate_release_script, "priv/myproject.rel"}.
This would just create a single "priv/myproject.rel" file, without anything else under "_rel". In some simple projects not involving release handling this is all that is needed.
from relx.
@tsloughter Do you think we should do this?
from relx.
I think it would be cool if relx provided an API for doing things like this. Then you could build tools that use relx programmatically.
I'm looking through the code to work out how a .rel file gets generated.
from relx.
@nuex do you have any update on this? I do agree on making relx more programmatic, will have to think out how to best do that.
from relx.
You already can use it programmatically to just get the .rel
file. The function rlx_release:metadata/1
returns the terms that make up the rel file. The provider rlx_prv_release
will resolve the release so you have the release record to pass to rlx_release:metadata/1
.
from relx.
Could you put a small example use case in the wiki?
from relx.
I'll need to do a page on using the relx api, for now these are the commands I tested to verify in a shell that this works:
State = rlx_state:new([], []),
{ok, State1} = lists:foldl(fun rlx_config:load_terms/2,
{ok, State}, [{release, {rel_a, "0.0.1"}, [app_a]},
{lib_dirs, ["_build/default/lib"]},
{default_release, {rel_a, "0.0.1"}}]),
AllProviders = rlx_state:providers(State1),
Providers = providers:get_target_providers(resolve_release, AllProviders),
{ok, State2} = lists:foldl(fun(ProviderName, {ok, StateAcc}) ->
Provider = providers:get_provider(ProviderName, rlx_state:providers(StateAcc)),
providers:do(Provider, StateAcc)
end, {ok, State1}, Providers),
Release = rlx_state:get_realized_release(State2, rel_a, "0.0.1"),
rlx_release:metadata(Release).
from relx.
Related Issues (20)
- Relx call to xref should take into account ignore_xref HOT 5
- `cd "$ROOTDIR"` before any `erl` subscript runs in extended_bin HOT 2
- Building a tar doesn't override the erl script like building a release HOT 3
- The configuration registry key could not be read HOT 13
- Custom name of the start script HOT 1
- `init terminating in do_boot` error after adding _checkouts dependency.
- Replace of OS Variables enters endless loop if OS variable contains an ampersand HOT 1
- Rebar3 .app file pkg_name for hex and relx HOT 7
- Tar --output-dir error HOT 7
- extended_bin does not account for cookie being set in an extended vm.args HOT 2
- First "daemon" startup hangs if no cookie is specified HOT 2
- Bash error while running in a directory with space in the name HOT 4
- Outdated website
- Allow applications to provide alternative user-facing messages HOT 10
- Mode = prod + system_libs = false produces broken release
- "rebar3 as prod tar" overlay does not take effect HOT 1
- Some extended start script commands fail on Windows
- Proposal: Allow disabling extended start script commands HOT 1
- Changes made to sys.config.src are not taking effect under windows
- https://erlanger.slack.com/archives/C055DJA49/p1703153178619079
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relx.