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

E3-894: Fix issue where non-existent versions would cause the build to hang

The ultimate issue here was that we performed a
```
cat $( ... ) | sed '1d'
```
and if that inner block was empty, then `cat` reverted to waiting for user input. The
error also came up with non-specified build numbers, so we need to make sure that those
are also being fetched correctly.

The upshot is now `<module>_VERSION` will automatically fetch the correct build number;
the only potential downside is that if we have a newer version in `${E3_SITEMODS_PATH}`
in comparison to `${EPICS_MODULES}` (read: cellMods), then it won't pick that up. However,
this seems to be a pretty special corner case.
parent 1780206d
No related branches found
Tags 3.4.4
No related merge requests found
...@@ -320,6 +320,7 @@ define fetch_module_versions ...@@ -320,6 +320,7 @@ define fetch_module_versions
lm := $$(shell echo $1 | tr '[:upper:]' '[:lower:]') lm := $$(shell echo $1 | tr '[:upper:]' '[:lower:]')
ifneq ($$(strip $$(filter $(INSTALLED_MODULES),$$(lm))),) ifneq ($$(strip $$(filter $(INSTALLED_MODULES),$$(lm))),)
$$(lm)_VERSION := $($1_DEP_VERSION$2) $$(lm)_VERSION := $($1_DEP_VERSION$2)
$$(lm)_VERSION := $$(lastword $$(call FETCH_BUILD_NUMBER,$(E3_SITEMODS_PATH),$$(lm)) $$(call FETCH_BUILD_NUMBER,$(EPICS_MODULES),$$(lm)))
MODULES += $$(lm) MODULES += $$(lm)
REQ += $$(lm) REQ += $$(lm)
else else
...@@ -338,7 +339,10 @@ export REQ ...@@ -338,7 +339,10 @@ export REQ
# Fetches the data from .dep files to be parsed by the above # Fetches the data from .dep files to be parsed by the above
define fetch_deps define fetch_deps
$(shell cat $(lastword $(wildcard $(addsuffix /$1/$($1_VERSION)/lib/$(T_A)/$1.dep,$(E3_SITEMODS_PATH) $(EPICS_MODULES)))) | sed '1d') $(shell cat $(or \
$(lastword $(wildcard $(addsuffix /$1/$($1_VERSION)/lib/$(T_A)/$1.dep,$(E3_SITEMODS_PATH) $(EPICS_MODULES)))),\
$(error Module '$1' version '$($1_VERSION)' does not exist.)) \
| sed '1d')
endef endef
# Used to recurse through versions: recursively fetches all of the dependencies # Used to recurse through versions: recursively fetches all of the dependencies
...@@ -791,7 +795,7 @@ ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE) ...@@ -791,7 +795,7 @@ ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE)
# Check dependencies on other module headers. # Check dependencies on other module headers.
cat *.d 2>/dev/null | sed 's/ /\n/g' | grep -v '$(EPICS_BASE)/include' | sed -n '$(DEP_PARSER)' > $@.tmp cat *.d 2>/dev/null | sed 's/ /\n/g' | grep -v '$(EPICS_BASE)/include' | sed -n '$(DEP_PARSER)' > $@.tmp
# Manully added dependencies: ${REQ} # Manully added dependencies: ${REQ}
@$(foreach m,${REQ},echo "$m $(or $(and $(or $(wildcard $(EPICS_MODULES)/$m/$($m_VERSION)),$(wildcard $(E3_SITEMODS_PATH)/$m/$($m_VERSION))),$($m_VERSION)),$(error REQUIRED module '$m' version '$($m_VERSION)' does not exist))" >> $@.tmp;) @$(foreach m,${REQ},echo "$m $($m_VERSION)" >> $@.tmp;)
cat $@.tmp | sort -u >> $@ cat $@.tmp | sort -u >> $@
endif # In O.* directory endif # In O.* directory
......
...@@ -10,9 +10,7 @@ MODULE_VERSION = "0.0.0+0" ...@@ -10,9 +10,7 @@ MODULE_VERSION = "0.0.0+0"
MODULE_VERSION_NO_BUILD = "0.0.0" MODULE_VERSION_NO_BUILD = "0.0.0"
RE_MISSING_FILE = "No rule to make target [`']{filename}'" RE_MISSING_FILE = "No rule to make target [`']{filename}'"
RE_MISSING_VERSION = ( RE_MISSING_VERSION = "Module '{module}' version '{version}' does not exist."
"REQUIRED module [`']{module}' version [`']{version}' does not exist."
)
def create_patch_file(path, desc): def create_patch_file(path, desc):
......
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