Project

General

Profile

Bug #1319

Problem rebuilding dependencies when file PREPROCESSOR_DEFNS.H does not exist

Added by John Abbott over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Improving
Target version:
Start date:
25 Sep 2019
Due date:
% Done:

100%

Estimated time:
1.77 h
Spent time:

Description

I did something like the following, and ended with lots of error messages about PREPROCESSOR_DEFNS.H not existing.

Changed version number (by editing configuration/version).
Tried to make, but got error about "version has changed; run ./configure --again".
Ran ./configure --again.
Tried running make veryclean
Got lots of error mesgs about PREPROCESOR_DEFNS.H not existing.


Related issues

Related to CoCoA-5 - Support #1387: John's visit Feb 2020Closed2020-01-07

History

#1 Updated by John Abbott over 4 years ago

  • Category set to Improving
  • Target version set to CoCoALib-0.99700

The error mesgs appear when the makefile tries to rebuild the dependencies.

#2 Updated by John Abbott over 4 years ago

The point is that make veryclean also deletes (most of?) the files generated by configuration.

Something is evidently not quite right. Surely after make veryclean it should say that reconfiguration is needed?

#3 Updated by John Abbott over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to John Abbott
  • % Done changed from 0 to 20

This is a bit tricky.

As far as I can see, make veryclean deletes include/CoCoA/PREPROCESSOR_DEFNS.H, but then tries to rebuild the dependencies (why?) in src/CoCoA-5/
Rebuilding the dependencies fails because PREPROCESSOR_DEFNS.H is needed...

#4 Updated by John Abbott over 4 years ago

Here is what happened (I think):
  • changed version number (CoCoALib and CoCoA-5)
  • configure again
  • start to build, but interrupt while Make_dependencies is being built (in src/CoCoA-5/)
  • run make veryclean; but this triggered rebuilding of src/CoCoA-5/Make_dependencies

As far as I can see src/CoCoA-5/Make_dependencies exists and is empty... (as it should, but why the error?)

NOTE there were also errors about library.H non existing, but these are "(in)consequential".

#5 Updated by John Abbott over 4 years ago

I think I have found out what the problem is: in some (all?) Makefile the dependencies file has a declared dependency on COCOA_ROOT/configuration/version, this automatically triggers regeneration of the dependency file.

I now think that this is incorrect design. I, myself, almost always compile from COCOA_ROOT, and the Makefile there explicitly checks if the version has changed, and prints out an error message (saying that one must re-configure).

Also running make in the COCOA_ROOT directory also explicitly checks that all dependency files are newer than autoconf.mk (and rebuilds them if not).

I think that removing the declared dependency of DEPEND_FILE on autoconf.mk should solve the problem (but have not yet tried this).

#6 Updated by John Abbott over 4 years ago

#7 Updated by John Abbott over 4 years ago

  • % Done changed from 20 to 50

I have just repeated the steps described in comment 4, and this time it worked as hoped.

I have a doubt: in the Makefiles the dependencies are rebuilt only if library.H is newer than the dependency file. Is this right?
library.H should be generated/changed only when configure is run or when MakeUnifiedHeader.sh is run.
Hmmm, maybe this is reasonable after all.

#8 Updated by John Abbott over 4 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 50 to 90
  • Estimated time set to 1.77 h

It is probably best to regard this as resolved, and just test it as is.
Perhaps it is not perfect, but I think the current arrangement is quite reasonable.

#9 Updated by John Abbott about 4 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF