From 42d3cef11bd9a84d11eb48a4ff9686d2e0ce5436 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 18 Jan 2019 20:36:11 +0000 Subject: Sanity check to run the Make with proper group permissions If the `./for-group' script is not used properly, it can lead to the whole pipeline being re-run. Therefore it is important to do a sanity check immediately at the start of Make's processing and inform the user if there is a problem. With this commit, `./for-group' exports the `reproducible_paper_for_group' variable which is used by both the initial `./configure' script, and later in each call to Make. The `./configure' script will use it to write a value in `reproduce/config/pipeline/LOCAL.mk' and Make will use it to compare with the value in `reproduce/config/pipeline/LOCAL.mk'. If there is an inconsistency, Make will not even attempt to build anything and will just print a message and abort. --- reproduce/config/pipeline/LOCAL.mk.in | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'reproduce/config') diff --git a/reproduce/config/pipeline/LOCAL.mk.in b/reproduce/config/pipeline/LOCAL.mk.in index 89e3e23..846a5b8 100644 --- a/reproduce/config/pipeline/LOCAL.mk.in +++ b/reproduce/config/pipeline/LOCAL.mk.in @@ -6,3 +6,27 @@ BDIR = @bdir@ INDIR = @indir@ DEPENDENCIES-DIR = @ddir@ DOWNLOADER = @downloader@ +FOR-GROUP = @forgroup@ + + + + + +# In the top Makefile (which is created after running `./configure' and is +# actually a symbolic link to `reproduce/src/make/top.mk'), we need to +# start by checking if there is no conflict with the running and configured +# group configuration of the pipeline. +good-group-configuration := $(shell \ + if [ "x$(FOR-GROUP)" = xyes ]; then \ + if [ "x$(reproducible_paper_for_group)" = xyes ]; then \ + echo "yes"; \ + else \ + echo "no"; \ + fi; \ + else \ + if [ "x$(reproducible_paper_for_group)" = xyes ]; then \ + echo "no"; \ + else \ + echo "yes"; \ + fi; \ + fi) -- cgit v1.2.1