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

Ide 1.5.x platform.local.txt #1985

Merged

Conversation

matthijskooijman
Copy link
Collaborator

This allows overriding values from platform.txt using a platform.local.txt.

Additionally, the third commit makes the avr platform.txt not rely on a compiler.path value set by the IDE, see the commit for the rationale.

As discussed at https://groups.google.com/a/arduino.cc/d/msg/developers/4jL4nL_YJ1k/E-AW4XFD-W0J

This helps advanced users that want to change options (e.g. to use a
different toolchain or enable warnings), without having to change
platform.txt (which could make git report changed files all the time).
These make it easier for a user to add extra compiler flags in a
platform.local.txt file.
Previously, this relied on an (ugly, avr-specific) magic default for the
compiler.path variable, set by the IDE. This allowed the IDE to fall
back to a system-wide toolchain when no bundled toolchain was found (by
making compiler.path empty).

However,
 - this only worked for avr, not sam,
 - this worked only for gcc, a system-wide avrdude would break on the
   avrdude.conf path in platform.txt, and

This would mean that automatic system-wide fallback didn't work in all
situations, so you'd still have to modify platform.txt (or create
platform.local.txt). Since doing that explictly is the most reliable
way, this commit removes the partial-working ability to do this
automatically.

Note that the code to automatically set compiler.path is still kept
around, in case third-party hardware still relies on this. At some
point, this code should be removed, but for now it just shows a warning
message.
@matthijskooijman
Copy link
Collaborator Author

I just amended the last commit with a small fix.

@cmaglie cmaglie merged commit a89f5e6 into arduino:ide-1.5.x Apr 10, 2014
@matthijskooijman
Copy link
Collaborator Author

Thanks!

matthijskooijman added a commit to Pinoccio/core-pinoccio that referenced this pull request Apr 12, 2014
This is a file that can be used to tweak platform.txt, once
arduino/Arduino#1985 is merged.
@matthijskooijman matthijskooijman deleted the ide-1.5.x-platform.local.txt branch April 14, 2014 14:04
@Diaoul
Copy link

Diaoul commented Dec 13, 2014

Where should the platform.local.txt file be located on Linux and manually installed arduino under ~/Arduino?

@matthijskooijman
Copy link
Collaborator Author

IIRC it should just be next to the existing platform.txt.

@Diaoul
Copy link

Diaoul commented Dec 15, 2014

Wouldn't that make sense to store under ~/.arduino15/ next to the preferences.txt file? Or provide a way to configure the directory where to find platform.local.txt within the preferences.txt file?

@matthijskooijman
Copy link
Collaborator Author

I think you can already store a normal platform.txt in your sketchbook (Sketchbook/hardware/arduino/avr/platform.txt), which will "inherit" everything from the regular platform.txt, so effectively providing an override. I'm not entirely sure how / if this works though. The platform.local.txt feature was coded with a git checkout of the IDE code in mind, though I can't recall if I actually tried overriding platform.txt from my sketchbook at all...

ollie1400 pushed a commit to ollie1400/Arduino that referenced this pull request May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants