Skip to content
Snippets Groups Projects
Commit 272f4d75 authored by Simon Rose's avatar Simon Rose
Browse files

Fix issue where modifying certain wrapper files would cause failure

The issue was that `git status --porcelain` formats its output in such
a way that `make` no longer passes the variables correctly. The solution
is simply to no longer pass the `git status` data.

Note that the git status data already was not that sufficient in terms
of recognising what changes had been made, since all it provided was
information as to which files had been modified, not how they had been
modified.
parent aa9f8d06
No related branches found
No related tags found
1 merge request!134E3-1203: Fix issue where modifying certain wrapper files would cause failure
Pipeline #148619 passed
...@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bugfixes ### Bugfixes
* Fixed an issue where .template and .substitutions files with the same name would build incorrectly * Fixed an issue where .template and .substitutions files with the same name would build incorrectly
* Fixed an issue where filenames with spaces in them that had been modified
in the wrapper would cause all of the module `make` commands to fail.
### Other changes ### Other changes
......
...@@ -14,11 +14,9 @@ ifeq ($(shell git status > /dev/null 2>&1; echo $$?),0) ...@@ -14,11 +14,9 @@ ifeq ($(shell git status > /dev/null 2>&1; echo $$?),0)
GIT_REMOTE_NAME := $(shell git remote | head -n 1) GIT_REMOTE_NAME := $(shell git remote | head -n 1)
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC="$(shell git rev-parse HEAD 2> /dev/null || echo 'Not a git repository')" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC="$(shell git rev-parse HEAD 2> /dev/null || echo 'Not a git repository')"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_STATUS="[ $(shell git status --porcelain | sed 's/^/\\\\\\\"/' | sed 's/$$/\\\\\\\", /')]"
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL="$(shell git config --get remote.$(GIT_REMOTE_NAME).url 2> /dev/null | sed 's%^https://[^@]*@%https://%')" E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL="$(shell git config --get remote.$(GIT_REMOTE_NAME).url 2> /dev/null | sed 's%^https://[^@]*@%https://%')"
else else
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC= E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_DESC=
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_STATUS=
E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL= E3_REQUIRE_MAKEFILE_INPUT_OPTIONS += $(E3_MODULE_NAME)_E3_GIT_URL=
endif endif
......
...@@ -428,14 +428,10 @@ export BINS ...@@ -428,14 +428,10 @@ export BINS
VLIBS = $(VENDOR_LIBS) $(foreach x,$(VAR_EXTENSIONS),$(VENDOR_LIBS_$x)) VLIBS = $(VENDOR_LIBS) $(foreach x,$(VAR_EXTENSIONS),$(VENDOR_LIBS_$x))
export VLIBS export VLIBS
# These variables are written into a .yaml file in the installed module directory to keep track of # This variable is written into a .yaml file in the installed module directory to keep track of
# metadata for which module was compiled. # metadata for which module was compiled.
${PRJ}_GIT_DESC := $(shell git rev-parse HEAD 2> /dev/null) ${PRJ}_GIT_DESC := $(shell git rev-parse HEAD 2> /dev/null)
export ${PRJ}_GIT_DESC export ${PRJ}_GIT_DESC
# The formatting here is just to make sure this is properly parseable .yaml data
${PRJ}_GIT_STATUS := [ $(shell git status --porcelain 2> /dev/null | grep -v "\.Makefile" | sed 's/^/\\\"/' | sed 's/$$/\\\", /')]
export ${PRJ}_GIT_STATUS
else # in O.* else # in O.*
## RUN 3 ## RUN 3
...@@ -726,9 +722,7 @@ ${REGISTRYFILE}: ${MODULEDBD} ...@@ -726,9 +722,7 @@ ${REGISTRYFILE}: ${MODULEDBD}
${METAFILE}: ${METAFILE}:
@echo "wrapper_url: '$(${PRJ}_E3_GIT_URL)'" > $@ @echo "wrapper_url: '$(${PRJ}_E3_GIT_URL)'" > $@
@echo "wrapper_git_desc: '$(${PRJ}_E3_GIT_DESC)'" >> $@ @echo "wrapper_git_desc: '$(${PRJ}_E3_GIT_DESC)'" >> $@
@echo "wrapper_diffs: $(${PRJ}_E3_GIT_STATUS)" >> $@
@echo "module_git_desc: '$(${PRJ}_GIT_DESC)'" >> $@ @echo "module_git_desc: '$(${PRJ}_GIT_DESC)'" >> $@
@echo "module_diffs: $(${PRJ}_GIT_STATUS)" >> $@
define DEP_PARSER define DEP_PARSER
s%$(E3_SITEMODS_PATH)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p; \ s%$(E3_SITEMODS_PATH)/*\([^/]*\)/\([^/]*\)/.*%\1 \2%p; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment