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

Proposal for a user-friendly way to define global macros #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

d-a-v
Copy link

@d-a-v d-a-v commented Oct 20, 2021

This RFC aims at proposing an easy way for average Arduino IDE users to define global macros for libraries configuration through a single header files beside the main sketch file.

edit link to formated file

@CLAassistant
Copy link

CLAassistant commented Oct 20, 2021

CLA assistant check
All committers have signed the CLA.

@PaulStoffregen
Copy link

PaulStoffregen commented Oct 20, 2021

This has been proposed many, many times over Arduino's long history. Every time the Arduino developers have said this sort of feature, while convenient in the short term, is believe to have a long-term negative impact on the Arduino ecosystem.

Maybe the answer will be different this time, but I believe this proposal is unlikely to be accepted.

@d-a-v
Copy link
Author

d-a-v commented Oct 20, 2021

I know about Arduino developers thinking, links are provided in the text. Sadly, the feature is still missing.
I'm interested in knowing what negative impact it could have on the long term. Please note that this proposal focuses on sketch and libraries. Core files are not impacted with anything that could be defined in the proposed file (edit²: arduino/arduino-cli#1524 - and the test/example)
Are you willing to support such feature @PaulStoffregen ?

@PaulStoffregen
Copy link

Unless the Arduino developers approve this RFC or otherwise explain a reversal of their prior position (essentially that they consider this harmful), I definitely will not support it on Teensy when using the Arduino IDE. I have patched the Java IDE code and added many API extensions over the years, but I always strive to do so in a way that respects the spirit of Arduino's design choices.

But some of Teensy's libraries do have defines surrounded by ifndef checks, which are meant for users who compile the code using non-Arduino tools. So in some sense, I already am supporting this in a limited way, but only when used on non-Arduino tools which provide ways to edit the compiler command line defines.

@d-a-v
Copy link
Author

d-a-v commented Oct 20, 2021

Maybe I should insist on this point: The proposal is for

  • The libraries included by the sketch
  • The sketch itself
  • NOT the core: sketch_config.h file will not be included when compiling platform core source files.
    Compilation of the core cannot be threatened by bad combinations of defines from this file. Support from Teensy, or any other platforms is irrelevant here, including from their respective platform.txt.

I have patched the Java IDE code and added many API extensions over the years, but I always strive to do so in a way that respects the spirit of Arduino's design choices.

I haven't found anything about design choices specifically against this feature request. Any link is appreciated.

So in some sense, I already am supporting this in a limited way, but only when used on non-Arduino tools which provide ways to edit the compiler command line defines.

Well, as a member of a platform maintainer team, we also have requests from these non-Arduino environments, and we are maintaining their specific script. On the Arduino-IDE user side, I am always unhappy with the lack of the proposed feature, compared to standard makefiles or facilities provided by these non-Arduino environment.

@PaulStoffregen
Copy link

Support from Teensy, or any other platforms is irrelevant here

Look, you specifically asked "Are you willing to support such feature @PaulStoffregen ?". Well, that's me, and I'm the maintainer of Teensy's software. I don't work for Arduino or represent Arduino. Sorry if that wasn't clear.

@d-a-v
Copy link
Author

d-a-v commented Oct 21, 2021

Well let me please rephrase and sorry for my french. I could not determine in your first comment whether this way of implementing this idea brought by this RFC is worth having it in the Arduino-cli tool as part of official Arduino tools. That was my question to you, as you are also known as an active Arduino platform and library developer / maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants