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

New handling of missing perferences.txt #8814

Merged
merged 6 commits into from
Jan 22, 2023

Conversation

mhightower83
Copy link
Contributor

@mhightower83 mhightower83 commented Jan 17, 2023

Changes:

  • Only rely on perferences.txt when requested.
  • Always assume shared core.a caching is in use,
  • Ignore the passed-in IDE version. Too often, the value is not correct

Status: ready

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.
Draft: alternative option for handling missing perferences.txt - safe-mode
unsupported. Updated usage.

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

Assume shared "core.a" caching unless directed otherwise.
@d-a-v d-a-v added the alpha included in alpha release label Jan 18, 2023
@jgrass3
Copy link

jgrass3 commented Jan 19, 2023

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
Copy link
Contributor Author

mhightower83 commented Jan 19, 2023

@jgrass3 Thanks, that would be great! the PR is at #8814 (comment) (disoriented)

@jgrass3
Copy link

jgrass3 commented Jan 21, 2023

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
Copy link
Contributor Author

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
Copy link

jgrass3 commented Jan 21, 2023

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
Copy link
Contributor Author

@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
Copy link

jgrass3 commented Jan 21, 2023

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.

@mhightower83
Copy link
Contributor Author

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
Copy link
Collaborator

mcspr commented Jan 21, 2023

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
Copy link

jgrass3 commented Jan 22, 2023

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
Copy link
Collaborator

mcspr commented Jan 22, 2023

@mhightower83 'Development' issues list on the right is ok?

@mhightower83
Copy link
Contributor Author

@mcspr Yes, this should resolve both issues.

@mcspr mcspr merged commit cf24024 into esp8266:master Jan 22, 2023
@mcspr mcspr added this to the 3.1.2 milestone Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha included in alpha release
Projects
None yet
4 participants