New handling of missing perferences.txt by mhightower83 · Pull Request #8814 · esp8266/Arduino (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation12 Commits6 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

mhightower83

Changes:

Status: ready

@mhightower83

Works on Windows 10. I don't have an 11 platform to test on. Uses the prefered method for finding path to AppData\Local

Cleaned up return with undefined fqfn2.

@mhightower83

@mhightower83

Draft: alternative option for handling missing perferences.txt - safe-mode

@mhightower83

unsupported. Updated usage.

Removed using IDE version as an indicator of shared "core.a" caching.

Assume shared "core.a" caching unless directed otherwise.

@mhightower83

@jgrass3

If you need me to test a preliminary version change, I am willing to test it with my configuration if you are unable to test in a similar environment.

@mhightower83

This was linked to issues

Jan 19, 2023

@jgrass3

Not being a proficient user of this forum (this was my first post), I am confused as to what the status is on this subject is since I now see multiple threads relating to the preferences.txt issue. Is a new version available? Also my offer still stands that I am willing to test the changes that you implement in the new version on my Windows 11 configuration if you need.

@mhightower83

Since only one file is changing, the simplest path may be to back up and replace the file mkbuildoptglobals.py. You can find the proposed replacement under "Files Changed". Here is a more direct link to the file. After it loads on the screen, use the "save as" command to finish the update. I am not sure where it will be located for your installation. Expect it to be in a ... .\tools\ folder.

@jgrass3

Ok, I am not a python programmer so forgive me for my ignorance. What I did was copy that file to the tools directory (found in the D:\Documents\ArduinoData\packages\esp8266 dir, and then do the library update using the Arduino IDE. Nothing changed. Do I need to do anything more? Compile the file first? Again, apologize for my nativity with this so if it is wasting your time, then I'll just stand down. Thank you.

@mhightower83

@jgrass3 You only need to replace the file. mkbuildoptglobals.py is a script so there is no need to compile it, just replace the file. And, no need for any updates. I would be concerned that the update process might be "too helpful" and reload the old one. I would expect this from the "Board Manager"; however, I am surprised that a "Library Manager" would create a problem.

I think the safest path is to: Replace the file, Don't do any updates/upgrades, and Run your test.

@jgrass3

Couple things. First there was NO pre-existing file named mkbuildoptglobals.py ANYWHERE on my PC. I even did a search on all drives. So your file was added to the tools dir and didn't overwrite anything. Second, Library Manager did not cause any compile issues at all, only the Board Manager. And finally, trying to compile my script with your added file in the tools dir made no difference at all. Still get same error.

@mcspr

@mhightower83

Looking back at your original issue, your build messages indicate it was being loaded from D:\\Documents\\ArduinoData\\packages\\esp8266\\hardware\\esp8266\\3.1.1/tools/mkbuildoptglobals.py.

I don't know why it doesn't show up when you search. I just tried it on Windows 10 and it reported all the locations from the specified C:\ location.

When Windows doesn't show me files that I know are there, I usually switch to Administrator mode. Start a command prompt with Administrative privileges. From the top directory enter dir mkbuildoptglobals.py /s.

@mcspr

Couple things. First there was NO pre-existing file named mkbuildoptglobals.py ANYWHERE on my PC. I even did a search on all drives. So your file was added to the tools dir and didn't overwrite anything. Second, Library Manager did not cause any compile issues at all, only the Board Manager. And finally, trying to compile my script with your added file in the tools dir made no difference at all. Still get same error.

D:\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.1.1\tools\mkbuildoptglobals.py
?

@jgrass3

Yea! Good news first. When I finally did everything precisely as you requested, it worked perfectly! With 3.1.1, Auduino IDE found my preferences.txt file and the sketch compiled perfectly. Job well done!

Now the reason I previously reported no success was all my fault. First, I mistakenly searched for the mkbuildoptglobals.py file when I was using 3.0.2. I didn't realize that the file does not exist in that build. When I upgraded to 3.1.1, the file showed up in the proper directory. My other mistake (that in retrospect didn't matter) was I was using the other tools directory in a higher directory branch. No matter, when I found the 3.1.1 mkbuildoptglobals.py file in the lower tools branch, I replaced it with your new one and everything worked. Thank you for your excellent guidance in steering me in the right direction for properly testing your file. Again, great job and thank you for your patience with me.

@mcspr

@mhightower83

@mcspr Yes, this should resolve both issues.

hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request

Nov 18, 2024

@mhightower83 @hasenradball

…#8814)

Labels

alpha

included in alpha release