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

rebar3 compile is throwing errors on Apple Macbook Pro M1 Max #2770

Open
bryanhughes opened this issue Feb 8, 2023 · 1 comment
Open

rebar3 compile is throwing errors on Apple Macbook Pro M1 Max #2770

bryanhughes opened this issue Feb 8, 2023 · 1 comment

Comments

@bryanhughes
Copy link

bryanhughes commented Feb 8, 2023

Environment

Rebar3 report
 version 3.20.0
 generated at 2023-02-08T03:33:48+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: compile
Entered as:
  compile
-----------------
Operating System: aarch64-apple-darwin22.2.0
ERTS: Erlang/OTP 25 [erts-13.1.4] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Root Directory: /opt/erlang/lib/erlang
Library directory: /opt/erlang/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.9.0
cf: 0.3.1
common_test: 1.23.3
compiler: 8.2.3
crypto: 5.1.2
cth_readable: 1.5.1
dialyzer: 5.0.4
edoc: 1.2
erlware_commons: 1.5.0
eunit: 2.8.1
eunit_formatters: 0.5.0
getopt: 1.0.1
inets: 8.2.1
kernel: 8.5.3
providers: 1.9.0
public_key: 1.13.2
relx: 4.7.0
sasl: 4.2
snmp: 5.13.3
ssl_verify_fun: 1.1.6
stdlib: 4.2
syntax_tools: 3.0
tools: 3.5.3

-----------------
Escript path: undefined
Providers:
  app_discovery as autotest build clean compile compile cover ct cut deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new organization owner path pkgs publish release relup report repos retire search shell state tar tree unlock update upgrade upgrade upgrade user vendor version xref

Current behaviour

This issue is local to my Apple Macbook Pro M1 Max.

DEBUG=1 rebar3 compile
===> Compile (apps)
===> Compile (apps)
===> Running hooks for compile in app rebar3_run (/Users/bryan/Dropbox/git/proto-crudl/_build/default/plugins/rebar3_run) with configuration:
===> 	{pre_hooks, [{"(linux|darwin|solaris)",compile,
                              "make -C c_src/"},
                             {"(freebsd)",compile,"gmake -C c_src/"}]}.
Undefined symbols for architecture arm64:
  "_enif_get_list_cell", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_get_list_length", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_get_string", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_is_list", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_make_atom", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_make_badarg", referenced from:
      _exec_nif in rebar3_run.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/bryan/Dropbox/git/proto-crudl/_build/default/plugins/rebar3_run/c_src/../priv/rebar3_run.so] Error 1
===> Hook for compile failed!

===> throw rebar_abort [{rebar_utils,abort,0,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_utils.erl"},
                                 {line,718}]},
                               {rebar_utils,sh,2,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_utils.erl"},
                                 {line,202}]},
                               {lists,foreach_1,2,
                                [{file,"lists.erl"},{line,1442}]},
                               {rebar_hooks,run_all_hooks,6,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_hooks.erl"},
                                 {line,19}]},
                               {rebar_prv_compile,'-compile/4-lc$^0/1-0-',3,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_compile.erl"},
                                 {line,152}]},
                               {rebar_prv_compile,compile,4,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_compile.erl"},
                                 {line,152}]},
                               {rebar_prv_compile,do,1,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_compile.erl"},
                                 {line,45}]},
                               {rebar_plugins,build_plugins,3,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_plugins.erl"},
                                 {line,159}]}]
===> Errors loading plugin rebar3_run. Run rebar3 with DEBUG=1 set to see errors.
===> Compile (apps)
===> 25.2.1 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/bryan/Dropbox/git/proto-crudl/_build/default/plugins/hex_core/rebar.config.script"
===> 25.2.1 satisfies the requirement for minimum OTP version 19.3
===> Compile (apps)
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,compile]
===> Running provider: app_discovery
===> Found top-level apps: [proto_crudl]
	using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> Compile (apps)
===> Not adding provider default autotest from module rebar3_autotest_prv because it already exists from module rebar3_autotest_prv
===> Compile (apps)
===> Running hooks for compile in app rebar3_run (/Users/bryan/Dropbox/git/proto-crudl/_build/default/plugins/rebar3_run) with configuration:
===> 	{pre_hooks, [{"(linux|darwin|solaris)",compile,
                              "make -C c_src/"},
                             {"(freebsd)",compile,"gmake -C c_src/"}]}.
