PlatformIO Community

Program compiling in VSCode but failing in Jenkins

Hi,

Recently I have tried to improve my CI game and I fired up a pi with Jenkins and I am in the process of integrating my PIO project in jenkins.

I have finally managed to ensure my jenkins can build PIO projects just fine however I have reached a stump in my knowledge.

I have written a very simple test program where my own libraries are ordered in a common directory as such:

ESP8266Projects
|
|-- Common
|    |-- WiFi
|         |-- include
|              |-- CWifi.h
|              |-- IWifi.h
|         |-- src
|              |-- CWiFi.cpp
|-- RGBWLight
    |-- src
        |-- main.cpp

Now I have included this common folder (which will be for shared libaries) in my .ini file as such:

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_extra_dirs = 
    ${PROJECT_DIR}/../Common
check_tool = cppcheck
check_flags = --enable=all

Now my problem is the following:
If I compile this program in VSCode (using PlatformIO) this works just fine. No problem.

I then commit it which forces Jenkins to checkout the code and compile it by also running pio -v it fails since now it says it can’t find IWiFi.h although it does say in the dependency graph it found the library… I have no clue as to why and could use some help.

Jenkins output:

Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2; framework: arduino; lib_extra_dirs: ${PROJECT_DIR}/…/Common; check_tool: cppcheck; check_flags: --enable=all)

CONFIGURATION:
PLATFORM: Espressif 8266 (2.6.3) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 3.20704.0 (2.7.4)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.30000.201119 (3.0.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    LDF: Library Dependency Finder →
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 30 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- (/var/lib/jenkins/workspace/ESP-Projects/Common/WiFi)
    | |-- 1.0 (/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
    Building in release mode
    xtensa-lx106-elf-g++ -o .pio/build/nodemcuv2/src/main.cpp.o -c -fno-rtti -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -U__STRICT_ANSI__ -ffunction-sections -fdata-sections -fno-exceptions -Wall -DPLATFORMIO=50101 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_NODEMCU -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DARDUINO=10805 -DARDUINO_BOARD=“PLATFORMIO_NODEMCUV2” -DFLASHMODE_DIO -DLWIP_OPEN_SRC -DNONOSDK22x_190703=1 -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DVTABLES_IN_FLASH -Isrc -I/var/lib/jenkins/workspace/ESP-Projects/Common/WiFi/include -I/var/lib/jenkins/workspace/ESP-Projects/Common/WiFi/src -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/variants/nodemcu src/main.cpp
    xtensa-lx106-elf-gcc -CC -E -P -DVTABLES_IN_FLASH /var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/ld/eagle.app.v6.common.ld.h -o .pio/build/nodemcuv2/ld/local.eagle.app.v6.common.ld
    xtensa-lx106-elf-g++ -o .pio/build/nodemcuv2/lib7fb/ESP8266WiFi/BearSSLHelpers.cpp.o -c -fno-rtti -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -U__STRICT_ANSI__ -ffunction-sections -fdata-sections -fno-exceptions -Wall -DPLATFORMIO=50101 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_NODEMCU -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DARDUINO=10805 -DARDUINO_BOARD=“PLATFORMIO_NODEMCUV2” -DFLASHMODE_DIO -DLWIP_OPEN_SRC -DNONOSDK22x_190703=1 -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DVTABLES_IN_FLASH -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/variants/nodemcu /var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp
    xtensa-lx106-elf-g++ -o .pio/build/nodemcuv2/lib7fb/ESP8266WiFi/CertStoreBearSSL.cpp.o -c -fno-rtti -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -U__STRICT_ANSI__ -ffunction-sections -fdata-sections -fno-exceptions -Wall -DPLATFORMIO=50101 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_NODEMCU -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DARDUINO=10805 -DARDUINO_BOARD=“PLATFORMIO_NODEMCUV2” -DFLASHMODE_DIO -DLWIP_OPEN_SRC -DNONOSDK22x_190703=1 -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DVTABLES_IN_FLASH -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include -I/var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/variants/nodemcu /var/lib/jenkins/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp
    src/main.cpp:2:19: fatal error: IWiFi.h: No such file or directory

  • Looking for IWiFi.h dependency? Check our library registry!
  • CLI > platformio lib search “header:IWiFi.h”

#include <IWiFi.h>
^
compilation terminated.

Thanks a bunch already!

You have a typo there.

The only way this could work is when IWifi.h == IWiFi.h which is the case on case-insensitive filesystems, such as Windows – the build immediately breaks under Linux or Mac if filenames don’t match exactly.

You my good sir are a life saver. After spending way too much time looking for this and knowing and it indeed had to do something with the difference between Windows (my pc) and Linux (jenkins) and just kept staring at my screen.

As always with code, the problem was located between the screen and the chair. :grin: