-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix release name macro expansion #4309
base: 0_15
Are you sure you want to change the base?
Conversation
1199f99
to
6aef0e1
Compare
@netmindz I think output_bins.py needs to be adjusted - might be that simply deleting any |
@@ -19,7 +19,7 @@ def _create_dirs(dirs=["map", "release", "firmware"]): | |||
os.makedirs(os.path.join(OUTPUT_DIR, d), exist_ok=True) | |||
|
|||
def create_release(source): | |||
release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME") | |||
release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME").replace("\\\"", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quote stripping needs to be inside the if
below, in case it's not defined and _get_cpp_define_value
returns None.
I'm wondering what's wrong with stringification? https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html There are some other places that use |
It macro-expands recursively -- there is no way to expand exactly once. Eg: |
That explains 1 seen in builds. So the simplest solution is to use something unique that has no ordinary/recursive counterpart. I.e. rename "ESP32" with "ESP32plain" in platformio.ini. IMO that's acceptable as no previous builds have "ESP32" (or "ESP8266") compiled in due to the recursion flaw. This (adding unique WLED_RELEASE_NAME) would also help differentiate builds @Moustachauve wants to implement in his mobile app. |
My initial version of this PR changed the value to be WLED_ESP32, the removed the hard coded WLED from the rename python script, but that's a bigger change, hence swapping to @willmmiles suggestion for a smaller change |
Or perhaps just: #ifndef WLED_RELEASE_NAME
#define WLED_RELEASE_NAME dev_release
#else
#if WLED_RELEASE_NAME == ESP32 || WLED_RELEASE_NAME == ESP8266
#error Wrong WLED_RELEASE_NAME.
#endif
#endif |
Fix for #4260