build: ensure symlinks in _build dir are deleted after fetching deps
In CI, the source code is downloaded with make deps-all zipped and uploaded as an GitHub action artifact to be downloaded in later steps to build packages The symlinks are abs paths, meaning it might be broken when unziped (inside docker containers) This fix adds a `make clean` step after the deps-all target and the `clean` target also removes rebar.lock and symlinks
This commit is contained in:
parent
e34055b6ef
commit
5db4607815
4
Makefile
4
Makefile
|
@ -85,8 +85,10 @@ $(REL_PROFILES:%=%): $(REBAR) get-dashboard
|
||||||
clean: $(PROFILES:%=clean-%)
|
clean: $(PROFILES:%=clean-%)
|
||||||
$(PROFILES:%=clean-%):
|
$(PROFILES:%=clean-%):
|
||||||
@if [ -d _build/$(@:clean-%=%) ]; then \
|
@if [ -d _build/$(@:clean-%=%) ]; then \
|
||||||
|
rm rebar.lock \
|
||||||
rm -rf _build/$(@:clean-%=%)/rel; \
|
rm -rf _build/$(@:clean-%=%)/rel; \
|
||||||
find _build/$(@:clean-%=%) -name '*.beam' -o -name '*.so' -o -name '*.app' -o -name '*.appup' -o -name '*.o' -o -name '*.d' -type f | xargs rm -f; \
|
find _build/$(@:clean-%=%) -name '*.beam' -o -name '*.so' -o -name '*.app' -o -name '*.appup' -o -name '*.o' -o -name '*.d' -type f | xargs rm -f; \
|
||||||
|
find _build/$(@:clean-%=%) -type l | xargs rm -i -f ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: clean-all
|
.PHONY: clean-all
|
||||||
|
@ -95,6 +97,7 @@ clean-all:
|
||||||
|
|
||||||
.PHONY: deps-all
|
.PHONY: deps-all
|
||||||
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||||
|
@make clean # ensure clean at the end
|
||||||
|
|
||||||
## deps-<profile> is used in CI scripts to download deps and the
|
## deps-<profile> is used in CI scripts to download deps and the
|
||||||
## share downloads between CI steps and/or copied into containers
|
## share downloads between CI steps and/or copied into containers
|
||||||
|
@ -102,6 +105,7 @@ deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||||
.PHONY: $(PROFILES:%=deps-%)
|
.PHONY: $(PROFILES:%=deps-%)
|
||||||
$(PROFILES:%=deps-%): $(REBAR) get-dashboard
|
$(PROFILES:%=deps-%): $(REBAR) get-dashboard
|
||||||
@$(REBAR) as $(@:deps-%=%) get-deps
|
@$(REBAR) as $(@:deps-%=%) get-deps
|
||||||
|
@rm -f rebar.lock
|
||||||
|
|
||||||
.PHONY: xref
|
.PHONY: xref
|
||||||
xref: $(REBAR)
|
xref: $(REBAR)
|
||||||
|
|
Loading…
Reference in New Issue