The old beast... using the staging version

Goal: Use the staging version on travis…

stuck… can’t get it to work locally or on travis, but with different issues.

if i git clone the esp8266
- git clone https://github.com/esp8266/Arduino.git ./platformio/packages/framework-arduinoespressif

i get this Travis CI - Test and Deploy Your Code with Confidence

on my machine if i do the same i get this

xtensa-lx106-elf-g++ -o .pioenvs/esp12e/ESP8266WiFi/WiFiUdp.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-s
ections -fdata-sections -MMD -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -DARDUINO=10606 -U__STRICT_ANSI__ -I/Users/am
elvin/.platformio/packages/framework-arduinoespressif/tools/sdk/include -I/Users/amelvin/.platformio/packages/framework-arduinoespressif/tools/sdk/lwip/include -I.pioenvs/esp
12e/FrameworkArduino -I.pioenvs/esp12e/FrameworkArduinoVariant -I.pioenvs/esp12e/ESP8266WiFi .pioenvs/esp12e/ESP8266WiFi/WiFiUdp.cpp
xtensa-lx106-elf-ar rcs .pioenvs/esp12e/libESP8266WiFi.a .pioenvs/esp12e/ESP8266WiFi/ESP8266WiFi.o .pioenvs/esp12e/ESP8266WiFi/ESP8266WiFiAP.o .pioenvs/esp12e/ESP8266WiFi/ESP
8266WiFiGeneric.o .pioenvs/esp12e/ESP8266WiFi/ESP8266WiFiMulti.o .pioenvs/esp12e/ESP8266WiFi/ESP8266WiFiSTA.o .pioenvs/esp12e/ESP8266WiFi/ESP8266WiFiScan.o .pioenvs/esp12e/ES
P8266WiFi/WiFiClient.o .pioenvs/esp12e/ESP8266WiFi/WiFiClientSecure.o .pioenvs/esp12e/ESP8266WiFi/WiFiServer.o .pioenvs/esp12e/ESP8266WiFi/WiFiUdp.o
xtensa-lx106-elf-ranlib .pioenvs/esp12e/libESP8266WiFi.a
xtensa-lx106-elf-g++ -o .pioenvs/esp12e/firmware.elf -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl
,-wrap,register_chipv6_phy -Wl,-T"esp8266.flash.4m1m.ld" .pioenvs/esp12e/src/tmp_ino_to.o -L/Users/amelvin/.platformio/packages/framework-arduinoespressif/tools/sdk/lib -L/Us
ers/amelvin/.platformio/packages/ldscripts -L.pioenvs/esp12e -Wl,--start-group .pioenvs/esp12e/libFrameworkArduinoVariant.a .pioenvs/esp12e/libFrameworkArduino.a -lmesh -lwpa
2 -lsmartconfig -lpp -lmain -lwpa -llwip -lnet80211 -lwps -lcrypto -lphy -lhal -laxtls -lgcc -lm .pioenvs/esp12e/libESP8266WiFi.a -Wl,--end-group
.pioenvs/esp12e/libESP8266WiFi.a(ESP8266WiFiGeneric.o):(.text._ZN23ESP8266WiFiGenericClass14_eventCallbackEPv+0x4): undefined reference to `std::__detail::_List_node_base::_M
_unhook()'
.pioenvs/esp12e/libESP8266WiFi.a(ESP8266WiFiGeneric.o): In function `ESP8266WiFiGenericClass::_eventCallback(void*)':
ESP8266WiFiGeneric.cpp:(.text._ZN23ESP8266WiFiGenericClass14_eventCallbackEPv+0x64): undefined reference to `std::__detail::_List_node_base::_M_unhook()'
collect2: error: ld returned 1 exit status
scons: *** [.pioenvs/esp12e/firmware.elf] Error 1
========================= [ ERROR ] Took 15.89 seconds =========================

Did you read Redirecting... ?

yes. that is what i based it on. seems simple.

git clone https://github.com/esp8266/Arduino.git ./platformio/packages/framework-arduinoespressif

the version.txt is not needed as that is now included in the repository.

so i have created a platformio project out of the wifi example.
it fails to compile locally due to linker error

xtensa-lx106-elf-g++ -o .pioenvs/esp12e/firmware.elf -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl
,-wrap,register_chipv6_phy -Wl,-T"esp8266.flash.4m1m.ld" .pioenvs/esp12e/src/tmp_ino_to.o -L/Users/amelvin/.platformio/packages/framework-arduinoespressif/tools/sdk/lib -L/Us
ers/amelvin/.platformio/packages/ldscripts -L.pioenvs/esp12e -Wl,--start-group .pioenvs/esp12e/libFrameworkArduinoVariant.a .pioenvs/esp12e/libFrameworkArduino.a -lmesh -lwpa
2 -lsmartconfig -lpp -lmain -lwpa -llwip -lnet80211 -lwps -lcrypto -lphy -lhal -laxtls -lgcc -lm .pioenvs/esp12e/libESP8266WiFi.a -Wl,--end-group

.pioenvs/esp12e/libESP8266WiFi.a(ESP8266WiFiGeneric.o):(.text._ZN23ESP8266WiFiGenericClass14_eventCallbackEPv+0x4): undefined reference to `std::__detail::_List_node_base::_M
_unhook()'
.pioenvs/esp12e/libESP8266WiFi.a(ESP8266WiFiGeneric.o): In function `ESP8266WiFiGenericClass::_eventCallback(void*)':
ESP8266WiFiGeneric.cpp:(.text._ZN23ESP8266WiFiGenericClass14_eventCallbackEPv+0x64): undefined reference to `std::__detail::_List_node_base::_M_unhook()'

but if i push it github with a travis file it works. (Travis CI - Test and Deploy with Confidence) so i guess something is wrong with my local platformio. I’m uninstalling it…

back to my actual problem though however… that doesn’t explain why i get

what is reference to core_version.h… what is different here from (Travis CI - Test and Deploy with Confidence)

@ivankravets can you confirm that this command executed in travis will cause platformio to build using the latest staging.

locally i get the linker error mentioned above if i use staging.
on travis it seems to work. (except for my ESPmanager project which fails with this core_version.h error Travis CI - Test and Deploy with Confidence

It looks like core_version.h is there

so why

could this be due to the use of platformio ci vs platformio run?

Sorry, I don’t understand what I should answer. You have different places where it works. It seems to me that somewhere where it doesn’t work you have incorrect contents of `~/.platformio/packages/framework-arduinoespressif``. Please check it.

pio ci is a wrapper around pio run command. Do you mean that it works with pio run and doesn’t work with pio ci?

OK, i’ve been hard at work and made a lot of progress. As far as using staging on travis i’d made some wrong assumptions… first cloning in the repo first before the run command doesn’t work as platformio then officially installs the platform and stuff… so you need to run first

  - platformio platforms install espressif --with-package framework-arduinoespressif

followed by the git clone of the repo. (in the right place too, as i had cloned it to the wrong folder!)…

anyway I now get the same error on my mac as travis… and it is a failed link at the end…

xtensa-lx106-elf-g++ -o .pioenvs/esp12e/firmware.elf -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -Wl,-T"esp8266.flash.4m1m.ld" .pioenvs/esp12e/src/tmp_ino_to.o -L/Users/amelvin/.platformio/packages/framework-arduinoespressif/tools/sdk/lib -L/Users/amelvin/.platformio/packages/ldscripts -L.pioenvs/esp12e -Wl,--start-group .pioenvs/esp12e/libFrameworkArduinoVariant.a .pioenvs/esp12e/libFrameworkArduino.a -lmesh -lwpa2 -lsmartconfig -lpp -lmain -lwpa -llwip -lnet80211 -lwps -lcrypto -lphy -lhal -laxtls -lgcc -lm .pioenvs/esp12e/libESP8266WiFi.a -Wl,--end-group
.pioenvs/esp12e/libESP8266WiFi.a(ESP8266WiFiGeneric.o):(.text._ZN23ESP8266WiFiGenericClass14_eventCallbackEPv+0x4): undefined reference to `std::__detail::_List_node_base::_M_unhook()'
.pioenvs/esp12e/libESP8266WiFi.a(ESP8266WiFiGeneric.o): In function `ESP8266WiFiGenericClass::_eventCallback(void*)':
ESP8266WiFiGeneric.cpp:(.text._ZN23ESP8266WiFiGenericClass14_eventCallbackEPv+0x64): undefined reference to `std::__detail::_List_node_base::_M_unhook()'
collect2: error: ld returned 1 exit status
scons: *** [.pioenvs/esp12e/firmware.elf] Error 1

I know IGRR changed some wifi event handler things a few commits back…

Prior to this commit it works, after it does not…
Not figured out why yet.

ok here is the offending line

https://github.com/esp8266/Arduino/blob/da17d5425a275bca2d891603ac5764b4fb6fbaff/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L215
it = sCbEventList.erase(it);

I suppose these two changes:
6bb8e114 and fc80526eb
may need to be applied manually to platform.io. I don’t think platform.io can pull linker flags automatically from platform.txt.

Spot on as always. Adding
’’‘
PLATFORMIO_BUILD_FLAGS="-lstdc++"
’’’

fixed that.

Removing objects though…probably easier on the other end…

Thanks again