Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell me what is the problem with the release build? #2924

Open
heiheshang opened this issue Nov 12, 2024 · 6 comments
Open

Tell me what is the problem with the release build? #2924

heiheshang opened this issue Nov 12, 2024 · 6 comments

Comments

@heiheshang
Copy link

Pre-Check

===> Fetching cowlib v2.12.1
===> Making request to get package cowlib from repo hexpm
===> Version cached at /home/oper/.cache/rebar3/hex/hexpm/packages/cowlib-2.12.1.tar is up to date, reusing it
===> sh info:
cwd: "/home/oper/Programs/project/123"
cmd: rm -rf /home/oper/Programs/project/123/_build/default/lib/cowlib

===> opts: [{use_stdout,false},abort_on_error]

===> Port Cmd: rm -rf /home/oper/Programs/project/123/_build/default/lib/cowlib
Port Opts: [exit_status,
{line,16384},
use_stdio,stderr_to_stdout,hide,eof,binary]

===> Moving checkout "/tmp/.tmp_dir983864185500" to "/home/oper/Programs/project/123/_build/default/lib/cowlib"
===> sh info:
cwd: "/home/oper/Programs/project/123"
cmd: mv /tmp/.tmp_dir983864185500 /home/oper/Programs/project/123/_build/default/lib/cowlib

===> opts: [{use_stdout,false},abort_on_error]

===> Port Cmd: mv /tmp/.tmp_dir983864185500 /home/oper/Programs/project/123/_build/default/lib/cowlib
Port Opts: [exit_status,
{line,16384},
use_stdio,stderr_to_stdout,hide,eof,binary]

===> Linking _build/default/lib/cowlib to build/123/lib/cowlib
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,error}
===> Stack trace to the error location:
[{rebar_prv_install_deps,update_seen_dep,9,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
{line,278}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1267}]},
{rebar_prv_install_deps,handle_profile_level,7,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
{line,183}]},
{rebar_prv_install_deps,do
,1,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_install_deps.erl"},
{line,82}]},
{rebar_core,do,2,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar_core.erl"},
{line,155}]},
{rebar_prv_do,do_task,5,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar_prv_do.erl"},
{line,75}]},
{rebar_core,do,2,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar_core.erl"},
{line,155}]},
{rebar3,run_aux,2,
[{file,"/home/runner/work/rebar3/rebar3/src/rebar3.erl"},
{line,182}]}]
===> When submitting a bug report, please include the output of rebar3 report "your command"
make: *** [Makefile:79: release] Error 1

Environment

Rebar3 report
 version 3.17.0
 generated at 2024-11-12T02:37:51+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: release
Entered as:
  release
-----------------
Operating System: x86_64-unknown-linux-gnu
ERTS: Erlang/OTP 23 [erts-11.2.2.18] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Root Directory: /home/oper/.asdf/installs/erlang/23.3.4.20
Library directory: /home/oper/.asdf/installs/erlang/23.3.4.20/lib
-----------------
Loaded Applications:
bbmustache: 1.10.0
certifi: 2.6.1
cf: 0.3.1
common_test: 1.20.2.3
compiler: 7.6.9.3
crypto: 4.9.0.4
cth_readable: 1.5.1
dialyzer: 4.3.1.2
edoc: 0.12
erlware_commons: 1.5.0
eunit: 2.6
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 4.0.1
inets: 7.3.2.3
kernel: 7.3.1.7
providers: 1.8.1
public_key: 1.10.0.1
relx: 4.5.0
sasl: 4.0.2
snmp: 5.8.0.1
ssl_verify_fun: 1.1.6
stdlib: 3.14.2.3
syntax_tools: 2.5
tools: 3.4.4

-----------------
Escript path: /home/oper/Programs/project/123/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report repos shell state tar tree unlock update upgrade upgrade upgrade version xref

[/quote]

...


- Verify whether the version of rebar3 you're running is the latest release (see https://github.com/erlang/rebar3/releases)
- If possible, include information about your project and its structure. Open source projects or examples are always easier to debug.
  If you can provide an example code base to reproduce the issue on, we will generally be able to provide more help, and faster.

### Current behaviour ###

Describe the current behaviour. In case of a failure, crash, or exception, please include the result of running the command with debug information:

DEBUG=1 rebar3


### Expected behaviour ###

Describe what you expected to happen.
@ferd
Copy link
Collaborator

ferd commented Nov 12, 2024

I don't quite know since you've only included the error and none of the project configuration, but I note:

  • you're using Rebar3 3.17.0 with OTP-23 on some linux. These are old versions, but compatible
  • you're failing on some operation on cowlib v2.12.1
  • the line failing seems to be
    Name = rebar_app_info:name(AppInfo),
    , following a symlink step. It's possible that this failed to properly work for profile 123 somehow

That's the extent of what I Can figure out from the trace. There's little to do extra with this information, besides saying cowlib usually builds fine, so I'm suspecting something weird with your environment. Is there any chance you're on a virtual machine sharing a filesystem with a Windows system? These tend to have real weird filesystem bugs with symlinks.

@heiheshang
Copy link
Author

`cat /etc/os-release
NAME="openSUSE Tumbleweed"

VERSION="20241014"

ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20241014"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"

CPE 2.3 format, boo#1217921

CPE_NAME="cpe:2.3:o:opensuse:tumbleweed:20241014:::::::*"
#CPE 2.2 format
#CPE_NAME="cpe:/o:opensuse:tumbleweed:20241014"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"
`
this error does not depend on the system, I build on my Linux locally and in CI on GitHub and the error is the same. The build is done in CI on GitHub in Debian a clean image is taken each time. What other details are needed to determine the problem? I can show the entire debug file, I showed the last lines that were suspected

@heiheshang
Copy link
Author

if I run the build a second time, everything will be assembled, but I can't do that in CI

@ferd
Copy link
Collaborator

ferd commented Nov 13, 2024

What's the rebar.config file like?

I haven't been able to replicate it for releases with newer versions when calling it as rebar3 release or rebar3 as prod release with the following config:

{erl_opts, [debug_info]}.
{deps, [
    {cowlib, "2.12.1"}
]}.

{relx, [
    {release, {myapp, "0.1.0"}, [
        myapp,
        cowlib,
        sasl
    ]},

    {mode, dev},

    %% automatically picked up if the files
    %% exist but can be set manually, which
    %% is required if the names aren't exactly
    %% sys.config and vm.args
    {sys_config, "./config/sys.config"},
    {vm_args, "./config/vm.args"}

    %% the .src form of the configuration files do
    %% not require setting RELX_REPLACE_OS_VARS
    %% {sys_config_src, "./config/sys.config.src"},
    %% {vm_args_src, "./config/vm.args.src"}
]}.

{profiles, [
    %% prod is the default mode when prod
    %% profile is used, so does not have
    %% to be explicitly included like this
    {prod, [
        {relx, [
            {mode, prod}

            %% use minimal mode to exclude ERTS
            %% {mode, minimal}
        ]}
    ]}
]}.

@heiheshang
Copy link
Author

{cowlib,".*",{git,"https://github.com/ninenines/cowlib","2.12.1"}}
I don't import cowlib directly into the project, this dependency is from gun which is imported from shotgun

@ferd
Copy link
Collaborator

ferd commented Nov 14, 2024

Aside from getting the expected warning (===> WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.) I still get a successful build by just fetching that specific dependency and building a standalone release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants