From 46c39ae5650b81ef19adbde6e399568237e4be65 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Thu, 12 Dec 2024 10:30:41 +0100 Subject: [PATCH 1/2] Do not set docs source_ref to -latest tags --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b5f911a9be4..a194ddd02b7 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,9 @@ clean_elixir: #==> Documentation tasks -SOURCE_REF = $(shell tag="$(call GIT_TAG)" revision="$(call GIT_REVISION)"; echo "$${tag:-$$revision}") +SOURCE_REF = $(shell tag="$(call GIT_TAG)"; revision="$(call GIT_REVISION)"; \ + if echo "$$tag" | grep -Eq -- '-latest$$'; then tag=""; fi; \ + echo "$${tag:-$$revision}") DOCS_COMPILE = CANONICAL=$(CANONICAL) bin/elixir ../ex_doc/bin/ex_doc "$(1)" "$(VERSION)" "lib/$(2)/ebin" --main "$(3)" --source-url "https://github.com/elixir-lang/elixir" --source-ref "$(call SOURCE_REF)" --logo lib/elixir/pages/images/logo.png --output doc/$(2) --canonical "https://hexdocs.pm/$(2)/$(CANONICAL)" --homepage-url "https://elixir-lang.org/docs.html" $(4) DOCS_CONFIG = bin/elixir lib/elixir/scripts/docs_config.exs "$(1)" From fa80367fb0ed53959c1b6983fcb32621d17c12db Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Thu, 12 Dec 2024 11:45:57 +0100 Subject: [PATCH 2/2] Update --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a194ddd02b7..e3651bddeea 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ INSTALL_DIR = $(INSTALL) -m755 -d INSTALL_DATA = $(INSTALL) -m644 INSTALL_PROGRAM = $(INSTALL) -m755 GIT_REVISION = $(strip $(shell git rev-parse HEAD 2> /dev/null )) -GIT_TAG = $(strip $(shell head="$(call GIT_REVISION)"; git tag --points-at $$head 2> /dev/null | tail -1) ) +GIT_TAG = $(strip $(shell head="$(call GIT_REVISION)"; git tag --points-at $$head 2> /dev/null | grep -v latest | tail -1)) SOURCE_DATE_EPOCH_PATH = lib/elixir/tmp/ebin_reproducible SOURCE_DATE_EPOCH_FILE = $(SOURCE_DATE_EPOCH_PATH)/SOURCE_DATE_EPOCH @@ -176,9 +176,7 @@ clean_elixir: #==> Documentation tasks -SOURCE_REF = $(shell tag="$(call GIT_TAG)"; revision="$(call GIT_REVISION)"; \ - if echo "$$tag" | grep -Eq -- '-latest$$'; then tag=""; fi; \ - echo "$${tag:-$$revision}") +SOURCE_REF = $(shell tag="$(call GIT_TAG)" revision="$(call GIT_REVISION)"; echo "$${tag:-$$revision}") DOCS_COMPILE = CANONICAL=$(CANONICAL) bin/elixir ../ex_doc/bin/ex_doc "$(1)" "$(VERSION)" "lib/$(2)/ebin" --main "$(3)" --source-url "https://github.com/elixir-lang/elixir" --source-ref "$(call SOURCE_REF)" --logo lib/elixir/pages/images/logo.png --output doc/$(2) --canonical "https://hexdocs.pm/$(2)/$(CANONICAL)" --homepage-url "https://elixir-lang.org/docs.html" $(4) DOCS_CONFIG = bin/elixir lib/elixir/scripts/docs_config.exs "$(1)"