Skip to content

arduino_debug (windows) updates preferences.txt even without --save-prefs #6067

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

Closed
terrillmoore opened this issue Mar 13, 2017 · 1 comment
Closed
Labels
Component: Documentation Related to Arduino's documentation content Type: Bug
Milestone

Comments

@terrillmoore
Copy link

It's not clear whether this is a documentation bug or an arduino_debug.exe bug.

From the man page manpage.adoc

--pref name=value

Sets the preference name to the given value.

Note that the preferences you set with this option are not validated: Invalid names will be set but never used, invalid values might lead to an error later on.

This is clear; if you use an invalid name (for example) for build.prefs=..., the program will use those preference anyway.

--save-prefs

Save any (changed) preferences to preferences.txt. In particular --board, --port, --pref, --verbose, --verbose-build and --verbose-upload may alter the current preferences.

The --save-prefs option description implies that if --save-prefs is not given, then preferences.txt will not be updated. However, this is not the case, at least on Windows.

$ ls -l ~/AppData/Local/arduino15/preferences.txt
-rw-r--r-- 1 tmm 197609 4102 Mar 12 21:54 /c/Users/tmm/AppData/Local/arduino15/preferences.txt
$  arduino_debug.exe --verify somthing.ino
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
$ ls -l ~/AppData/Local/arduino15/preferences.txt                                  
-rw-r--r-- 1 tmm 197609 4102 Mar 12 22:04 /c/Users/tmm/AppData/Local/arduino15/preferences.txt

If, in fact, you specify --pref build.path=... on the command line, it is written to preferences.txt, even if you did not specify --save-prefs.

Example: preferences.txt without build.path= setting; then run the command line tool.

$ head -5 ~/AppData/Local/arduino15/preferences.txt
board=adafruit_feather_m0
boardsmanager.additional.urls=https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
build.verbose=false
build.warn_data_percentage=75
compiler.warning_level=none

$ arduino_debug.exe --verify catena4420_test01.ino --pref build.path=foo
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...

$ head -5 ~/AppData/Local/arduino15/preferences.txt                                
board=adafruit_feather_m0
boardsmanager.additional.urls=https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
build.path=foo
build.verbose=false
build.warn_data_percentage=75

$

Note that build.path=foo now appears, despite no --save-prefs switch on the command line.

Either the documentation should be clarified, or the command-line invocation should be corrected.

@facchinm facchinm added Component: Documentation Related to Arduino's documentation content Type: Bug labels Mar 13, 2017
@cmaglie cmaglie added this to the Release 1.8.2 milestone Mar 22, 2017
@cmaglie
Copy link
Member

cmaglie commented Mar 22, 2017

The fix will be available in the 1.8.2 release.

Thank you for the bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants