Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for old macros BOTH and EITHER #27249

Merged
merged 6 commits into from
Jul 8, 2024

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Jul 7, 2024

Description

Users are continuing to have issue with using old Configs, updating the version number but not updating these macros.

The Error missing binary operator before token "(" is not obvious to the causal user

Added a pre flight check that searches Configuration.h and Configuration_adv.h for "BOTH(" and EITHER(" and errors with a much easier to understand error of the following:

ERROR: Old macro "BOTH()" or "EITHER()" found in your configuration files. Replace with "ALL()" and "ANY()" respectively and try again.

NOTE: cannot just search for "BOTH" as there is a comment with that string in it.

Added at the request of @thisiskeithb

Requirements

BOTH( or EITHER( in Configuration.h or Configuration_adv.h

Benefits

Less support requests

@thinkyhead
Copy link
Member

We might as well have the script do the updates … and give a warning.

@thisiskeithb
Copy link
Member

thisiskeithb commented Jul 8, 2024

We might as well have the script do the updates … and give a warning.

Great! Now do all of Changes.h 😆

But really… The auto updating of config files is certainly neat, but I’m not sure if modifying them during a build is something we should be doing.

@thisiskeithb thisiskeithb added the T: Development Makefiles, PlatformIO, Python scripts, etc. label Jul 8, 2024
@ellensp
Copy link
Contributor Author

ellensp commented Jul 8, 2024

I considered just updating the config and decided that wasn't the marlin way... the problem is there is no standard marlin way...

@thinkyhead
Copy link
Member

The "Marlin way" is whatever works. Asking common end-users to muck with search-and-replace is more burdensome than modifying the file, warning them that changes were made, and then requiring them to build once more.

I do see this as a temporary patch until I have config migration completed. That work is coming along in various ways. (e.g., This spreadsheet has been set up to track all changes from version to version, and this will be applied to the migration code, which will work behind the scenes just modifying a config.ini file at each step.

@thinkyhead thinkyhead merged commit 3385b4c into MarlinFirmware:bugfix-2.1.x Jul 8, 2024
62 checks passed
@ellensp ellensp deleted the find-old-macros branch July 9, 2024 03:35
thinkyhead pushed a commit that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Improvement T: Development Makefiles, PlatformIO, Python scripts, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants