ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
579 stars 239 forks source link

erlang.mk tutorial release build failure #989

Open chunshengit opened 1 year ago

chunshengit commented 1 year ago

This is the new failure I run into:

cs1119@CACDTL01cs1119 MSYS /c/temp/erlang/hello_rel $ make distclean GEN clean-app GEN coverdata-clean GEN distclean-tmp GEN distclean-kerl GEN distclean-deps GEN distclean-ct GEN distclean-plt GEN distclean-edoc GEN distclean-escript GEN distclean-relx-rel GEN cover-report-clean

cs1119@CACDTL01cs1119 MSYS /c/temp/erlang/hello_rel $ make DEP relx (main) Evaluating config script "c:/temp/erlang/hello_rel/.erlang.mk/rebar3/_build/default/lib/rebar/src/rebar.app.src.script" ===> Verifying dependencies... ===> Analyzing applications... ===> Compiling cf ===> Compiling cth_readable ===> Compiling certifi ===> Compiling eunit_formatters ===> Compiling getopt ===> Compiling providers ===> Compiling bbmustache ===> Compiling ssl_verify_fun ===> Compiling relx ===> Compiling erlware_commons ===> Compiling rebar ===> Verifying dependencies... ===> Cleaning out certifi... ===> Cleaning out cf... ===> Cleaning out erlware_commons... ===> Cleaning out getopt... ===> Cleaning out providers... ===> Cleaning out rebar... ===> Verifying dependencies... ===> Analyzing applications... ===> Compiling cf ===> Compiling cth_readable ===> Compiling certifi ===> Compiling eunit_formatters ===> Compiling getopt ===> Compiling providers ===> Compiling bbmustache ===> Compiling ssl_verify_fun ===> Compiling relx ===> Compiling erlware_commons ===> Compiling rebar ===> Building escript for rebar...

/c/temp/erlang/hello_rel [{"1.2.0",[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.10.0">>},0}]}, [{pkg_hash,[{<<"bbmustache">>, <<"DDC927463F0E95D66CDAC889153AF08015D609124D6D79006C248AD2DE7F6ECD">>}]}, {pkg_hash_ext,[{<<"bbmustache">>, <<"43EFFA3FD4BB9523157AF5A9E2276C493495B8459FC8737144AA186CB13CE2EE">>}]}]] [{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.10.0">>},0}] <<"1.10.0">> make[1]: Entering directory '/c/temp/erlang/hello_rel/deps/relx' DEP bbmustache (1.10.0) tar: /c/temp/erlang/hello_rel/.erlang.mk/hex/bbmustache.tar: Cannot open: No such file or directory tar: Error is not recoverable: exiting now

gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now make[1]: [/c/temp/erlang/hello_rel/erlang.mk:4404: /c/temp/erlang/hello_rel/deps/bbmustache] Error 2 make[1]: Leaving directory '/c/temp/erlang/hello_rel/deps/relx' make: [erlang.mk:3758: deps] Error 2

cs1119@CACDTL01cs1119 MSYS /c/temp/erlang/hello_rel $ ls -ltF .erlang.mk/hex/ total 0

cs1119@CACDTL01cs1119 MSYS /c/temp/erlang/hello_rel $ ls deps/ bbmustache/ relx/

cs1119@CACDTL01cs1119 MSYS /c/temp/erlang/hello_rel $ ls -ltF deps/bbmustache/ total 0

cs1119@CACDTL01cs1119 MSYS /c/temp/erlang/hello_rel $

bbmustache is REBAR3 dependent and is passed along as hello_rel dependent also. bbmustache is not listed in the erlang.mk file and package is not downloaded from github(I manually add it to the erlang.mk) or copied over to hello_rel deps/ .

should bbmustache be considered of the release dependent at all?

essen commented 1 year ago

That one seems like a download failure from hex. The hex download code isn't the most solid right now but it might solve itself if you make distclean and try again. The release test cases are not failing for me.

chunshengit commented 1 year ago

git works fine behind the firewall with proxy setup, but hex doesn't seem to function properly. Once I am on public internet, I am able to build and boot the whole release after couple of "make distclean". By the way, werl.exe is removed from the OTP26 and "make run" has this error: system cannot find the file C:\temp\erlang\hello_rel_rel\hello_rel_release\erts-14.0\bin\werl.exe.

Fixed by: ln -s erl.exe werl.exe and system is booting up.

This issue can be closed.

essen commented 1 year ago

Right in that case you need to configure curl proxy information for hex to work properly, see https://everything.curl.dev/usingcurl/proxies/env

Perhaps this can be documented.

About werl.exe please open a separate issue as something will have to be done about that.

chunshengit commented 1 year ago

I configure curl proxy in Windows environment setting and both git and hex are working properly behind th firewall.

SamuelBakes commented 4 months ago

I also have this issue. I'm working in a linux distro though. At the risk of sounding foolish, how does using curl proxy work? Am I supposed to grab hex from a different source than github? My apologize if this isn't the right place to ask this question.

essen commented 4 months ago

Hex packages are not on GitHub hence the issues. And I got no control over that.

Different firewalls have different constraints so it's hard to provide guidance. But if you are behind a firewall and have an HTTP proxy available to you you may configure it to bypass the firewall. What that looks like in your scenario I can't say without more details though.

Alternatively you can setup your own Hex mirrors but you'll likely run into the same proxy issues if the mirror is behind it.

SamuelBakes commented 4 months ago

Thanks! I've figured it out now.