elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.31k stars 3.35k forks source link

Cannot compile Elixir from source #9779

Closed siegfried closed 4 years ago

siegfried commented 4 years ago

Environment

Current behavior

Compile and install Erlang OTP 22.2.4 from source.

Try to compile the source code like the instruction:

$ git clone https://github.com/elixir-lang/elixir.git
$ cd elixir
$ gmake clean test

Then nothing would happened after run bin/elixir --version and bin/iex.

$ gmake test
==> eex (compile)
==> mix (compile)
==> ex_unit (compile)
==> logger (compile)
==> iex (compile)
==> elixir (eunit)
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
  All 191 tests passed.

==> elixir (ex_unit)
==> ex_unit (ex_unit)
==> logger (ex_unit)
==> mix (ex_unit)
==> eex (ex_unit)
==> iex (ex_unit)

$ bin/elixir --version
$ bin/iex

Expected behavior

Should be able to run the commands.

josevalim commented 4 years ago

Hi @siegfried! Something unexpected is definitely happening. Can you please debug the bin/elixir script to understand why the VM is not starting? Thanks.

siegfried commented 4 years ago

Sorry, I'm not familiar with Shell, but I can try. Where shall I start? Thanks. @josevalim

josevalim commented 4 years ago

Try adding “echo 1”, “echo 2” and so on around the file to see until what point it executes?

Also, can you confirm calling “erl” works?

siegfried commented 4 years ago

Also, can you confirm calling “erl” works?

Yes, it does.

$ erl
Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:8:4] [ds:8:4:10] [async-threads:1]

Eshell V10.6.2  (abort with ^G)
1>
siegfried commented 4 years ago

Try adding “echo 1”, “echo 2” and so on around the file to see until what point it executes?

So I tried bin/elixir --version:

if [ -n "$RUN_ERL_PIPE" ]; then
  ESCAPED=""
  for PART in "$@"; do
    ESCAPED="$ESCAPED $(echo "$PART" | sed 's/[^a-zA-Z0-9_\-\/]/\\&/g')"
  done
  mkdir -p "$RUN_ERL_PIPE"
  mkdir -p "$RUN_ERL_LOG"
  ERL_EXEC="run_erl"
  set -- "$ERTS_BIN$ERL_EXEC" -daemon "$RUN_ERL_PIPE/" "$RUN_ERL_LOG/" "$ESCAPED"
fi

if [ -n "$ELIXIR_CLI_DRY_RUN" ]; then
  echo "$@"
else
  # it goes to here. $@:
  # erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra --version
  exec "$@"
fi

@josevalim

josevalim commented 4 years ago

Sweet. What happens if you run erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra --version manually?

siegfried commented 4 years ago
$ erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra --version
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:8:4] [ds:8:4:10] [async-threads:1]

{"init terminating in do_boot",{undef,[{'Elixir.Version',parse,[<<"1.11.0-dev">>],[]},{'Elixir.System',build,0,[{file,"/mnt/warehouse/repos/elixir/lib/elixir/lib/system.ex"},{line,229}]},{'Elixir.System',build_info,0,[{file,"/mnt/warehouse/repos/elixir/lib/elixir/lib/system.ex"},{line,219}]},{'Elixir.Kernel.CLI',parse_shared,2,[{file,"/mnt/warehouse/repos/elixir/lib/elixir/lib/kernel/cli.ex"},{line,224}]},{'Elixir.Kernel.CLI','shared_option?',3,[{file,"/mnt/warehouse/repos/elixir/lib/elixir/lib/kernel/cli.ex"},{line,163}]},{'Elixir.Kernel.CLI',main,1,[{file,"/mnt/warehouse/repos/elixir/lib/elixir/lib/kernel/cli.ex"},{line,25}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{Elixir.Version,parse,[],[]},{Elixir.System,build,0,[{_},{_}]},{Elixir.System,build_info,0,[{_},{_}]},{Elixir.Kernel.CLI,parse_shared,2,[{_},{_}]},{Elixir.Kernel.C

Crash dump is being written to: erl_crash.dump...done
josevalim commented 4 years ago

This is very weird. It can find the Elixir.System module but not the Version one? Can you find an Elixir.Version.beam in the ebin directory?

siegfried commented 4 years ago

No, I can't.

$ ls lib/elixir/ebin/Elixir.Version.beam
ls: lib/elixir/ebin/Elixir.Version.beam: No such file or directory
josevalim commented 4 years ago

This is the weirdest thing! Can you please call gmake clean test again and post the complete compilation result? Thanks!

siegfried commented 4 years ago
$ gmake clean test
rm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/src/elixir_parser.erl
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
rm -rf lib/*/_build/
rm -rf lib/*/tmp/
rm -rf lib/elixir/test/ebin/
rm -rf lib/mix/test/fixtures/deps_on_git_repo/
rm -rf lib/mix/test/fixtures/git_rebar/
rm -rf lib/mix/test/fixtures/git_repo/
rm -rf lib/mix/test/fixtures/git_sparse_repo/
rm -f erl_crash.dump
gmake[2]: Entering directory '/mnt/warehouse/repos/elixir'
rm -f man/elixir.1
rm -f man/elixir.1.bak
rm -f man/iex.1
rm -f man/iex.1.bak
gmake[2]: Leaving directory '/mnt/warehouse/repos/elixir'
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'
Recompile: src/elixir_utils
Recompile: src/elixir_tokenizer
Recompile: src/elixir_sup
Recompile: src/elixir_rewrite
Recompile: src/elixir_quote
Recompile: src/elixir_parser
Recompile: src/elixir_overridable
Recompile: src/elixir_module
Recompile: src/elixir_map
Recompile: src/elixir_locals
Recompile: src/elixir_lexical
Recompile: src/elixir_interpolation
Recompile: src/elixir_import
Recompile: src/elixir_fn
Recompile: src/elixir_expand
Recompile: src/elixir_errors
Recompile: src/elixir_erl_var
Recompile: src/elixir_erl_try
Recompile: src/elixir_erl_pass
Recompile: src/elixir_erl_for
Recompile: src/elixir_erl_compiler
Recompile: src/elixir_erl_clauses
Recompile: src/elixir_erl
Recompile: src/elixir_env
Recompile: src/elixir_dispatch
Recompile: src/elixir_def
Recompile: src/elixir_config
Recompile: src/elixir_compiler
Recompile: src/elixir_code_server
Recompile: src/elixir_clauses
Recompile: src/elixir_bootstrap
Recompile: src/elixir_bitstring
Recompile: src/elixir_aliases
Recompile: src/elixir
Generated elixir app
==> bootstrap (compile)
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Compiled lib/elixir/lib/kernel.ex
Compiled lib/elixir/lib/macro/env.ex
Compiled lib/elixir/lib/keyword.ex
Compiled lib/elixir/lib/module.ex
Compiled lib/elixir/lib/list.ex
Compiled lib/elixir/lib/macro.ex
Compiled lib/elixir/lib/kernel/typespec.ex
Compiled lib/elixir/lib/code.ex
Compiled lib/elixir/lib/code/identifier.ex
Compiled lib/elixir/lib/module/checker.ex
Compiled lib/elixir/lib/module/locals_tracker.ex
Compiled lib/elixir/lib/module/parallel_checker.ex
Compiled lib/elixir/lib/module/types/helpers.ex
Compiled lib/elixir/lib/module/types/infer.ex
Compiled lib/elixir/lib/module/types/expr.ex
Compiled lib/elixir/lib/module/types/pattern.ex
Compiled lib/elixir/lib/module/types.ex
Compiled lib/elixir/lib/kernel/utils.ex
Compiled lib/elixir/lib/exception.ex
Compiled lib/elixir/lib/protocol.ex
Compiled lib/elixir/lib/stream/reducers.ex
Compiled lib/elixir/lib/enum.ex
Compiled lib/elixir/lib/map.ex
Compiled lib/elixir/lib/inspect/algebra.ex
Compiled lib/elixir/lib/inspect.ex
Compiled lib/elixir/lib/access.ex
Compiled lib/elixir/lib/range.ex
Compiled lib/elixir/lib/regex.ex
Compiled lib/elixir/lib/string.ex
Compiled lib/elixir/lib/string/chars.ex
Compiled lib/elixir/lib/io.ex
Compiled lib/elixir/lib/path.ex
Compiled lib/elixir/lib/file.ex
Compiled lib/elixir/lib/system.ex
Compiled lib/elixir/lib/kernel/cli.ex
Compiled lib/elixir/lib/kernel/error_handler.ex
Compiled lib/elixir/lib/kernel/parallel_compiler.ex
Compiled lib/elixir/lib/kernel/lexical_tracker.ex
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
==> unicode (compile)
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'
==> elixir (compile)
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
Generated elixir app
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'
==> eex (compile)
==> mix (compile)
==> ex_unit (compile)
==> logger (compile)
==> iex (compile)
==> elixir (eunit)
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
  All 191 tests passed.

==> elixir (ex_unit)
==> ex_unit (ex_unit)
==> logger (ex_unit)
==> mix (ex_unit)
==> eex (ex_unit)
==> iex (ex_unit)
josevalim commented 4 years ago

Ok, so the issue is that we only bootstrap the language but we fail to fully compile it. We run this code:

https://github.com/elixir-lang/elixir/blob/master/Makefile#L91

But this one fails:

https://github.com/elixir-lang/elixir/blob/master/Makefile#L95

Can you try running this manually?

cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin

What does it return? What does "$@" in bin/elixir show when we execute this command?

siegfried commented 4 years ago
$ cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin
ksh: ELIXIRC: not found
ksh: ../../: cannot execute - Is a directory
josevalim commented 4 years ago

Sorry, my bad. It is supposed to be:

cd lib/elixir && ../../bin/elixirc "lib/**/*.ex" -o ebin
siegfried commented 4 years ago

Nothing happened after:

$ cd lib/elixir && ../../bin/elixirc "lib/**/*.ex" -o ebin

The $@ was erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra +elixirc lib/**/*.ex -o ebin

josevalim commented 4 years ago

@siegfried does it just exit immediately? No new files are added to ebin?

Can you please call git pull --rebase, to update your master, and then try running the following command from lib/elixir:

erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra +elixirc "lib/**/*.ex" -o ebin --verbose

Thanks!

siegfried commented 4 years ago

@siegfried does it just exit immediately? No new files are added to ebin?

Yes, it seemed that way.

Can you please call git pull --rebase, to update your master, and then try running the following command from lib/elixir:

erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra +elixirc "lib/**/*.ex" -o ebin --verbose

Thanks!

No problem. Here you are. Thanks!

$ erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra +elixirc "lib/**/*.ex" -o ebin --verbose
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
warning: redefining module Access (current version loaded from bin/../lib/elixir/ebin/Elixir.Access.beam)
  lib/elixir/lib/access.ex:1

warning: redefining module Code (current version loaded from bin/../lib/elixir/ebin/Elixir.Code.beam)
  lib/elixir/lib/code.ex:1

warning: redefining module Code.Identifier (current version loaded from bin/../lib/elixir/ebin/Elixir.Code.Identifier.beam)
  lib/elixir/lib/code/identifier.ex:1

warning: redefining module Exception (current version loaded from bin/../lib/elixir/ebin/Elixir.Exception.beam)
  lib/elixir/lib/exception.ex:1

warning: redefining module Enumerable (current version loaded from bin/../lib/elixir/ebin/Elixir.Enumerable.beam)
  lib/elixir/lib/enum.ex:1

warning: redefining module File (current version loaded from bin/../lib/elixir/ebin/Elixir.File.beam)
  lib/elixir/lib/file.ex:1

warning: redefining module Enum (current version loaded from bin/../lib/elixir/ebin/Elixir.Enum.beam)
  lib/elixir/lib/enum.ex:196

warning: redefining module RuntimeError (current version loaded from bin/../lib/elixir/ebin/Elixir.RuntimeError.beam)
  lib/elixir/lib/exception.ex:677

warning: redefining module ArgumentError (current version loaded from bin/../lib/elixir/ebin/Elixir.ArgumentError.beam)
  lib/elixir/lib/exception.ex:681

warning: redefining module ArithmeticError (current version loaded from bin/../lib/elixir/ebin/Elixir.ArithmeticError.beam)
  lib/elixir/lib/exception.ex:719

warning: redefining module SystemLimitError (current version loaded from bin/../lib/elixir/ebin/Elixir.SystemLimitError.beam)
  lib/elixir/lib/exception.ex:759

warning: redefining module SyntaxError (current version loaded from bin/../lib/elixir/ebin/Elixir.SyntaxError.beam)
  lib/elixir/lib/exception.ex:768

warning: redefining module TokenMissingError (current version loaded from bin/../lib/elixir/ebin/Elixir.TokenMissingError.beam)
  lib/elixir/lib/exception.ex:778

warning: redefining module CompileError (current version loaded from bin/../lib/elixir/ebin/Elixir.CompileError.beam)
  lib/elixir/lib/exception.ex:787

warning: redefining module BadFunctionError (current version loaded from bin/../lib/elixir/ebin/Elixir.BadFunctionError.beam)
  lib/elixir/lib/exception.ex:796

warning: redefining module BadStructError (current version loaded from bin/../lib/elixir/ebin/Elixir.BadStructError.beam)
  lib/elixir/lib/exception.ex:809

warning: redefining module BadMapError (current version loaded from bin/../lib/elixir/ebin/Elixir.BadMapError.beam)
  lib/elixir/lib/exception.ex:818

warning: redefining module BadBooleanError (current version loaded from bin/../lib/elixir/ebin/Elixir.BadBooleanError.beam)
  lib/elixir/lib/exception.ex:827

warning: redefining module MatchError (current version loaded from bin/../lib/elixir/ebin/Elixir.MatchError.beam)
  lib/elixir/lib/exception.ex:836

warning: redefining module CaseClauseError (current version loaded from bin/../lib/elixir/ebin/Elixir.CaseClauseError.beam)
  lib/elixir/lib/exception.ex:845

warning: redefining module WithClauseError (current version loaded from bin/../lib/elixir/ebin/Elixir.WithClauseError.beam)
  lib/elixir/lib/exception.ex:854

warning: redefining module CondClauseError (current version loaded from bin/../lib/elixir/ebin/Elixir.CondClauseError.beam)
  lib/elixir/lib/exception.ex:863

warning: redefining module TryClauseError (current version loaded from bin/../lib/elixir/ebin/Elixir.TryClauseError.beam)
  lib/elixir/lib/exception.ex:872

warning: redefining module BadArityError (current version loaded from bin/../lib/elixir/ebin/Elixir.BadArityError.beam)
  lib/elixir/lib/exception.ex:881

warning: redefining module Inspect (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.beam)
  lib/elixir/lib/inspect.ex:6

warning: redefining module UndefinedFunctionError (current version loaded from bin/../lib/elixir/ebin/Elixir.UndefinedFunctionError.beam)
  lib/elixir/lib/exception.ex:898

warning: redefining module Inspect.Opts (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Opts.beam)
  lib/elixir/lib/inspect/algebra.ex:1

warning: redefining module Inspect.Error (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Error.beam)
  lib/elixir/lib/inspect/algebra.ex:108

warning: redefining module Inspect.Atom (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Atom.beam)
  lib/elixir/lib/inspect.ex:91

warning: redefining module Inspect.BitString (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.BitString.beam)
  lib/elixir/lib/inspect.ex:103

warning: redefining module Inspect.Algebra (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Algebra.beam)
  lib/elixir/lib/inspect/algebra.ex:115

warning: redefining module Enumerable.List (current version loaded from bin/../lib/elixir/ebin/Elixir.Enumerable.List.beam)
  lib/elixir/lib/enum.ex:3678

warning: redefining module FunctionClauseError (current version loaded from bin/../lib/elixir/ebin/Elixir.FunctionClauseError.beam)
  lib/elixir/lib/exception.ex:1062

warning: redefining module Inspect.List (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.List.beam)
  lib/elixir/lib/inspect.ex:166

warning: redefining module Enumerable.Map (current version loaded from bin/../lib/elixir/ebin/Elixir.Enumerable.Map.beam)
  lib/elixir/lib/enum.ex:3700

warning: redefining module Enumerable.Function (current version loaded from bin/../lib/elixir/ebin/Elixir.Enumerable.Function.beam)
  lib/elixir/lib/enum.ex:3723

warning: redefining module Inspect.Tuple (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Tuple.beam)
  lib/elixir/lib/inspect.ex:239

warning: redefining module Code.LoadError (current version loaded from bin/../lib/elixir/ebin/Elixir.Code.LoadError.beam)
  lib/elixir/lib/exception.ex:1157

warning: redefining module Inspect.Map (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Map.beam)
  lib/elixir/lib/inspect.ex:249

warning: redefining module Inspect.Integer (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Integer.beam)
  lib/elixir/lib/inspect.ex:276

warning: redefining module Protocol.UndefinedError (current version loaded from bin/../lib/elixir/ebin/Elixir.Protocol.UndefinedError.beam)
  lib/elixir/lib/exception.ex:1166

warning: redefining module Inspect.Float (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Float.beam)
  lib/elixir/lib/inspect.ex:309

warning: redefining module KeyError (current version loaded from bin/../lib/elixir/ebin/Elixir.KeyError.beam)
  lib/elixir/lib/exception.ex:1206

warning: redefining module Inspect.Regex (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Regex.beam)
  lib/elixir/lib/inspect.ex:316

warning: redefining module IO (current version loaded from bin/../lib/elixir/ebin/Elixir.IO.beam)
  lib/elixir/lib/io.ex:1

warning: redefining module Inspect.Function (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Function.beam)
  lib/elixir/lib/inspect.ex:341

warning: redefining module UnicodeConversionError (current version loaded from bin/../lib/elixir/ebin/Elixir.UnicodeConversionError.beam)
  lib/elixir/lib/exception.ex:1275

warning: redefining module Enum.OutOfBoundsError (current version loaded from bin/../lib/elixir/ebin/Elixir.Enum.OutOfBoundsError.beam)
  lib/elixir/lib/exception.ex:1298

warning: redefining module Inspect.PID (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.PID.beam)
  lib/elixir/lib/inspect.ex:390

warning: redefining module Inspect.Port (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Port.beam)
  lib/elixir/lib/inspect.ex:396

warning: redefining module Enum.EmptyError (current version loaded from bin/../lib/elixir/ebin/Elixir.Enum.EmptyError.beam)
  lib/elixir/lib/exception.ex:1302

warning: redefining module Inspect.Reference (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Reference.beam)
  lib/elixir/lib/inspect.ex:402

warning: redefining module File.Error (current version loaded from bin/../lib/elixir/ebin/Elixir.File.Error.beam)
  lib/elixir/lib/exception.ex:1306

warning: redefining module Inspect.Any (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Any.beam)
  lib/elixir/lib/inspect.ex:409

warning: redefining module Inspect.Macro.Env (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Macro.Env.beam)
  lib/elixir/lib/inspect.ex:470

warning: redefining module File.CopyError (current version loaded from bin/../lib/elixir/ebin/Elixir.File.CopyError.beam)
  lib/elixir/lib/exception.ex:1324

warning: redefining module File.RenameError (current version loaded from bin/../lib/elixir/ebin/Elixir.File.RenameError.beam)
  lib/elixir/lib/exception.ex:1342

warning: redefining module File.LinkError (current version loaded from bin/../lib/elixir/ebin/Elixir.File.LinkError.beam)
  lib/elixir/lib/exception.ex:1360

warning: redefining module Kernel.CLI (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.CLI.beam)
  lib/elixir/lib/kernel/cli.ex:1

warning: redefining module ErlangError (current version loaded from bin/../lib/elixir/ebin/Elixir.ErlangError.beam)
  lib/elixir/lib/exception.ex:1372

warning: redefining module Kernel.ErrorHandler (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.ErrorHandler.beam)
  lib/elixir/lib/kernel/error_handler.ex:3

warning: redefining module Kernel.LexicalTracker (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.LexicalTracker.beam)
  lib/elixir/lib/kernel/lexical_tracker.ex:7

warning: redefining module Kernel (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.beam)
  lib/elixir/lib/kernel.ex:9

warning: redefining module Kernel.ParallelCompiler (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.ParallelCompiler.beam)
  lib/elixir/lib/kernel/parallel_compiler.ex:1

warning: redefining module Kernel.Typespec (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.Typespec.beam)
  lib/elixir/lib/kernel/typespec.ex:1

warning: redefining module Kernel.Utils (current version loaded from bin/../lib/elixir/ebin/Elixir.Kernel.Utils.beam)
  lib/elixir/lib/kernel/utils.ex:3

warning: redefining module Keyword (current version loaded from bin/../lib/elixir/ebin/Elixir.Keyword.beam)
  lib/elixir/lib/keyword.ex:1

warning: redefining module List (current version loaded from bin/../lib/elixir/ebin/Elixir.List.beam)
  lib/elixir/lib/list.ex:1

warning: redefining module Macro.Env (current version loaded from bin/../lib/elixir/ebin/Elixir.Macro.Env.beam)
  lib/elixir/lib/macro/env.ex:1

warning: redefining module Macro (current version loaded from bin/../lib/elixir/ebin/Elixir.Macro.beam)
  lib/elixir/lib/macro.ex:3

warning: redefining module Map (current version loaded from bin/../lib/elixir/ebin/Elixir.Map.beam)
  lib/elixir/lib/map.ex:1

warning: redefining module Module (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.beam)
  lib/elixir/lib/module.ex:1

warning: redefining module Module.Checker (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.Checker.beam)
  lib/elixir/lib/module/checker.ex:1

warning: redefining module Module.LocalsTracker (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.LocalsTracker.beam)
  lib/elixir/lib/module/locals_tracker.ex:15

warning: redefining module Module.ParallelChecker (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.ParallelChecker.beam)
  lib/elixir/lib/module/parallel_checker.ex:1

warning: redefining module Module.Types (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.Types.beam)
  lib/elixir/lib/module/types.ex:1

warning: redefining module Module.Types.Expr (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.Types.Expr.beam)
  lib/elixir/lib/module/types/expr.ex:1

warning: redefining module Module.Types.Helpers (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.Types.Helpers.beam)
  lib/elixir/lib/module/types/helpers.ex:1

warning: redefining module Module.Types.Infer (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.Types.Infer.beam)
  lib/elixir/lib/module/types/infer.ex:1

warning: redefining module Module.Types.Pattern (current version loaded from bin/../lib/elixir/ebin/Elixir.Module.Types.Pattern.beam)
  lib/elixir/lib/module/types/pattern.ex:1

warning: redefining module Path (current version loaded from bin/../lib/elixir/ebin/Elixir.Path.beam)
  lib/elixir/lib/path.ex:1

warning: redefining module Path.Wildcard (current version loaded from bin/../lib/elixir/ebin/Elixir.Path.Wildcard.beam)
  lib/elixir/lib/path.ex:575

warning: redefining module Protocol (current version loaded from bin/../lib/elixir/ebin/Elixir.Protocol.beam)
  lib/elixir/lib/protocol.ex:1

warning: redefining module Range (current version loaded from bin/../lib/elixir/ebin/Elixir.Range.beam)
  lib/elixir/lib/range.ex:1

warning: redefining module Enumerable.Range (current version loaded from bin/../lib/elixir/ebin/Elixir.Enumerable.Range.beam)
  lib/elixir/lib/range.ex:102

warning: redefining module Inspect.Range (current version loaded from bin/../lib/elixir/ebin/Elixir.Inspect.Range.beam)
  lib/elixir/lib/range.ex:162

warning: redefining module Regex (current version loaded from bin/../lib/elixir/ebin/Elixir.Regex.beam)
  lib/elixir/lib/regex.ex:1

warning: redefining module Regex.CompileError (current version loaded from bin/../lib/elixir/ebin/Elixir.Regex.CompileError.beam)
  lib/elixir/lib/regex.ex:150

warning: redefining module Stream.Reducers (current version loaded from bin/../lib/elixir/ebin/Elixir.Stream.Reducers.beam)
  lib/elixir/lib/stream/reducers.ex:1

warning: redefining module String.Chars (current version loaded from bin/../lib/elixir/ebin/Elixir.String.Chars.beam)
  lib/elixir/lib/string/chars.ex:3

warning: redefining module String (current version loaded from bin/../lib/elixir/ebin/Elixir.String.beam)
  lib/elixir/lib/string.ex:3

warning: redefining module String.Chars.Atom (current version loaded from bin/../lib/elixir/ebin/Elixir.String.Chars.Atom.beam)
  lib/elixir/lib/string/chars.ex:25

warning: redefining module String.Chars.BitString (current version loaded from bin/../lib/elixir/ebin/Elixir.String.Chars.BitString.beam)
  lib/elixir/lib/string/chars.ex:35

warning: redefining module String.Chars.List (current version loaded from bin/../lib/elixir/ebin/Elixir.String.Chars.List.beam)
  lib/elixir/lib/string/chars.ex:48

warning: redefining module String.Chars.Integer (current version loaded from bin/../lib/elixir/ebin/Elixir.String.Chars.Integer.beam)
  lib/elixir/lib/string/chars.ex:52

warning: redefining module String.Chars.Float (current version loaded from bin/../lib/elixir/ebin/Elixir.String.Chars.Float.beam)
  lib/elixir/lib/string/chars.ex:58

warning: redefining module System (current version loaded from bin/../lib/elixir/ebin/Elixir.System.beam)
  lib/elixir/lib/system.ex:1

warning: redefining module A (current version loaded from ebin/Elixir.A.beam)
  lib/mix/test/fixtures/test_stale/lib/a.ex:1

warning: redefining module B (current version loaded from ebin/Elixir.B.beam)
  lib/mix/test/fixtures/test_stale/lib/b.ex:1

warning: redefining module Bar (current version loaded from ebin/Elixir.Bar.beam)
  lib/mix/test/fixtures/umbrella_test/apps/bar/lib/bar.ex:1

== Compilation error in file lib/mix/test/fixtures/umbrella_test/apps/foo/lib/foo.ex ==
** (CompileError) lib/mix/test/fixtures/umbrella_test/apps/foo/lib/foo.ex:1: cannot define module Foo because it is currently being defined in lib/mix/test/fixtures/umbrella_dep/deps/umbrella/apps/foo/lib/foo.ex:1
    (stdlib 3.11.1) erl_eval.erl:680: :erl_eval.do_apply/6
josevalim commented 4 years ago

Oh, it did compile now, but you ran it from root instead of inside lib/elixir, hence the error. Can you try again by running “make clean” and then the same command but inside the lib/elixir folder? Thanks!

siegfried commented 4 years ago
$ gmake clean
rm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/src/elixir_parser.erl
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
rm -rf lib/*/_build/
rm -rf lib/*/tmp/
rm -rf lib/elixir/test/ebin/
rm -rf lib/mix/test/fixtures/deps_on_git_repo/
rm -rf lib/mix/test/fixtures/git_rebar/
rm -rf lib/mix/test/fixtures/git_repo/
rm -rf lib/mix/test/fixtures/git_sparse_repo/
rm -f erl_crash.dump
gmake[2]: Entering directory '/mnt/warehouse/repos/elixir'
rm -f man/elixir.1
rm -f man/elixir.1.bak
rm -f man/iex.1
rm -f man/iex.1.bak
gmake[2]: Leaving directory '/mnt/warehouse/repos/elixir'
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'

$ cd lib/elixir/
$ erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra +elixirc "lib/**/*.ex" -o ebin --verbose
{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
josevalim commented 4 years ago

Sorry, please run gmake compile once before running the command.

siegfried commented 4 years ago
$ erl -pa /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin -elixir ansi_enabled true -noshell -s elixir start_cli -extra +elixirc "lib/**/*.ex" -o ebin --verbose 
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
warning: redefining module Access (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Access.beam)
  lib/access.ex:1

Compiling lib/atom.ex
Compiling lib/agent.ex
Compiling lib/behaviour.ex
Compiling lib/bitwise.ex
Compiling lib/application.ex
Compiling lib/access.ex
Compiling lib/calendar.ex
Compiling lib/calendar/date.ex
Compiling lib/calendar/date_range.ex
Compiling lib/calendar/time_zone_database.ex
warning: redefining module Code (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Code.beam)
  lib/code.ex:1

Compiling lib/calendar/time.ex
Compiling lib/code.ex
Compiling lib/calendar/naive_datetime.ex
warning: redefining module Code.Identifier (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Code.Identifier.beam)
  lib/code/identifier.ex:1

Compiling lib/calendar/datetime.ex
Compiling lib/calendar/iso.ex
Compiling lib/code/identifier.ex
Compiling lib/code/typespec.ex
Compiling lib/collectable.ex
Compiling lib/config.ex
Compiling lib/config/provider.ex
Compiling lib/dict.ex
warning: redefining module Exception (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Exception.beam)
  lib/exception.ex:1

warning: redefining module File (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.File.beam)
  lib/file.ex:1

warning: redefining module Enumerable (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enumerable.beam)
  lib/enum.ex:1

warning: redefining module Enum (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enum.beam)
  lib/enum.ex:196

Compiling lib/code/formatter.ex
warning: redefining module RuntimeError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.RuntimeError.beam)
  lib/exception.ex:677

Compiling lib/file.ex
warning: redefining module ArgumentError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.ArgumentError.beam)
  lib/exception.ex:681

warning: redefining module ArithmeticError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.ArithmeticError.beam)
  lib/exception.ex:719

Compiling lib/file/stream.ex
Compiling lib/function.ex
Compiling lib/float.ex
warning: redefining module SystemLimitError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.SystemLimitError.beam)
  lib/exception.ex:759

warning: redefining module SyntaxError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.SyntaxError.beam)
  lib/exception.ex:768

warning: redefining module TokenMissingError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.TokenMissingError.beam)
  lib/exception.ex:778

Compiling lib/gen_event/stream.ex
Compiling lib/gen_server.ex
warning: redefining module CompileError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.CompileError.beam)
  lib/exception.ex:787

Compiling lib/agent/server.ex
warning: redefining module BadFunctionError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.BadFunctionError.beam)
  lib/exception.ex:796

warning: redefining module BadStructError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.BadStructError.beam)
  lib/exception.ex:809

warning: redefining module BadMapError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.BadMapError.beam)
  lib/exception.ex:818

warning: redefining module BadBooleanError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.BadBooleanError.beam)
  lib/exception.ex:827

warning: redefining module MatchError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.MatchError.beam)
  lib/exception.ex:836

Compiling lib/hash_dict.ex
warning: redefining module CaseClauseError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.CaseClauseError.beam)
  lib/exception.ex:845

Compiling lib/hash_set.ex
warning: redefining module Inspect.Opts (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Opts.beam)
  lib/inspect/algebra.ex:1

warning: redefining module Inspect (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.beam)
  lib/inspect.ex:6

warning: redefining module WithClauseError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.WithClauseError.beam)
  lib/exception.ex:854

warning: redefining module Inspect.Error (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Error.beam)
  lib/inspect/algebra.ex:108

warning: redefining module CondClauseError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.CondClauseError.beam)
  lib/exception.ex:863

warning: redefining module Inspect.Algebra (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Algebra.beam)
  lib/inspect/algebra.ex:115

warning: redefining module TryClauseError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.TryClauseError.beam)
  lib/exception.ex:872

warning: redefining module Inspect.Atom (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Atom.beam)
  lib/inspect.ex:91

warning: redefining module Inspect.BitString (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.BitString.beam)
  lib/inspect.ex:103

warning: redefining module BadArityError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.BadArityError.beam)
  lib/exception.ex:881

warning: redefining module Inspect.List (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.List.beam)
  lib/inspect.ex:166

warning: redefining module Inspect.Tuple (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Tuple.beam)
  lib/inspect.ex:239

warning: redefining module UndefinedFunctionError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.UndefinedFunctionError.beam)
  lib/exception.ex:898

warning: redefining module Inspect.Map (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Map.beam)
  lib/inspect.ex:249

warning: redefining module Inspect.Integer (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Integer.beam)
  lib/inspect.ex:276

warning: redefining module Inspect.Float (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Float.beam)
  lib/inspect.ex:309

warning: redefining module Inspect.Regex (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Regex.beam)
  lib/inspect.ex:316

warning: redefining module FunctionClauseError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.FunctionClauseError.beam)
  lib/exception.ex:1062

warning: redefining module Inspect.Function (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Function.beam)
  lib/inspect.ex:341

warning: redefining module Enumerable.List (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enumerable.List.beam)
  lib/enum.ex:3678

warning: redefining module Code.LoadError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Code.LoadError.beam)
  lib/exception.ex:1157

warning: redefining module Inspect.PID (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.PID.beam)
  lib/inspect.ex:390

Compiling lib/inspect/algebra.ex
warning: redefining module Inspect.Port (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Port.beam)
  lib/inspect.ex:396

warning: redefining module Enumerable.Map (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enumerable.Map.beam)
  lib/enum.ex:3700

warning: redefining module Protocol.UndefinedError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Protocol.UndefinedError.beam)
  lib/exception.ex:1166

warning: redefining module Inspect.Reference (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Reference.beam)
  lib/inspect.ex:402

warning: redefining module Enumerable.Function (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enumerable.Function.beam)
  lib/enum.ex:3723

warning: redefining module Inspect.Any (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Any.beam)
  lib/inspect.ex:409

Compiling lib/enum.ex
warning: redefining module IO (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.IO.beam)
  lib/io.ex:1

warning: redefining module KeyError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.KeyError.beam)
  lib/exception.ex:1206

warning: redefining module Inspect.Macro.Env (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Macro.Env.beam)
  lib/inspect.ex:470

Compiling lib/integer.ex
Compiling lib/inspect.ex
warning: redefining module UnicodeConversionError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.UnicodeConversionError.beam)
  lib/exception.ex:1275

warning: redefining module Enum.OutOfBoundsError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enum.OutOfBoundsError.beam)
  lib/exception.ex:1298

Compiling lib/io.ex
warning: redefining module Enum.EmptyError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enum.EmptyError.beam)
  lib/exception.ex:1302

warning: redefining module File.Error (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.File.Error.beam)
  lib/exception.ex:1306

warning: redefining module File.CopyError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.File.CopyError.beam)
  lib/exception.ex:1324

Compiling lib/io/stream.ex
Compiling lib/io/ansi.ex
warning: redefining module Kernel.CLI (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.CLI.beam)
  lib/kernel/cli.ex:1

warning: redefining module File.RenameError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.File.RenameError.beam)
  lib/exception.ex:1342

Compiling lib/io/ansi/docs.ex
warning: redefining module File.LinkError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.File.LinkError.beam)
  lib/exception.ex:1360

warning: redefining module Kernel.ErrorHandler (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.ErrorHandler.beam)
  lib/kernel/error_handler.ex:3

Compiling lib/kernel/error_handler.ex
warning: redefining module Kernel.LexicalTracker (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.LexicalTracker.beam)
  lib/kernel/lexical_tracker.ex:7

warning: redefining module ErlangError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.ErlangError.beam)
  lib/exception.ex:1372

Compiling lib/exception.ex
Compiling lib/kernel/lexical_tracker.ex
warning: redefining module Kernel.ParallelCompiler (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.ParallelCompiler.beam)
  lib/kernel/parallel_compiler.ex:1

warning: redefining module Kernel (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.beam)
  lib/kernel.ex:9

Compiling lib/kernel/parallel_require.ex
Compiling lib/kernel/cli.ex
warning: redefining module Kernel.Typespec (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.Typespec.beam)
  lib/kernel/typespec.ex:1

Compiling lib/kernel/special_forms.ex
warning: redefining module Kernel.Utils (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Kernel.Utils.beam)
  lib/kernel/utils.ex:3

Compiling lib/kernel/utils.ex
warning: redefining module Keyword (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Keyword.beam)
  lib/keyword.ex:1

Compiling lib/kernel/parallel_compiler.ex
warning: redefining module List (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.List.beam)
  lib/list.ex:1

Compiling lib/keyword.ex
Compiling lib/list.ex
warning: redefining module Macro (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Macro.beam)
  lib/macro.ex:3

Compiling lib/kernel/typespec.ex
warning: redefining module Macro.Env (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Macro.Env.beam)
  lib/macro/env.ex:1

Compiling lib/macro/env.ex
warning: redefining module Map (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Map.beam)
  lib/map.ex:1

Compiling lib/list/chars.ex
Compiling lib/map.ex
warning: redefining module Module (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.beam)
  lib/module.ex:1

Compiling lib/map_set.ex
warning: redefining module Module.Checker (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.Checker.beam)
  lib/module/checker.ex:1

Compiling lib/kernel.ex
warning: redefining module Module.LocalsTracker (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.LocalsTracker.beam)
  lib/module/locals_tracker.ex:15

Compiling lib/module/locals_tracker.ex
warning: redefining module Module.ParallelChecker (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.ParallelChecker.beam)
  lib/module/parallel_checker.ex:1

Compiling lib/module/checker.ex
Compiling lib/macro.ex
warning: redefining module Module.Types (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.Types.beam)
  lib/module/types.ex:1

warning: redefining module Module.Types.Expr (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.Types.Expr.beam)
  lib/module/types/expr.ex:1

Compiling lib/module/types/expr.ex
warning: redefining module Module.Types.Helpers (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.Types.Helpers.beam)
  lib/module/types/helpers.ex:1

Compiling lib/module/parallel_checker.ex
warning: redefining module Module.Types.Infer (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.Types.Infer.beam)
  lib/module/types/infer.ex:1

Compiling lib/module/types/helpers.ex
warning: redefining module Module.Types.Pattern (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Module.Types.Pattern.beam)
  lib/module/types/pattern.ex:1

Compiling lib/module/types.ex
Compiling lib/node.ex
Compiling lib/module/types/infer.ex
warning: redefining module Path (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Path.beam)
  lib/path.ex:1

Compiling lib/module.ex
warning: redefining module Path.Wildcard (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Path.Wildcard.beam)
  lib/path.ex:575

Compiling lib/port.ex
Compiling lib/module/types/pattern.ex
warning: redefining module Protocol (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Protocol.beam)
  lib/protocol.ex:1

Compiling lib/path.ex
Compiling lib/option_parser.ex
warning: redefining module Range (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Range.beam)
  lib/range.ex:1

warning: redefining module Enumerable.Range (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Enumerable.Range.beam)
  lib/range.ex:102

Compiling lib/protocol.ex
warning: redefining module Inspect.Range (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Inspect.Range.beam)
  lib/range.ex:162

Compiling lib/record/extractor.ex
Compiling lib/range.ex
warning: redefining module Regex (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Regex.beam)
  lib/regex.ex:1

Compiling lib/record.ex
Compiling lib/process.ex
warning: redefining module Regex.CompileError (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Regex.CompileError.beam)
  lib/regex.ex:150

Compiling lib/dynamic_supervisor.ex
Compiling lib/config/reader.ex
Compiling lib/regex.ex
Compiling lib/file/stat.ex
warning: redefining module Stream.Reducers (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.Stream.Reducers.beam)
  lib/stream/reducers.ex:1

Compiling lib/gen_event.ex
Compiling lib/set.ex
warning: redefining module String.Chars (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.Chars.beam)
  lib/string/chars.ex:3

warning: redefining module String (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.beam)
  lib/string.ex:3

Compiling lib/stream/reducers.ex
warning: redefining module String.Chars.Atom (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.Chars.Atom.beam)
  lib/string/chars.ex:25

warning: redefining module String.Chars.BitString (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.Chars.BitString.beam)
  lib/string/chars.ex:35

warning: redefining module String.Chars.List (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.Chars.List.beam)
  lib/string/chars.ex:48

warning: redefining module String.Chars.Integer (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.Chars.Integer.beam)
  lib/string/chars.ex:52

Compiling lib/string_io.ex
warning: redefining module String.Chars.Float (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.String.Chars.Float.beam)
  lib/string/chars.ex:58

Compiling lib/string/chars.ex
Compiling lib/supervisor/default.ex
Compiling lib/supervisor.ex
Compiling lib/supervisor/spec.ex
warning: redefining module System (current version loaded from /mnt/warehouse/repos/elixir/bin/../lib/elixir/ebin/Elixir.System.beam)
  lib/system.ex:1