Undefined symbols for architecture arm64:
  "_enif_get_list_cell", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_get_list_length", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_get_string", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_is_list", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_make_atom", referenced from:
      _exec_nif in rebar3_run.o
  "_enif_make_badarg", referenced from:
      _exec_nif in rebar3_run.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/bryan/Dropbox/git/proto-crudl/_build/default/plugins/rebar3_run/c_src/../priv/rebar3_run.so] Error 1
===> Hook for compile failed!

===> throw rebar_abort [{rebar_utils,abort,0,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_utils.erl"},
                                 {line,718}]},
                               {rebar_utils,sh,2,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_utils.erl"},
                                 {line,202}]},
                               {lists,foreach_1,2,
                                [{file,"lists.erl"},{line,1442}]},
                               {rebar_hooks,run_all_hooks,6,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_hooks.erl"},
                                 {line,19}]},
                               {rebar_prv_compile,'-compile/4-lc$^0/1-0-',3,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_compile.erl"},
                                 {line,152}]},
                               {rebar_prv_compile,compile,4,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_compile.erl"},
                                 {line,152}]},
                               {rebar_prv_compile,do,1,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_compile.erl"},
                                 {line,45}]},
                               {rebar_plugins,build_plugins,3,
                                [{file,
                                  "/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_plugins.erl"},
                                 {line,159}]}]
===> Errors loading plugin rebar3_run. Run rebar3 with DEBUG=1 set to see errors.
===> Compile (apps)
===> 25.2.1 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/bryan/Dropbox/git/proto-crudl/_build/default/plugins/hex_core/rebar.config.script"
===> 25.2.1 satisfies the requirement for minimum OTP version 19.3
===> Compile (apps)
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex build from module rebar3_hex_build because it already exists from module rebar3_hex_build
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex organization from module rebar3_hex_organization because it already exists from module rebar3_hex_organization
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Running provider: install_deps
===> Verifying dependencies...
===> Comparing git ref bd65447 with bd65447
===> Running provider: lock
===> Running provider: compile
===> Compile (apps)
===> Running hooks for compile with configuration:
===> 	{pre_hooks, []}.
===> Compile (project_apps)
===> Running hooks for compile in app proto_crudl (/Users/bryan/Dropbox/git/proto-crudl) with configuration:
===> 	{pre_hooks, []}.
===> Running hooks for erlc_compile in app proto_crudl (/Users/bryan/Dropbox/git/proto-crudl) with configuration:
===> 	{pre_hooks, []}.
===> Analyzing applications...
===> Compiling proto_crudl
===> compile options: {erl_opts, [debug_info,nowarn_export_all,
                                         warnings_as_errors]}.
===> files to analyze ["/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_sup.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_utils.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_code.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_queries.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_app.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_parse.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_proto.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_records.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_psql.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl.erl",
                              "/Users/bryan/Dropbox/git/proto-crudl/src/proto_crudl_maps.erl"]
===> Running hooks for erlc_compile in app proto_crudl (/Users/bryan/Dropbox/git/proto-crudl) with configuration:
===> 	{post_hooks, []}.
===> Running hooks for app_compile in app proto_crudl (/Users/bryan/Dropbox/git/proto-crudl) with configuration:
===> 	{pre_hooks, []}.
===> Running hooks for app_compile in app proto_crudl (/Users/bryan/Dropbox/git/proto-crudl) with configuration:
===> 	{post_hooks, []}.
===> Running hooks for compile in app proto_crudl (/Users/bryan/Dropbox/git/proto-crudl) with configuration:
===> 	{post_hooks, []}.
===> Running hooks for compile with configuration:
===> 	{post_hooks, []}.

Expected behaviour

No NIF compile errors

@ferd
Copy link
Collaborator

ferd commented Feb 12, 2023

Those are C compilation rules. It looks like the command failing is actually make -C c_src/

Whatever the makefile is doing may need to deal with the specificity of M1 systems? This appears to be a C problem happening within the makefile more than something Rebar3 can do anything about (aside from not crashing when C fails)

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