-
-
Notifications
You must be signed in to change notification settings - Fork 403
Give the runtime.ide.version property a more meaningful value #725
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
Comments
I guess that part of this should be solved by specifying a core version (I guess that could be added already?) and an Arduino API version implemented by the core (which I think needs ArduinoCore-API to become more widespread), which allows code to check those versions rather than the IDE version.
Yup, that seems like a good way to handle this. |
This can be easily done and makes sense, btw there is still the question of which value should be used when the CLI runs standalone. Probably we should keep
This has been already done in the ArduinoCore-API |
This is only half of my suggestion (API version, not core version), but indeed, the core version also does not need support in arduino-cli and can be handled in .h files only. Thinking more about the runtime.ide.version, I wonder if this should be used at all in the future, given that like you say arduino-cli can be run without an IDE as well. Adding a runtime.arduino-cli.version might make sense, but in the future tooling might further change and expecting cores to support all of these properties is not really feasible (but auto-generating -D options instead of setting properties probably isn't great either), so maybe these properties are not really needed at all then? So maybe just freeze runtime.ide.version? In the end, code should probably care about core and API versions more than IDE/tooling versions, of course.. |
That's exactly what I'd like to do, previously When the AVR platform has been decoupled from the IDE (starting from IDE 1.8.x and the package manager), the usefulness of the We could not remove it completely because there are a lot of libraries using the pattern:
that requires the So, unless I'm missing something else, I'd just freeze |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Hi, I did not receive an answer yet. But currently there are so many different CPUs supported by Arduino IDE, including systems manually added like ESP32. So I'm not sure if it still make sense to check for the Arduino IDE version. There are several other values you might check: // Get the ESP Arduino version in Format a.b.c
// ..\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32\esp_arduino_version.h
const char *getArduinoPlatformVersion() {
static char version[8]; // x.xx.xx\0
#ifdef ESP_ARDUINO_VERSION_MAJOR
sprintf(version, "%d.%d.%d", ESP_ARDUINO_VERSION_MAJOR, ESP_ARDUINO_VERSION_MINOR, ESP_ARDUINO_VERSION_PATCH);
#endif
return version;
}
Serial.printf("Used IDF version for compilation: %s\n", esp_get_idf_version());
Serial.printf("Used ESP arduino platform for compilation: %s\n", AduinoPlatformVersion());
Serial.printf("Used IDE version for compilation: %u\n", ARDUINO);
Serial.printf("GNU C++ version: %s\n", __VERSION__);
Serial.printf("C++ standard: %ld\n", __cplusplus); Maybe this is something which might help you. Regards, |
Feature Request
Current behavior
The
ARDUINO
macro is defined with the value of theruntime.ide.version
property. When using the Arduino IDE, this value matches the current IDE version. When using other Arduino development software, it has a meaningless value (currently10607
):arduino-cli/internal/arduino/cores/packagemanager/package_manager.go
Line 417 in 625aaac
This causes problems for code that uses the value of the
ARDUINO
macro to determine compatibility with version-specific behavior of the Arduino development software (e.g., function prototype generation).Expected behavior
My suggestion is to set the
runtime.ide.version
property to the version of the Arduino IDE the Arduino CLI release will be used with. I think that, given the historical meaning of this property's value, this will provide the closest match to the behavior the user expects.Arduino CLI version
Original report
0.10.0-rc1 Commit: 8220b32
Last verified with
625aaac
Operating system
Operating system version
Additional context
If the policy for setting the value of the
runtime.ide.version
property is changed, the relevant section of the Arduino Platform Specification should be updated accordingly:https://arduino.github.io/arduino-cli/dev/platform-specification/#global-predefined-properties
Additional requests
Related
The text was updated successfully, but these errors were encountered: