-
-
Notifications
You must be signed in to change notification settings - Fork 422
ARDUIFINE: global compiler options extracted from ctags parsing #1117
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
Conversation
I would have preferred to propose something like
#arduifine BLAH 1
or
#pragma comment("ARDUIFINE: -Dblah")
but that would have required parsing the whole .ino
files.
The simpler the better: the ctags parser is already here.
About security, the compiler command line is affected but user is warned in the message console.
Additional parsing can be added to ensure that not too special characters are used in the macro defined by "ARDUIFINE" and "ARDUINOGLOBAL" feature can be disabled if it is considered as too dangerous.
@facchinm this is close to this comment.
This PR, apart from adding more noise to an old feature request, is another attempt to finally find an answer to arduino/Arduino#421.
Per this PR, I'd like to bring to anyone interested's attention that the feature is needed.
One of the important use-cases is that it allows users to avoid modifying libraries when some parameters are to be tuned.
(this feature is provided with other IDE able to compile Arduino projects like platformIO or sloeber)
I'm aware that I updated in the legacy/
directory. Are there specific considerations about this directory that should be known by contributors ?
I will be happy to close this PR if any other way is found to close arduino/Arduino#421 which has been opened for 8 years. Attempts or explorations are quite numerous, like this commit(from @facchinm in #421), or one from the link list compiled by @per1234 in #846's OP. I'll also be glad to update this PR until it fits with maintainers idea of what are arduino-cli / arduino-builder.
@per1234, this change proposal even as a PoC is orthogonal to your above statement.
You make me believe this opinion is close to official Arduino's, in which case I should close this PR :)
#846's title "Provide dedicated sets of "extra flags" properties for platform developers and users" did make me think that it is "legal" to provide such facility to users.
I have indeed two use-cases on widely used arduino libraries:
- When a
(削除) bug (削除ここまで)request takes too long to be fixed upstream in a published and popular library, sometimes this kind of "global define hack" is needed, - Nobody wants to locally modify a library in order to properly use it, but sometimes configuring would result in a bigger code than when using a global define (@matthijskooijman and @terrillmoore know this one well)
IMHO It could be a normal use for an Arduino library to need a global define to get some extended behaviour, at no cost when
they are not needed (= without state variable and related code that costs space on small hw).
I would really like clarification on how Arduino plans to address such issues.
edit 24 days later:
- platforms adopt local non-standard hacks like Build option stm32duino/Arduino_Core_STM32#174 and Add prebuild script to use additional build options esp8266/Arduino#8095
- from the Arduino IDE pov, this is sad to read (nothing against the respectable platformIO)
71c47d4
to
26431fc
Compare
4a46c17
to
4fbcfc1
Compare
closed per #1517 (comment)
Uh oh!
There was an error while loading. Please reload this page.
Example: these lines in the
.ino
file:will globally enable the following options in the compiler command line:
That, including during compilation of the core and libraries.
If they are not otherwise used by the sketch, the symbols
ARDUIFINExxx
andARDUINOGLOBALyyy
are excluded from the final binary at link time.This PR aims at giving a solution to arduino/Arduino#421
and is maybe related to #846.
arduifine
(the missing
M
is fixed)