aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2023-05-05 14:43:33 +0200
committerLoïc Hoguin <[email protected]>2023-05-05 16:14:06 +0200
commit2f5e90da5156a54275f30b6b4a4051774adea3da (patch)
tree2150f766e059809b8df6e897f5bc096a4618fbc8
parent9fd062209fcdb05331dc0b8aa8cd831723bdf6eb (diff)
downloaderlang.mk-2f5e90da5156a54275f30b6b4a4051774adea3da.tar.gz
erlang.mk-2f5e90da5156a54275f30b6b4a4051774adea3da.tar.bz2
erlang.mk-2f5e90da5156a54275f30b6b4a4051774adea3da.zip
Autopatch: Move to Rebar3
-rw-r--r--CHANGELOG.asciidoc9
-rw-r--r--core/core.mk2
-rw-r--r--core/deps.mk14
-rw-r--r--test/Makefile6
4 files changed, 20 insertions, 11 deletions
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 936aa25..0ee51b9 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -35,3 +35,12 @@
Xref language to perform custom queries. Erlang.mk
can also run analyses and queries against all
dependencies as well as Erlang/OTP applications.
+
+2023/05/05: Rebar3 is now used for autopatch instead of
+ Rebar2. `make distclean` or `rm -rf .erlang.mk`
+ might be required after updating Erlang.mk.
+ Moving to Rebar3 increases compatibility now
+ that few maintained projects are using Rebar2.
+ For compatibility reasons the variables to
+ point to a different rebar are now REBAR3_GIT
+ and REBAR3_COMMIT.
diff --git a/core/core.mk b/core/core.mk
index 77adc2e..e7bf579 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -171,7 +171,7 @@ endef
# Adding erlang.mk to make Erlang scripts who call init:get_plain_arguments() happy.
define erlang
-$(ERL) $2 -pz $(ERLANG_MK_TMP)/rebar/ebin -eval "$(subst $(newline),,$(call escape_dquotes,$1))" -- erlang.mk
+$(ERL) $2 -pz $(ERLANG_MK_TMP)/rebar3/_build/prod/lib/*/ebin/ -eval "$(subst $(newline),,$(call escape_dquotes,$1))" -- erlang.mk
endef
ifeq ($(PLATFORM),msys2)
diff --git a/core/deps.mk b/core/deps.mk
index e359db5..d07bb0c 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -21,8 +21,8 @@ export DEPS_DIR
REBAR_DEPS_DIR = $(DEPS_DIR)
export REBAR_DEPS_DIR
-REBAR_GIT ?= https://github.com/rebar/rebar
-REBAR_COMMIT ?= 576e12171ab8d69b048b827b92aa65d067deea01
+REBAR3_GIT ?= https://github.com/erlang/rebar3
+REBAR3_COMMIT ?= 3f563feaf1091a1980241adefa83a32dd2eebf7c # 3.20.0
# External "early" plugins (see core/plugins.mk for regular plugins).
# They both use the core_dep_plugin macro.
@@ -301,10 +301,10 @@ define dep_autopatch_fetch_rebar
endef
define dep_autopatch_fetch_rebar2
- if [ ! -d $(ERLANG_MK_TMP)/rebar ]; then \
- git clone -q -n -- $(REBAR_GIT) $(ERLANG_MK_TMP)/rebar; \
- cd $(ERLANG_MK_TMP)/rebar; \
- git checkout -q $(REBAR_COMMIT); \
+ if [ ! -d $(ERLANG_MK_TMP)/rebar3 ]; then \
+ git clone -q -n -- $(REBAR3_GIT) $(ERLANG_MK_TMP)/rebar3; \
+ cd $(ERLANG_MK_TMP)/rebar3; \
+ git checkout -q $(REBAR3_COMMIT); \
./bootstrap; \
cd -; \
fi
@@ -321,7 +321,7 @@ endef
define dep_autopatch_rebar.erl
application:load(rebar),
application:set_env(rebar, log_level, debug),
- rmemo:start(),
+ {module, rebar3} = c:l(rebar3),
Conf1 = case file:consult("$(call core_native_path,$(DEPS_DIR)/$1/rebar.config)") of
{ok, Conf0} -> Conf0;
_ -> []
diff --git a/test/Makefile b/test/Makefile
index b10e05f..e2efc22 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -131,14 +131,14 @@ clean::
init: clean
$i "Prefetch Rebar if necessary"
$t if [ ! -d test_rebar_git ]; then \
- git clone -q -n -- https://github.com/rebar/rebar test_rebar_git; \
+ git clone -q -n -- https://github.com/erlang/rebar3 test_rebar_git; \
fi
$i "Generate a bleeding edge Erlang.mk"
$t cd .. && $(MAKE) $v
-REBAR_GIT = file://$(CURDIR)/test_rebar_git
-export REBAR_GIT
+REBAR3_GIT = file://$(CURDIR)/test_rebar_git
+export REBAR3_GIT
# Core.