Compiling lib/registry.ex
Compiling lib/stream.ex
Compiling lib/system.ex
Compiling lib/string.ex
Compiling lib/task.ex
Compiling lib/tuple.ex
Compiling lib/task/supervisor.ex
Compiling lib/task/supervised.ex
Compiling lib/uri.ex
Compiling lib/version.ex
Compiling lib/base.ex
warning: String.Break.split/1 is undefined (module String.Break is not available or is yet to be defined)
  lib/string.ex:371: String.split/1

warning: String.Break.trim_leading/1 is undefined (module String.Break is not available or is yet to be defined)
Found at 2 locations:
  lib/string.ex:1056: String.lstrip/1
  lib/string.ex:1087: String.trim_leading/1

warning: String.Break.trim_trailing/1 is undefined (module String.Break is not available or is yet to be defined)
Found at 2 locations:
  lib/string.ex:843: String.rstrip/1
  lib/string.ex:1117: String.trim_trailing/1

warning: String.Casing.downcase/3 is undefined (module String.Casing is not available or is yet to be defined)
Found at 2 locations:
  lib/string.ex:790: String.downcase/2
  lib/string.ex:798: String.downcase/2

warning: String.Casing.titlecase_once/2 is undefined (module String.Casing is not available or is yet to be defined)
  lib/string.ex:837: String.capitalize/2

warning: String.Casing.upcase/3 is undefined (module String.Casing is not available or is yet to be defined)
Found at 2 locations:
  lib/string.ex:730: String.upcase/2
  lib/string.ex:738: String.upcase/2

warning: String.Unicode.codepoints/1 is undefined (module String.Unicode is not available or is yet to be defined)
  lib/string.ex:1558: String.codepoints/1

warning: String.Unicode.graphemes/1 is undefined (module String.Unicode is not available or is yet to be defined)
  lib/string.ex:1723: String.graphemes/1

warning: String.Unicode.length/1 is undefined (module String.Unicode is not available or is yet to be defined)
  lib/string.ex:1822: String.length/1

warning: String.Unicode.next_codepoint/1 is undefined (module String.Unicode is not available or is yet to be defined)
  lib/string.ex:1603: String.next_codepoint/1

warning: String.Unicode.next_grapheme_size/1 is undefined (module String.Unicode is not available or is yet to be defined)
  lib/string.ex:1762: String.next_grapheme_size/1

warning: String.Unicode.split_at/2 is undefined (module String.Unicode is not available or is yet to be defined)
Found at 5 locations:
  lib/string.ex:641: String.do_split_at/2
  lib/string.ex:1862: String.do_at/2
  lib/string.ex:1912: String.slice/3
  lib/string.ex:1917: String.slice/3
  lib/string.ex:1986: String.slice/2
josevalim commented 4 years ago

So it worked now but it doesn't work when it is invoked from the makefile?! That's so weird. It makes me think it is a Makefile/gmake issue. Can you please try this:

$ gmake clean
$ gmake compile Q=

And post the full output? Thanks!

siegfried commented 4 years ago
$ gmake clean
rm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/src/elixir_parser.erl
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
rm -rf lib/*/_build/
rm -rf lib/*/tmp/
rm -rf lib/elixir/test/ebin/
rm -rf lib/mix/test/fixtures/deps_on_git_repo/
rm -rf lib/mix/test/fixtures/git_rebar/
rm -rf lib/mix/test/fixtures/git_repo/
rm -rf lib/mix/test/fixtures/git_sparse_repo/
rm -f erl_crash.dump
gmake[2]: Entering directory '/mnt/warehouse/repos/elixir'
rm -f man/elixir.1
rm -f man/elixir.1.bak
rm -f man/iex.1
rm -f man/iex.1.bak
gmake[2]: Leaving directory '/mnt/warehouse/repos/elixir'
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'

$ gmake compile Q=
erlc -o lib/elixir/src/elixir_parser.erl +'{verbose,true}' +'{report,true}' lib/elixir/src/elixir_parser.yrl
if [ ! -f lib/elixir/ebin/elixir.app ]; then    erl -noshell -eval '{V,_} = string:to_integer(erlang:system_info(otp_release)), io:fwrite("~s", [is_integer(V) and (V >= 21)])' -s erlang halt | grep -q '^true'; if [ $? != 0 ]; then echo "At least Erlang/OTP 21.0 is required to build Elixir"; exit 1; fi; fi
cd lib/elixir && mkdir -p ebin && erl -make
Recompile: src/elixir_utils
Recompile: src/elixir_tokenizer
Recompile: src/elixir_sup
Recompile: src/elixir_rewrite
Recompile: src/elixir_quote
Recompile: src/elixir_parser
Recompile: src/elixir_overridable
Recompile: src/elixir_module
Recompile: src/elixir_map
Recompile: src/elixir_locals
Recompile: src/elixir_lexical
Recompile: src/elixir_interpolation
Recompile: src/elixir_import
Recompile: src/elixir_fn
Recompile: src/elixir_expand
Recompile: src/elixir_errors
Recompile: src/elixir_erl_var
Recompile: src/elixir_erl_try
Recompile: src/elixir_erl_pass
Recompile: src/elixir_erl_for
Recompile: src/elixir_erl_compiler
Recompile: src/elixir_erl_clauses
Recompile: src/elixir_erl
Recompile: src/elixir_env
Recompile: src/elixir_dispatch
Recompile: src/elixir_def
Recompile: src/elixir_config
Recompile: src/elixir_compiler
Recompile: src/elixir_code_server
Recompile: src/elixir_clauses
Recompile: src/elixir_bootstrap
Recompile: src/elixir_bitstring
Recompile: src/elixir_aliases
Recompile: src/elixir
/mnt/warehouse/repos/elixir/lib/elixir/generate_app.escript lib/elixir/src/elixir.app.src lib/elixir/ebin/elixir.app 1.11.0-dev
Generated elixir app
if [ ! -f lib/elixir/ebin/Elixir.Kernel.beam ]; then \
    echo "==> bootstrap (compile)"; \
    erl -I lib/elixir/include -noshell -pa lib/elixir/ebin -s elixir_compiler bootstrap -s erlang halt; \
fi
==> bootstrap (compile)
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Compiled lib/elixir/lib/kernel.ex
Compiled lib/elixir/lib/macro/env.ex
Compiled lib/elixir/lib/keyword.ex
Compiled lib/elixir/lib/module.ex
Compiled lib/elixir/lib/list.ex
Compiled lib/elixir/lib/macro.ex
Compiled lib/elixir/lib/kernel/typespec.ex
Compiled lib/elixir/lib/code.ex
Compiled lib/elixir/lib/code/identifier.ex
Compiled lib/elixir/lib/module/checker.ex
Compiled lib/elixir/lib/module/locals_tracker.ex
Compiled lib/elixir/lib/module/parallel_checker.ex
Compiled lib/elixir/lib/module/types/helpers.ex
Compiled lib/elixir/lib/module/types/infer.ex
Compiled lib/elixir/lib/module/types/expr.ex
Compiled lib/elixir/lib/module/types/pattern.ex
Compiled lib/elixir/lib/module/types.ex
Compiled lib/elixir/lib/kernel/utils.ex
Compiled lib/elixir/lib/exception.ex
Compiled lib/elixir/lib/protocol.ex
Compiled lib/elixir/lib/stream/reducers.ex
Compiled lib/elixir/lib/enum.ex
Compiled lib/elixir/lib/map.ex
Compiled lib/elixir/lib/inspect/algebra.ex
Compiled lib/elixir/lib/inspect.ex
Compiled lib/elixir/lib/access.ex
Compiled lib/elixir/lib/range.ex
Compiled lib/elixir/lib/regex.ex
Compiled lib/elixir/lib/string.ex
Compiled lib/elixir/lib/string/chars.ex
Compiled lib/elixir/lib/io.ex
Compiled lib/elixir/lib/path.ex
Compiled lib/elixir/lib/file.ex
Compiled lib/elixir/lib/system.ex
Compiled lib/elixir/lib/kernel/cli.ex
Compiled lib/elixir/lib/kernel/error_handler.ex
Compiled lib/elixir/lib/kernel/parallel_compiler.ex
Compiled lib/elixir/lib/kernel/lexical_tracker.ex
gmake unicode
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
==> unicode (compile)
bin/elixirc --verbose --ignore-module-conflict  lib/elixir/unicode/unicode.ex -o lib/elixir/ebin;
bin/elixirc --verbose --ignore-module-conflict  lib/elixir/unicode/properties.ex -o lib/elixir/ebin;
bin/elixirc --verbose --ignore-module-conflict  lib/elixir/unicode/tokenizer.ex -o lib/elixir/ebin;
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'
==> elixir (compile)
cd lib/elixir && ../../bin/elixirc --verbose --ignore-module-conflict  "lib/**/*.ex" -o ebin;
gmake app
gmake[1]: Entering directory '/mnt/warehouse/repos/elixir'
/mnt/warehouse/repos/elixir/lib/elixir/generate_app.escript lib/elixir/src/elixir.app.src lib/elixir/ebin/elixir.app 1.11.0-dev
Generated elixir app
gmake[1]: Leaving directory '/mnt/warehouse/repos/elixir'
==> eex (compile)
cd lib/eex && ../../bin/elixirc --verbose --ignore-module-conflict  "lib/**/*.ex" -o ebin
==> mix (compile)
cd lib/mix && ../../bin/elixirc --verbose --ignore-module-conflict  "lib/**/*.ex" -o ebin
cd lib/mix && ../../bin/elixir -e 'Mix.start(:permanent, [])' -r mix.exs -e 'Mix.Task.run("compile.app", ~w[--compile-path ebin])'
==> ex_unit (compile)
cd lib/ex_unit && ../../bin/elixirc --verbose --ignore-module-conflict  "lib/**/*.ex" -o ebin
cd lib/ex_unit && ../../bin/elixir -e 'Mix.start(:permanent, [])' -r mix.exs -e 'Mix.Task.run("compile.app", ~w[--compile-path ebin])'
==> logger (compile)
cd lib/logger && ../../bin/elixirc --verbose --ignore-module-conflict  "lib/**/*.ex" -o ebin
cd lib/logger && ../../bin/elixir -e 'Mix.start(:permanent, [])' -r mix.exs -e 'Mix.Task.run("compile.app", ~w[--compile-path ebin])'
cd lib/eex && ../../bin/elixir -e 'Mix.start(:permanent, [])' -r mix.exs -e 'Mix.Task.run("compile.app", ~w[--compile-path ebin])'
==> iex (compile)
cd lib/iex && ../../bin/elixirc --verbose --ignore-module-conflict  "lib/**/*.ex" -o ebin
cd lib/iex && ../../bin/elixir -e 'Mix.start(:permanent, [])' -r mix.exs -e 'Mix.Task.run("compile.app", ~w[--compile-path ebin])'
josevalim commented 4 years ago

Sorry @siegfried but to me everything looks correct. The commands look correct and when we execute them directly, they seem to work too. I am afraid I won't be able to help further without having a way to reproduce it locally.

siegfried commented 4 years ago

Will a VM image help? Or remote SSH access?

josevalim commented 4 years ago

If there is nothing important in the machine, I think SSH access can help. You can find my e-mail in my GitHub page. :)

josevalim commented 4 years ago

A VM image also helps of course!

josevalim commented 4 years ago

So I was able to look into this. The issue is that exec "$@" is not executing at all. It simply does not invoke erl, nor does it fail.

I have tried to further isolate the issue in a simple sh file but these work:

set -- pwd
exec "$@"

as well as

set -- `which erl`
exec "$@"

However, this DOES NOT:

set -- erl
exec "$@"

Maybe there is some limitations on exec for FreeBSD? What puzzles me is that we use same gmake compile command in our FreeBSD CIs and they work just fine.

Therefore if someone has any idea of what can be happening here, it would be appreciated.

chrismcg commented 4 years ago

I can't remember if it's Elixir or another project but I remember having a weird failure because I had CD_PATH set. So I wonder if there's some environment variable that could be affecting things.

siegfried commented 4 years ago

Does it has something to do with the path of erl?

josevalim commented 4 years ago

I don't see anything wrong with the path of erl. :/ CD_PATH is not set either.

josevalim commented 4 years ago

@siegfried were you able, by any chance, to have any success in this? Looking at the discussion, it seems to be an OS issue, given that this doesn't work:

set -- erl
exec "$@"

I have no idea how to debug it though.

siegfried commented 4 years ago

No, I were not. I wonder how the package was made on OpenBSD. Will take a look when I have time.

On Feb 27, 2020, at 10:55 PM, José Valim notifications@github.com wrote:

 @siegfried were you able, by any chance, to have any success in this? Looking at the discussion, it seems to be an OS issue, given that this doesn't work:

set -- erl exec "$@" I have no idea how to debug it though.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

josevalim commented 4 years ago

Hi @siegfried, I will go ahead and close this issue but I will be glad to reopen it if you have any updates. From my exploration it looks like the issue is on the system, as exec is misbehaving, but please let me know if my understanding is wrong. Thanks!

jamilbk commented 4 years ago

Hi @josevalim,

First, thanks for your work on Elixir and Devise. Been using your software for many years.

I can confirm the issue @siegfried is experiencing. Here's a Vagrantfile you can use to reproduce the error.

Also, here is a link to the OpenBSD ports page for Elixir, which shows updated patches all the way up to Elixir 1.10.2. The maintainer there is the same person as the binary 1.9.1 package included in the official OpenBSD 6.6 distribution, so my guess is there's a clue in the patches there used to successfully compile and package Elixir for OpenBSD.

OpenBSD 6.6 provides a working Elixir 1.9.1 binary package which works fine for my uses, so I'll stick with that for now.

Just adding this comment for future readers. Hope that helps.