From 7def5265e68ee4aff2148a413e83f8f5d029e049 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Thu, 6 Feb 2020 12:27:57 -0500 Subject: [PATCH] Fix bootstrap crashes when compilers get modified When recompiling rebar3 itself, the path swaps and cleaning removes the modules loaded from _build/bootstrap, but the VM still manages to discover those in _build/prod from previous builds of the escript when building the new escript, which causes weird failures when compilers get modified between releases. The fix is to just clear _build/prod as part of the init of the bootstrap script, the same way we already clear _build/bootstrap. --- bootstrap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bootstrap b/bootstrap index 15bfa933..e430e349 100755 --- a/bootstrap +++ b/bootstrap @@ -14,6 +14,11 @@ main(_) -> %% Clear directories for builds since bootstrapping may require %% a changed structure from an older one rm_rf("_build/bootstrap"), + %% When recompiling rebar3 itself, the path swaps and cleaning + %% removes the modules in _build/bootstrap, but the VM still + %% manages to discover those in _build/prod from previous builds and + %% cause weird failures when compilers get modified between releases. + rm_rf("_build/prod"), %% We fetch a few deps from hex for boostraping, %% so we must compile r3_safe_erl_term.xrl which