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

time.cpp:27:14: fatal error: sys/_tz_structs.h: No such file or directory #7792

Closed
3 of 6 tasks
TD-er opened this issue Dec 24, 2020 · 20 comments
Closed
3 of 6 tasks

Comments

@TD-er
Copy link
Contributor

TD-er commented Dec 24, 2020

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12|ESP-01|ESP-07|ESP8285 device|other]
  • Core Version: [latest git]
  • Development Env: [Platformio]
  • Operating System: [Windows|Ubuntu]

Settings in IDE

  • Module: [Generic ESP8266 Module|Wemos D1 mini r2|Nodemcu|other]
  • Flash Mode: [dio]
  • Flash Size: [4MB/1MB]
  • lwip Variant: [v1.4|v2 Lower Memory|Higher Bandwidth]
  • Reset Method: [ck|nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz|160MHz]
  • Upload Using: [OTA|SERIAL]
  • Upload Speed: [115200|other] (serial upload only)

Problem Description

In my builds where I use the latest git of esp8266/Arduino, I get this build error:

C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\time.cpp:27:14: fatal error: sys/_tz_structs.h: No such file or directory

This is when building in Windows as well as building in Linux.

@d-a-v
Copy link
Collaborator

d-a-v commented Dec 24, 2020

The toolchain needs an update
(it's cd tools; ./get.py when using git and the Arduino IDE)

@mcspr
Copy link
Collaborator

mcspr commented Dec 24, 2020

Development Env: [Platformio]

PIO needs to be explicitly told about the toolchain-xtensa package version when on master branch. This repo has no way of controlling it, since it is bound to the platform-espressif8266 config that locks the version :/

Some discussion here:
platformio/platformio-core#3612

I'll publish the packages for my own repo some time today to be available via mcspr/toolchain-xtensa
Right now though it's something like

environment should have:

platform_packages = 
    platformio/framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
    mcspr/toolchain-xtensa @ 5.100200.201223

Documentation needs an update, both https://docs.platformio.org/en/latest/platforms/espressif8266.html and README. idk about referring to the mcspr/... package though, but that's the only way atm without pinging PIO team each toolchain version bump

@Jason2866
Copy link
Contributor

@mcspr The Linux package seems to have wrong permissions in the package.
Platformio build fails

@proddy
Copy link

proddy commented Dec 25, 2020

same here

Tool Manager: Installing mcspr/toolchain-xtensa @ 5.100200.201223
Error: Could not find the package with 'mcspr/toolchain-xtensa @ 5.100200.201223' requirements for your system 'linux_x86_64'

@Jason2866
Copy link
Contributor

@proddy it is NOT a Arduino ESP8266 issue. It is a PlatformIO issue. mcspr already opened a issue in platformio github

@earlephilhower
Copy link
Collaborator

I'm going to close this since it seems the consensus is it's a PIO issue and might already have been taken care of. If there's a core-proper problem we can reopen and figure it out.

@TD-er
Copy link
Contributor Author

TD-er commented Jan 3, 2021

and might already have been taken care of.

Not really....
But I will try to find the right issue for it.

The fix mentioned here is -for now- the fix.

Just to give an impression of "not being fixed" (and for those ending up here when searching for the build error)

In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:39,
                 from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Stream.cpp:23:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/twi.h:24:10: fatal error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h: No such file or directory
   24 | #include "Arduino.h"
      |          ^~~~~~~~~~~
compilation terminated.
In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\StreamString.cpp:23:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:37:10: fatal error: binary.h: No such file or directory

****************************************************************
* Looking for binary.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:binary.h"
* Web  > https://platformio.org/lib/search?query=header:binary.h
*
****************************************************************

compilation terminated.
In file included from c:\github\td-er\espeasy\src\espeasy_common.h:35,
                 from src\src\Globals\../Helpers/Scheduler.h:4,
                 from src\src\Globals\ESPEasy_Scheduler.h:4,
                 from src\src\Globals\ESPEasy_Scheduler.cpp:1:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:37:10: fatal error: binary.h: No such file or directory

****************************************************************
* Looking for binary.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:binary.h"
* Web  > https://platformio.org/lib/search?query=header:binary.h
*
****************************************************************

compilation terminated.
In file included from c:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\esp8266sdfat\src\common\fsapiconstants.h:58,
                 from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src\ExFatLib\ExFatFile.h:36,
                 from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src\ExFatLib\upcase.h:27,
                 from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SdFat\src\ExFatLib\upcase.cpp:25:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/FS.h:25:10: fatal error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h: No such file or directory
compilation terminated.
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\FrameworkArduino\Stream.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\FrameworkArduino\StreamString.cpp.o] Error 1
In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,
                 from src\src\Helpers\../../ESPEasy_common.h:82,
                 from src\src\Helpers\../../ESPEasy-Globals.h:6,
                 from src\src\Helpers\WebServer_commandHelper.cpp:3:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src/WiFiClient.h:25:10: fatal error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h: No such file or directory
   25 | #include "Arduino.h"
      |          ^~~~~~~~~~~
compilation terminated.
In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:285,
                 from c:\github\td-er\espeasy\src\espeasy_common.h:35,
                 from src\src\Globals\../Globals/../DataStructs/Caches.h:5,
                 from src\src\Globals\../Globals/Cache.h:4,
                 from src\src\Globals\Cache.cpp:1:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/WString.h:29:10: fatal error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/pgmspace.h: No such file or directory
   29 | #include <pgmspace.h>
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Updater.cpp:1:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Updater.h:4:10: fatal error: Arduino.h: No such file or directory

*****************************************************************
* Looking for Arduino.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Arduino.h"
* Web  > https://platformio.org/lib/search?query=header:Arduino.h
*
*****************************************************************

    4 | #include <Arduino.h>
      |          ^~~~~~~~~~~
compilation terminated.
In file included from src\ESPEasy_common.h:35,
                 from src\ESPEasy_common.cpp:1:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:36:10: fatal error: stdlib_noniso.h: No such file or directory

***********************************************************************
* Looking for stdlib_noniso.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:stdlib_noniso.h"
* Web  > https://platformio.org/lib/search?query=header:stdlib_noniso.h
*
***********************************************************************

compilation terminated.
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\TypeConversion.cpp:27:10: fatal error: TypeConversion.h: No such file or directory

************************************************************************
* Looking for TypeConversion.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:TypeConversion.h"
* Web  > https://platformio.org/lib/search?query=header:TypeConversion.h
*
************************************************************************

compilation terminated.
In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Tone.cpp:24:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Arduino.h:229:10: fatal error: mmu_iram.h: No such file or directory

******************************************************************
* Looking for mmu_iram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:mmu_iram.h"
* Web  > https://platformio.org/lib/search?query=header:mmu_iram.h
*
******************************************************************

In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,
                 from c:\github\td-er\espeasy\src\espeasy_common.h:82,
                 from c:\github\td-er\espeasy\src\src\datastructs\rtcstruct.h:4,
                 from src\src\ESPEasyCore\../Globals/RTC.h:4,
                 from src\src\ESPEasyCore\ESPEasyWiFi_credentials.cpp:2:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src/WiFiClient.h:25:10: fatal error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h: No such file or directory
   25 | #include "Arduino.h"
      |          ^~~~~~~~~~~
In file included from lib\Regexp\src\Regexp.h:25,
                 from lib\Regexp\src\Regexp.cpp:256:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:229:10: fatal error: mmu_iram.h: No such file or directory

******************************************************************
* Looking for mmu_iram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:mmu_iram.h"
* Web  > https://platformio.org/lib/search?query=header:mmu_iram.h
*
******************************************************************

In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src\ESP8266WiFi.h:34,
                 from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src\ESP8266WiFiSTA.cpp:25:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src\ESP8266WiFiSTA.h:30:10: fatal error: LwipIntf.h: No such file or directory

******************************************************************
* Looking for LwipIntf.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:LwipIntf.h"
* Web  > https://platformio.org/lib/search?query=header:LwipIntf.h
*
******************************************************************

   30 | #include "LwipIntf.h"
      |          ^~~~~~~~~~~~
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\FrameworkArduino\TypeConversion.cpp.o] Error 1
In file included from c:\github\td-er\espeasy\src\espeasy_common.h:35,
                 from src\src\Globals\../Globals/../DataStructs/RTCStruct.h:4,
                 from src\src\Globals\../Globals/RTC.h:4,
                 from src\src\Globals\RTC.cpp:1:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:229:10: fatal error: mmu_iram.h: No such file or directory

******************************************************************
* Looking for mmu_iram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:mmu_iram.h"
* Web  > https://platformio.org/lib/search?query=header:mmu_iram.h
*
******************************************************************

compilation terminated.
compilation terminated.
compilation terminated.
compilation terminated.
compilation terminated.
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\src\src\Globals\Cache.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\lib169\ESP8266SdFat\ExFatLib\upcase.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\FrameworkArduino\Updater.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\src\ESPEasy_common.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\src\src\Globals\ESPEasy_Scheduler.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\src\src\Helpers\WebServer_commandHelper.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\FrameworkArduino\Tone.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\lib1d9\Regexp\Regexp.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\src\src\Globals\RTC.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\src\src\ESPEasyCore\ESPEasyWiFi_credentials.cpp.o] Error 1
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\lib9d7\ESP8266WiFi\ESP8266WiFiSTA.cpp.o] Error 1
xtensa-lx106-elf-g++: error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\WMath.cpp: No such file or directory
xtensa-lx106-elf-g++: fatal error: no input files
compilation terminated.
*** [.pio\build\test_beta_ESP8266_16M_LittleFS\FrameworkArduino\WMath.cpp.o] Error 1

