GithubHelp home page GithubHelp logo

A wish: create rel file about relx HOT 10 OPEN

erlware avatar erlware commented on August 22, 2024
A wish: create rel file

from relx.

Comments (10)

tsloughter avatar tsloughter commented on August 22, 2024

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.

saleyn avatar saleyn commented on August 22, 2024

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.

tsloughter avatar tsloughter commented on August 22, 2024

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.

saleyn avatar saleyn commented on August 22, 2024

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.

jwilberding avatar jwilberding commented on August 22, 2024

@tsloughter Do you think we should do this?

from relx.

nuex avatar nuex commented on August 22, 2024

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.

jwilberding avatar jwilberding commented on August 22, 2024

@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.

tsloughter avatar tsloughter commented on August 22, 2024

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.

saleyn avatar saleyn commented on August 22, 2024

Could you put a small example use case in the wiki?

from relx.

tsloughter avatar tsloughter commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.