Code Monkey home page Code Monkey logo

Comments (36)

essen avatar essen commented on June 1, 2024 1

Forgot about it. Will do that on Monday.

from erlang.mk.

essen avatar essen commented on June 1, 2024 1

I have pushed the temporary commit.

from erlang.mk.

essen avatar essen commented on June 1, 2024 1

Well rc3 is out so now is the time really.

from erlang.mk.

essen avatar essen commented on June 1, 2024 1

I will have to remove a few things including RELX_OPTS, at least initially. It would be helpful if I could know which relx.config file and RELX_* configuration everyone is using.

from erlang.mk.

essen avatar essen commented on June 1, 2024 1

I have opened erlware/relx#911 to get the fix in the main Relx repository.

from erlang.mk.

crownedgrouse avatar crownedgrouse commented on June 1, 2024 1

Works for me now, thanks

from erlang.mk.

essen avatar essen commented on June 1, 2024

I will have to rebuild a relx binary probably since it dropped support for 20 beam files.

from erlang.mk.

crownedgrouse avatar crownedgrouse commented on June 1, 2024

Having same issue with 25-rc2 . Any update on this issue ?

escript: exception error: undefined function relx:main/1
  in function  escript:run/2 (escript.erl, line 750)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3 
erlang.mk:7505: recipe for target 'relx-rel' failed

from erlang.mk.

essen avatar essen commented on June 1, 2024

I'm afraid it looks a bit more difficult than just recompiling against 22+. The release generated by Relx no longer contains a RELEASES file which is necessary for some features to work (such as release upgrades). I can create an empty RELEASES file and this will let most use of releases work but NOT release upgrades. For that upgrading Relx will certainly be necessary, and that implies switching from escript to using it as a library.

So for the time being I will push the update that makes it work in all cases except release upgrades, but then I will have to find time to do a proper move to Relx 4. This is going to be a breaking change (although we can support both modes for the time being).

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

I added the updated erlang.mk, but when I gmake on freebsd is says:

touch: _rel/projname_release/releases/RELEASES: No such file or directory
gmake: *** [erlang.mk:7507: relx-rel] Error 1

but if I do:

mkdir _rel/projname_release/releases

touch _rel/projname_release/releases/RELEASES

then run gmake again, it works.

I'm not sure why there is a projname_release. I thank it should just be projname in the path.

from erlang.mk.

essen avatar essen commented on June 1, 2024

I probably used the wrong variable. I'll take a look when I can.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Hm I will change it to use $(PROJECT) but this is not the right fix. I have to upgrade Relx soon.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Actually that's probably because you have a relx.config that changes the default release name. So it's a bit more complicated. I will just have to upgrade Relx.

from erlang.mk.

crownedgrouse avatar crownedgrouse commented on June 1, 2024

Still in rc2, no hurry.
But this must be fixed for 25 announcement.

from erlang.mk.

essen avatar essen commented on June 1, 2024

I am making it similar to proper, which means relx will need to be added to REL_DEPS (or other relevant DEPS) in order to run.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Another heads up: these options will need to be set explicitly since it seems like the defaults have changed:

{dev_mode, false}.
{include_erts, true}.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Please try the relx4 branch: https://github.com/ninenines/erlang.mk/tree/relx4

Note that it currently requires a custom relx if you are using simple integers for release versions. Also make note of the earlier comments.

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

This is what I use for relx.config:

{release, {esysman, "1.20"}, [esysman]}.
{extended_start_script, true}.
{vm_args, "./config/vm.args"}.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Tests are now green on the branch (no changes to release code since yesterday) so it's just a matter of feedback or OTP 25 getting released. I will try on my own projects as well, I got a bunch in Cowboy and Ranch that can exercise these changes.

from erlang.mk.

essen avatar essen commented on June 1, 2024

I will also need to reenable the Windows VM to test on Windows at some point.

from erlang.mk.

essen avatar essen commented on June 1, 2024

The Cowboy/Ranch tests that use releases all pass with minor updates. Other than start->daemon, I also encountered the fact that the eval command now expects the final dot.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Windows now works but it required another relx patch. The relevant PR is erlware/relx#914

from erlang.mk.

essen avatar essen commented on June 1, 2024

Relevant problem if using OTP-25.0-rc2: erlang/otp#5826

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

In aa0053c is there a reason you did this:

$(verbose) touch $(RELX_OUTPUT_DIR)/$(PROJECT)_release/releases/RELEASES

and not this:

$(verbose) touch $(RELX_OUTPUT_DIR)/$(PROJECT)/releases/RELEASES

When I take out the _releases, it works fine for me.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Neither are correct, the release name is provided in relx.config and is not dependent on $(PROJECT). The one with _release is simply the default.

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

