I'm trying to make sense of https://github.com/coq/coq/pull/14238; according to the changelog, it enables . DELETE_ON_ERROR
by default
but the logic seems backward, even if the "double negation" in the comment are confusing:
# set KEEP_ERROR to prevent make from deleting files produced by failing rules.
# For instance if coqc creates a .vo but then fails to native compile,
# the .vo will be deleted unless KEEP_ERROR is nonempty.
# May confuse make so use only for debugging.
KEEP_ERROR?=
ifneq (,$(KEEP_ERROR))
.DELETE_ON_ERROR:
endif
after double-negation elimination, this reads to me as:
# set KEEP_ERROR to tell make to keep files produced by failing rules.
[...]
set KEEP_ERROR to a default value
if KEEP_ERROR is _not_ default # Backwards!
<delete outputs of failing rules>
endif
I also double-checked if sth funky was going on, but I think not:
$ cat > Make.test << 'EOF'
KEEP_ERROR?=
ifneq (,$(KEEP_ERROR))
$(info "We should set DELETE_ON_ERROR")
.DELETE_ON_ERROR:
else
$(warning "Bug: By default, we do NOT set DELETE_ON_ERROR")
endif
all:
EOF
$ make -f Make.test
Make.test:6: "Bug: By default, we do NOT set DELETE_ON_ERROR"
make: Nothing to be done for 'all'.
Submitted https://github.com/coq/coq/pull/15880.
Last updated: Oct 13 2024 at 01:02 UTC