diff options
author | Loïc Hoguin <[email protected]> | 2024-11-19 13:25:45 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2024-11-19 15:34:48 +0100 |
commit | acce7040d442a5ddba9f9394714ad28877905ea0 (patch) | |
tree | 088f0dbb7a8e8a4edda6f734646c8eda53a55bec | |
parent | 7bf0e7b5f6bd82b5af76d375fb0bf1ffc7ac2b72 (diff) | |
download | erlang.mk-acce7040d442a5ddba9f9394714ad28877905ea0.tar.gz erlang.mk-acce7040d442a5ddba9f9394714ad28877905ea0.tar.bz2 erlang.mk-acce7040d442a5ddba9f9394714ad28877905ea0.zip |
Remove legacy fetch method
This method dates back from the beginnings of Erlang.mk
and should not have been used for around a decade by now.
Adding "git" to the offending dep lines is enough to upgrade.
-rw-r--r-- | CHANGELOG.asciidoc | 6 | ||||
-rw-r--r-- | core/deps.mk | 12 | ||||
-rw-r--r-- | test/core_deps.mk | 17 |
3 files changed, 7 insertions, 28 deletions
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 519d05d..863780e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -37,3 +37,9 @@ 2024/11/19: The deprecated defines `dep_fetch`, `dep_name`, `dep_repo` and `dep_commit` have been removed in favor of their `query_*` equivalents. ++ + The deprecated legacy fetch method has also + been removed (`dep_cowboy = https://... ref` + without an explicit fetch method). Adding "git" + at the beginning of the dep line is the modern + equivalent. diff --git a/core/deps.mk b/core/deps.mk index 20052b1..fdcf866 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -63,7 +63,7 @@ $(foreach p,$(DEP_EARLY_PLUGINS),\ # Query functions. query_fetch_method = $(if $(dep_$(1)),$(call _qfm_dep,$(word 1,$(dep_$(1)))),$(call _qfm_pkg,$(1))) -_qfm_dep = $(if $(dep_fetch_$(1)),$(1),$(if $(IS_DEP),legacy,fail)) +_qfm_dep = $(if $(dep_fetch_$(1)),$(1),fail) _qfm_pkg = $(if $(pkg_$(1)_fetch),$(pkg_$(1)_fetch),fail) query_name = $(if $(dep_$(1)),$(1),$(if $(pkg_$(1)_name),$(pkg_$(1)_name),$(1))) @@ -81,7 +81,6 @@ query_repo_cp = $(call query_repo_default,$(1)) query_repo_ln = $(call query_repo_default,$(1)) query_repo_hex = https://hex.pm/packages/$(if $(word 3,$(dep_$(1))),$(word 3,$(dep_$(1))),$(1)) query_repo_fail = - -query_repo_legacy = - query_version = $(call _qv,$(1),$(call query_fetch_method,$(1))) _qv = $(if $(query_version_$(2)),$(call query_version_$(2),$(1)),$(call query_version_default,$(1))) @@ -96,7 +95,6 @@ query_version_cp = - query_version_ln = - query_version_hex = $(if $(dep_$(1)_commit),$(dep_$(1)_commit),$(if $(dep_$(1)),$(word 2,$(dep_$(1))),$(pkg_$(1)_commit))) query_version_fail = - -query_version_legacy = - query_extra = $(call _qe,$(1),$(call query_fetch_method,$(1))) _qe = $(if $(query_extra_$(2)),$(call query_extra_$(2),$(1)),-) @@ -110,7 +108,6 @@ query_extra_cp = - query_extra_ln = - query_extra_hex = $(if $(dep_$(1)),package-name=$(word 3,$(dep_$(1))),-) query_extra_fail = - -query_extra_legacy = - query_absolute_path = $(addprefix $(DEPS_DIR)/,$(call query_name,$(1))) @@ -828,13 +825,6 @@ define dep_fetch_fail exit 78; endef -# Kept for compatibility purposes with older Erlang.mk configuration. -define dep_fetch_legacy - $(warning WARNING: '$(1)' dependency configuration uses deprecated format.) \ - git clone -q -n -- $(word 1,$(dep_$(1))) $(DEPS_DIR)/$(1); \ - cd $(DEPS_DIR)/$(1) && git checkout -q $(if $(word 2,$(dep_$(1))),$(word 2,$(dep_$(1))),master); -endef - define dep_target $(DEPS_DIR)/$(call query_name,$1): $(if $(filter hex,$(call query_fetch_method,$1)),hex-core) | $(ERLANG_MK_TMP) $(eval DEP_NAME := $(call query_name,$1)) diff --git a/test/core_deps.mk b/test/core_deps.mk index 7c792f5..dd052e5 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -770,23 +770,6 @@ endif # {ok, \"4.0.3\"} = application:get_key(ehsa, vsn), \ # halt()" -# Legacy must fail for the top-level application, but work for dependencies. -core-deps-fetch-legacy: init - - $i "Bootstrap a new OTP library named $(APP)" - $t mkdir $(APP)/ - $t cp ../erlang.mk $(APP)/ - $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v - - $i "Add Cowlib as a dependency using a non-existing fetch method named oops" - $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = https://github.com/ninenines/cowlib 1.0.0\n"}' $(APP)/Makefile - - $i "Check that building the application fails" - $t ! $(MAKE) -C $(APP) $v - - $i "Check that building the application works with IS_DEP=1" - $t $(MAKE) -C $(APP) IS_DEP=1 $v - core-deps-fetch-ln: init $i "Bootstrap a new OTP library named $(APP)" |