Printer Model: Voron 2.4
MCU / Printerboard: LDO Leviathan and Mellow SB2040
Host / SBC: Raspberry Pi 4b
Describe your issue:
It seems that one of the GitHub commits from 10/30/24 has changed the way that macros and/or include files are parsed. At the end of my printer.cfg file I have the following lines.
[exclude_object]
[include mainsail.cfg]
[include mainsail_modifications.cfg] # Must come after “[include mainsail.cfg]”
[include pause_resume.cfg] # Must come after “[include mainsail.cfg]”
[include bed_probe.cfg]
[include heat_soak.cfg]
[include bed_surfaces.cfg]
[include leds.cfg]
[include pressure_advance_calibration.cfg]
[include filament_detection.cfg]
[include filament.cfg]
The mainsail_modifications.cfg and pause_resume.cfg files are used to override some of the configuration from mainsail.cfg. The most up to date code from GitHub results in the mainsail_modifications.cfg and pause_resume.cfg files seemingly being ignored. Rolling back 7 commits fixes the problem and everything works the way it did before. This can be seen by comparing the two log files below. I am not sure if this is a bug or intended behavior, but I wanted to bring it to everyone’s attention since I did not see any changes to the documentation or anyone post anything about this so far.
New log file, rolled back log file, mainsail_modifications.cfg, and pause_resume.cfg files: Logs and cfgs.zip (36.2 KB)
Pretty sure I saw a commit that disabled the include directive from working in sub-files. Do the files that stopped working contain [include] directives?
I saw that as well (commit 9d4ab86), but the files that stopped working do not contain any [include] directives and the only file where I use [include] is the printer.cfg file. However, the files that stopped working do contain config sections and macros like [pause_resume] and CANCEL_PRINT that are duplicates with the mainsail.cfg file. Previously, these duplicates would override the ones already defined in mainsail.cfg as long as the files were included after mainsail.cfg. Since the other files without duplicates work fine, I think the problem is specifically related to the duplicates.
Thanks, that makes sense. I moved the comments to a separate line and that resolved the problem.
I do think that this way of parsing [include] will probably result in similar issues in the future. Would it make sense to only allow one include directive per line and use the second ] to indicate the end of that include? That way any comments afterward would be ignored as usual.