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

** (Mix) Could not compile exit status: 2 (macOS) #40

Closed
nelsonic opened this issue Jul 16, 2024 · 5 comments
Closed

** (Mix) Could not compile exit status: 2 (macOS) #40

nelsonic opened this issue Jul 16, 2024 · 5 comments

Comments

@nelsonic
Copy link
Contributor

nelsonic commented Jul 16, 2024

Experimenting with your lib ... dwyl/learn-tigerbeetle#1

Just ran:

git clone [email protected]:rbino/tigerbeetlex.git
cd tigerbeetlex
mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.021s
Unchanged:
  benchee 1.1.0
  build_dot_zig 0.4.0
  bunt 0.2.1
  castore 1.0.4
  credo 1.7.0
  deep_merge 1.0.0
  dialyxir 1.3.0
  erlex 0.2.6
  file_system 0.2.10
  jason 1.4.1
  nimble_options 1.0.2
  nimble_parsec 1.3.1
  pegasus 0.2.4
  statistex 1.0.0
  typed_struct 0.3.0
  uniq 0.6.1
  zig_parser 0.2.2
* Getting typed_struct (Hex package)
* Getting nimble_options (Hex package)
* Getting zig_parser (Hex package)
* Getting build_dot_zig (Hex package)
* Getting uniq (Hex package)
* Getting dialyxir (Hex package)
* Getting benchee (Hex package)
* Getting credo (Hex package)
* Getting bunt (Hex package)
* Getting file_system (Hex package)
* Getting jason (Hex package)
* Getting deep_merge (Hex package)
* Getting statistex (Hex package)
* Getting erlex (Hex package)
* Getting castore (Hex package)
* Getting pegasus (Hex package)
* Getting nimble_parsec (Hex package)

Appears to install deps fine. 👌

Then ran:

mix test

Output:

==> uniq
Compiling 4 files (.ex)
Generated uniq app
==> typed_struct
Compiling 2 files (.ex)
Generated typed_struct app
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> deep_merge
Compiling 2 files (.ex)
Generated deep_merge app
==> nimble_options
Compiling 3 files (.ex)
Generated nimble_options app
==> nimble_parsec
Compiling 4 files (.ex)
Generated nimble_parsec app
==> bunt
Compiling 2 files (.ex)
Generated bunt app
==> jason
Compiling 10 files (.ex)
Generated jason app
==> statistex
Compiling 3 files (.ex)
Generated statistex app
==> credo
Compiling 251 files (.ex)
    warning: function traverse/4 is unused
    │
 56 │     defp traverse({unquote(op), _, nil} = ast, issues, _issue_meta, _parens?) do
    │          ~
    │
    └─ lib/credo/check/warning/mix_env.ex:56:10: Credo.Check.Warning.MixEnv (module)

     warning: Regex.regex?/1 is deprecated. Use Kernel.is_struct(term, Regex) or pattern match on %Regex{} instead
     │
 124 │     if Regex.regex?(check_or_regex) do
     │              ~
     │
     └─ lib/credo/check/config_comment.ex:124:14: Credo.Check.ConfigComment.check_tuple_ignores_issue?/2

Generated credo app
==> pegasus
Compiling 11 files (.ex)
Generated pegasus app
==> zig_parser
Compiling 36 files (.ex)
Generated zig_parser app
warning: in order to compile .yrl files, you must add "compilers: [:yecc] ++ Mix.compilers()" to the "def project" section of your mix.exs
  (mix 1.16.0) lib/mix/tasks/compile.yecc.ex:70: Mix.Tasks.Compile.Yecc.preload/1
  (mix 1.16.0) lib/mix/compilers/erlang.ex:66: Mix.Compilers.Erlang.compile/6
  (mix 1.16.0) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.16.0) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.16.0) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.16.0) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2

warning: in order to compile .xrl files, you must add "compilers: [:leex] ++ Mix.compilers()" to the "def project" section of your mix.exs
  (mix 1.16.0) lib/mix/tasks/compile.leex.ex:69: Mix.Tasks.Compile.Leex.preload/1
  (mix 1.16.0) lib/mix/compilers/erlang.ex:66: Mix.Compilers.Erlang.compile/6
  (mix 1.16.0) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.16.0) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.16.0) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.16.0) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2

==> erlex
Compiling 2 files (.erl)
Compiling 1 file (.ex)
Generated erlex app
==> dialyxir
Compiling 64 files (.ex)
Generated dialyxir app
==> benchee
Compiling 44 files (.ex)
warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/output/benchmark_printer.ex: Benchee.Output.BenchmarkPrinter.benchmarking/3

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/output/benchmark_printer.ex: Benchee.Output.BenchmarkPrinter.benchmarking/3

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/output/benchmark_printer.ex: Benchee.Output.BenchmarkPrinter.benchmarking/3

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/output/benchmark_printer.ex: Benchee.Output.BenchmarkPrinter.benchmarking/3

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/relative_statistics.ex: Benchee.RelativeStatistics.zero_safe_division/2

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/relative_statistics.ex: Benchee.RelativeStatistics.zero_safe_division/2

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/relative_statistics.ex: Benchee.RelativeStatistics.zero_safe_division/2

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/statistics.ex: Benchee.Statistics.add_ips/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/benchmark/runner.ex: Benchee.Benchmark.Runner.run_reductions_benchmark/2

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/benchmark/runner.ex: Benchee.Benchmark.Runner.run_memory_benchmark/2

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ lib/benchee/benchmark/runner.ex: Benchee.Benchmark.Runner.measure_runtimes/4

Generated benchee app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> build_dot_zig
Compiling 7 files (.ex)
Generated build_dot_zig app
==> tigerbeetlex
zig build-lib tigerbeetlex Debug native: error: the following command failed with 2 compilation errors:
~/code/tigerbeetlex/deps/build_dot_zig/priv/zig-aarch64-macos-0.11.0/zig build-lib 
~/code/tigerbeetlex/src/tigerbeetlex.zig -lc -fallow-shlib-undefined --cache-dir 
~/code/tigerbeetlex/_build/test/zig-cache --global-cache-dir ~/.cache/zig --name tigerbeetlex -dynamic -install_name @rpath/libtigerbeetlex.dylib -isystem /opt/homebrew/Cellar/erlang/26.2.1/lib/erlang/erts-14.2.1/include --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
+- install generated to tigerbeetlex.so transitive failure
   +- zig build-lib tigerbeetlex Debug native 2 errors
   +- zig build-lib tigerbeetlex Debug native (reused)
src/transfer_batch.zig:8:20: error: unable to load 'src/tigerbeetle/src/tigerbeetle.zig': FileNotFound
src/client.zig:10:27: error: unable to load 'src/tigerbeetle/src/clients/c/tb_client.zig': FileNotFound
** (Mix) Could not compile with ~/code/tigerbeetlex/_build/test/lib/build_dot_zig/priv/zig-aarch64-macos-0.11.0/zig (exit status: 2).

Is this related to builds not passing on macOS #39 ? 💭

Info:

elixir -v
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]
Elixir 1.16.0 (compiled with Erlang/OTP 26)

zig version
0.13.0
image
@rbino
Copy link
Owner

rbino commented Jul 16, 2024

These errors:

src/transfer_batch.zig:8:20: error: unable to load 'src/tigerbeetle/src/tigerbeetle.zig': FileNotFound
src/client.zig:10:27: error: unable to load 'src/tigerbeetle/src/clients/c/tb_client.zig': FileNotFound

lead me to believing the tigerbeetle submodule has not been cloned

Try cloning with git clone --recurse-submodules https://github.com/rbino/tigerbeetlex.git (or doing git submodule update --init in your already cloned repo)

@nelsonic
Copy link
Contributor Author

Ran:

git submodule update --init

Appears to work:

Submodule 'src/tigerbeetle' ([email protected]:tigerbeetledb/tigerbeetle.git) registered for path 'src/tigerbeetle'
Cloning into '~/code/tigerbeetlex/src/tigerbeetle'...
Submodule path 'src/tigerbeetle': checked out '87cace103476b8182a8ef08375de9fe8cb735754'

Attempting to execute the tests:

mix test
Compiling 20 files (.ex)
Generated tigerbeetlex app
Running ExUnit with seed: 994279, max_cases: 20

Appears to hang ... ⏳
How long does it usually take? 🤔

@rbino
Copy link
Owner

rbino commented Jul 16, 2024

Do you have a running instance of TigerBeetle? This should be all that it's needed to run the correct version of TigerBeetle

@nelsonic
Copy link
Contributor Author

Retraced steps: https://docs.tigerbeetle.com/quick-start

./tigerbeetle start --addresses=3000 0_0.tigerbeetle
info(io): opening "0_0.tigerbeetle"...
info(main): 0: Allocated 5251MB in 16 regions during replica init (Grid Cache: 1024MB)
info(main): 0: cluster=0: listening on 127.0.0.1:3000
mix test
Running ExUnit with seed: 827362, max_cases: 20

.......................................................................................
Finished in 2.5 seconds (0.00s async, 2.5s sync)
87 tests, 0 failures

Works as expected. ✅

tigerbeetlex-tests-work

@nelsonic
Copy link
Contributor Author

Closing as this is no longer an issue. 👍
Hopefully google indexes and it unblocks someone in the future. 😉
Looking forward to diving into this. 🧑‍💻

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