"caching" behaviour on nml error
CPP is not called after fixing a bug in the code that causes nml to issue a fatal error.
- have some nml script, make a bad in there, say setting a capacity larger than 255
- run make
- nmlc will correctly die, notifying that the property is wrong
- fix the problem in the nml code
(all is good so far)
- run make again
- now cpp isn't called to recompile the nml file, instead nml file of the previous make attempt is used
- even though the error in the nml code is fixed, the makefile keeps using the faulty nml file.
- it doesn't appear which dep check I used. Tried all three, and happened with all of them.
- only way to get the makefile to actually use the corrected nml code is by calling clean first, e.g. by means of make remake
This is probably related to #3598. I.e., implementation of #3598 will result in an option that makes the makefile 'dumb' and then will always call cpp regardless if files are changed or not, essentially avoiding the problem altogether. That of course is not a solution to this problem, but would be a solution to my personal situation.
Typical output (using normal dep check):
[foobar@grf-dev dutchtrains]$ make make: Entering directory `/media/sf_grf-dev/dutchtrains' [DEP] Makefile.dep [DEP] dutchtrains.src.dep [LANG] custom_tags.txt [CPP] dutchtrains.nml [DEP] dutchtrains.gfx.dep nmlc: "src/metro/GVB_M1M2_item.pnml", line 17: Action 0 property too large make: *** [dutchtrains.gfx.dep] Error 1 make: Leaving directory `/media/sf_grf-dev/dutchtrains' make: *** [all] Error 2 [foobar@grf-dev dutchtrains]$ make make: Entering directory `/media/sf_grf-dev/dutchtrains' [DEP] dutchtrains.gfx.dep nmlc: "src/metro/GVB_M1M2_item.pnml", line 17: Action 0 property too large make: *** [dutchtrains.gfx.dep] Error 1 make: Leaving directory `/media/sf_grf-dev/dutchtrains' make: *** [all] Error 2
#1 Updated by foobar over 1 year ago
Oh, forgot to mention that I'm using the makefile 0.6.2 release.
#2 Updated by planetmaker about 1 year ago
- Status changed from New to Confirmed
As work-around you could also just touch the main project file. It will cause cpp to re-generate the nml to be processed.
#3 Updated by foobar about 1 year ago
Thanks, that seems to work :)
If I would want to add such command to the makefile, where would I go about putting that?
I had a look, but how everything works is a bit abracadabra to me. I've found where cpp is called, but that's not the right place...
So if you could give me a pointer here, that would be greatly appreciated!
#4 Updated by planetmaker about 1 year ago
I'd add to the scripts/Makefile.in the following rule (where mainfile.pnml is your main project file with all the includes):
rebuild: touch src/mainfile.pnml $(_V) $(MAKE) $(MAKE_FLAGS) $(TARGET_FILES) $(DOC_FILES)