Bug #3706
"caching" behaviour on nml error
| Status: | Confirmed | Start date: | 2012-02-19 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - |
Description
CPP is not called after fixing a bug in the code that causes nml to issue a fatal error.
Procedure:
- 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
Result:
- even though the error in the nml code is fixed, the makefile keeps using the faulty nml file.
Comments:
- it doesn't appear which dep check I used. Tried all three, and happened with all of them.
Workaround:
- 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[1]: 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[1]: *** [dutchtrains.gfx.dep] Error 1 make[1]: Leaving directory `/media/sf_grf-dev/dutchtrains' make: *** [all] Error 2 [foobar@grf-dev dutchtrains]$ make make[1]: 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[1]: *** [dutchtrains.gfx.dep] Error 1 make[1]: Leaving directory `/media/sf_grf-dev/dutchtrains' make: *** [all] Error 2
History
#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)
#5 Updated by foobar about 1 year ago
Ok, thank you! Will give that a try. If it works, you won't hear from me ;)