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

Merge branch 'e3_668_error_on_missing_module' into 'master'

E3-668: Missing dependency should cause failed build

See merge request e3/e3-require!66
parents bee69f13 7de0a5ca
No related branches found
No related tags found
1 merge request!66E3-668: Missing dependency should cause failed build
Pipeline #101074 passed
...@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Removed duplicated entries from generated `.dep` files * Removed duplicated entries from generated `.dep` files
* Removed `dev` targets from modules that function in "local source mode" * Removed `dev` targets from modules that function in "local source mode"
* Fixed issue where `.hpp` files were not installed correctly with `KEEP_HEADER_SUBDIRS` * Fixed issue where `.hpp` files were not installed correctly with `KEEP_HEADER_SUBDIRS`
* Missing `REQUIRED` dependencies now cause the build to fail instead of providing a warning
### Other changes ### Other changes
* Removed `<module>_TEMPLATES` in favour of `<module>_DB` * Removed `<module>_TEMPLATES` in favour of `<module>_DB`
......
...@@ -925,7 +925,7 @@ ${DEPFILE}: ${LIBOBJS} $(USERMAKEFILE) ...@@ -925,7 +925,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 $(call FETCH_BUILD_NUMBER,$(E3_SITEMODS_PATH),$m),$(and $(wildcard ${E3_SITEMODS_PATH}/$m),$(error REQUIRED module $m has no numbered version. Set $m_VERSION)),$(warning REQUIRED module $m not found for ${T_A}.))" >> $@.tmp;) @$(foreach m,${REQ},echo "$m $(or $(and $(wildcard $(E3_SITEMODS_PATH)/$m/$($m_VERSION)),$($m_VERSION)),$(error REQUIRED module '$m' version '$($m_VERSION)' does not exist))" >> $@.tmp;)
cat $@.tmp | sort -u >> $@ cat $@.tmp | sort -u >> $@
endif # In O.* directory endif # In O.* directory
......
...@@ -102,3 +102,12 @@ def test_missing_source_file(wrapper): ...@@ -102,3 +102,12 @@ def test_missing_source_file(wrapper):
RE_MISSING_FILE.format(filename=re.escape("nonexistent.o")), RE_MISSING_FILE.format(filename=re.escape("nonexistent.o")),
errs.decode("utf-8"), errs.decode("utf-8"),
) )
def test_missing_requirement(wrapper):
with open(wrapper / f"{TEST_MODULE_NAME}.Makefile", "a") as f:
f.write("REQUIRED += foo")
rc, _, errs = run_make(wrapper, "build")
assert rc == 2
assert "REQUIRED module 'foo' version '' does not exist" in errs.decode("utf-8")
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