That line is on line 49 here:

https://github.com/ninenines/erlang.mk/blob/master/plugins/relx.mk

$(PROJECT)_release

should jsut be

$(PROJECT)

from erlang.mk.

essen avatar essen commented on June 1, 2024

It is correct for the default as I've said, see https://github.com/ninenines/erlang.mk/blob/master/plugins/bootstrap.mk#L95

The real fix is in the relx4 branch. Please try it and report feedback on that instead, as the touch workaround will be removed when that branch is merged.

from erlang.mk.

essen avatar essen commented on June 1, 2024

I will merge the relx changes today. I will also investigate a potential issue with xref.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Merged! Thanks. I will investigate xref now.

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

Just an FYI: I just installed erlang 25, git cloned your erlang.mk project and ran make on it and put the erlang.mk in my project and all works with no error. Thanks!

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

Hmm. Maybe I'll need to redo how my project is set up. I noticed now that "make distclean" does not remove _rel nor does "make" create a new _rel folder. Any tips what direction I need to go for this? Thanks

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

I probably just need to implement what you have in your comments about the braking changes.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Yes you need to add REL_DEPS = relx to your Makefile or it won't do anything.

from erlang.mk.

comptekki avatar comptekki commented on June 1, 2024

This is what my make file looks like:

PROJECT = esysman

DEPS = cowboy epgsql
REL_DEPS = relx
dep_cowboy = git https://github.com/ninenines/cowboy 2.9.0
dep_epgsql = git https://github.com/wg/epgsql.git master
dep_relx = git https://github.com/erlware/relx master

include erlang.mk
include extra.mk

I get this now when running make:
...
DEPEND relx.d
ERLC relx.erl rlx_app_info.erl rlx_assemble.erl rlx_config.erl rlx_file_utils.erl rlx_log.erl rlx_overlay.erl rlx_release.erl rlx_relup.erl rlx_resolve.erl rlx_state.erl rlx_string.erl rlx_tar.erl rlx_util.erl
APP relx.app.src
make[1]: Leaving directory '/path/esysman/deps/relx'
erl +A1 -noinput -boot no_dot_erlang -pa ebin/ -pz /path/esysman/.erlang.mk/rebar/ebin -eval " {ok, Config} = file:consult("/path/esysman/relx.config"), {release, {Name, Vsn0}, } = lists:keyfind(release, 1, Config), Vsn = case Vsn0 of {cmd, Cmd} -> os:cmd(Cmd); semver -> ""; {semver, } -> ""; VsnStr -> Vsn0 end, {ok, } = relx:build_release(#{name => Name, vsn => Vsn}, Config), halt(0)." -- erlang.mk
Solving Release esysman-1.20{"init terminating in do_boot",{{error,{rlx_resolve,{app_not_found,esysman,undefined}}},[{rlx_resolve,subset,7,[{file,"src/rlx_resolve.erl"},{line,72}]},{rlx_resolve,'-fold_apps/7-fun-0-',7,[{file,"src/rlx_resolve.erl"},{line,99}]},{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},{rlx_resolve,subset,5,[{file,"src/rlx_resolve.erl"},{line,54}]},{rlx_resolve,solve_release,2,[{file,"src/rlx_resolve.erl"},{line,48}]},{relx,build_release
,3,[{file,"src/relx.erl"},{line,170}]},{relx,build_release,3,[{file,"src/relx.erl"},{line,87}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]}]}}
init terminating in do_boot ({{error,{rlx_resolve,{app_not_found,esysman,undefined}}},[{rlx_resolve,subset,7,[{
},{
}]},{rlx_resolve,-fold_apps/7-fun-0-,7,[{},{}]},{lists,foldl,3,[{},{}]},{rlx_resolve,subset,5,[{},{}]},{rlx_resolve,solve_release,2,[{},{}]},{relx,build_release_,3,[{},{}]},{relx,build_release,3,[{},{}]},{erl_eval,do_apply,7,[{},{}]}]})

Crash dump is being written to: erl_crash.dump...done
make: *** [erlang.mk:7537: relx-rel] Error 1

from erlang.mk.

essen avatar essen commented on June 1, 2024

Should have said BUILD_DEPS by the way. You probably don't want it included in the release.

Also please remove the dep_relx line and use the one defined by erlang.mk for now as it contains a fix that upstream relx hasn't merged yet. You might need to make distclean as well. If that fails please provide a test repository that I can use to reproduce.

from erlang.mk.

essen avatar essen commented on June 1, 2024

Note that relx will be added automatically when creating a new project as of a few days ago.

from erlang.mk.

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.