@earlephilhower
Copy link
Collaborator

Fair enough, thanks for the pointer for others. But if you're getting something like...

In file included from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:39,
                 from C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Stream.cpp:23:
C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/twi.h:24:10: fatal error: C:\users\gijsn\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h: No such file or directory
   24 | #include "Arduino.h"
      |          ^~~~~~~~~~~

then there's definitely nothing we can do here to fix that. Hopefully PIO will be able to fix things...

mcspr added a commit to xoseperez/espurna that referenced this issue Jan 4, 2021
@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jan 30, 2021

I can compile this repo in C++17 mode (since that's already the default in the platformio-build.py CXXFLAGS value) while when commenting out line 27 of the time.cpp with the offending #include <sys/_tz_structs.h> line. Builds then just fine.

This include file is nowhere to be found in the Xtensa GCC 10.1.0 package (at least the one server by PlatformIO from official sources from e.g. here). Since it still compiles it must have been moved into headers that are already included (otherwise there would be a build failure).

So I think the Arduino core shouldn't include a compiler and compiler-version specific / internal _tz_structs.h file. The underscore in the filename also makes it "reserved for internal use" if I read it right?

Or it could be you're using another package version / source for the xtensa compiler that actually has that file? Where is that sourced from?

Full platformio.ini for refernence, working on Windows 10, should work on all OSes.

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
platform_packages = 
    toolchain-xtensa@~2.100100.0
    framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git

@Jason2866
Copy link
Contributor

@maxgerhardt the toolchain provided from Platformio you mentioned is to old to be used with actual Arduino stage. The needed toolchain is here https://github.com/earlephilhower/esp-quick-toolchain/releases/tag/3.0.0-newlib4.0.0-gnu22

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jan 30, 2021

Thanks, confirmed working with that direct toolchain and a new clean clone of the current repo.

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
; windows specific download link straight from git
platform_packages = 
    toolchain-xtensa@https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu22/x86_64-w64-mingw32.xtensa-lx106-elf-48f7b08.210128.zip
    framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git

Since I did not see that a PlatformIO issue was opened between 24th December and now regarding the toolchain update, I opened it at platformio/platform-espressif8266#242.

The version in the current repo is the second-latest availalbe version in relation to the repo you posted above.

Edit: Per linked issue it's also much simpler to use @mcspr's toolchain version for 10.2.0 with

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
; windows specific download link straight from git
platform_packages = 
    toolchain-xtensa@~5.100200.0
    framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git

no file modifications necessary.

@crwhite57
Copy link

@proddy it is NOT a Arduino ESP8266 issue. It is a PlatformIO issue. mcspr already opened a issue in platformio github

I am using Arduino to program my esp8266 and I am getting the same thing so how is it not an Arduino ESP8266 issue?

@Jason2866
Copy link
Contributor

@crwhite57 you have to install as described here https://github.com/esp8266/Arduino#using-git-version

@crwhite57
Copy link

So are you saying to install the latest version of Arduino? If so, I have the newest version you can get. If not, Please explain.

@maxgerhardt
Copy link
Contributor

In what sketch are you getting this error? Any, like also the blinky sketch?

That error should only appear if you are using a very recent Arduino-ESP8266 core version but an older compiler that doesn't have this file (in the right place).

@crwhite57
Copy link

crwhite57 commented Apr 3, 2021 via email

@maxgerhardt
Copy link
Contributor

And did you install Arduino-ESP8266 in the Arduino IDE via the board manager URL or somehow else?

@crwhite57
Copy link

crwhite57 commented Apr 3, 2021 via email

@d-a-v
Copy link
Collaborator

d-a-v commented Apr 3, 2021

This issue is caused y a mismatching toolchain and source code.

There are several ways to install this core and the matching toolchain:

  • arduino board manager will install the right toolchain
  • git version gets its toolchain via the script get.py in tools/
  • PlatformIO

Overwriting an installation with another one's source code is unsupported and leads to issues.
When using the Arduino IDE, the issue often disappears by completely removing the esp8266/arduino installation and restarting from scratch. By completely is meant that arduino15/package/esp8266 directory must be removed too.

@crwhite57
Copy link

crwhite57 commented Apr 3, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants