PlatformIO Community

CI header not found

Hello,
I am trying to move my project to CI and I am having some trouble with the integration process.
The header files located in the include directory are not found. Everything compile just fine on VsCode.

  • This is the command i am running:

      platformio ci src/main.cpp  --project-conf=platformio.ini
    
  • This is my project config:

      [env:bluepill_f103c8]
      platform = ststm32
      board = bluepill_f103c8
      framework = arduino
      upload_port = /dev/ttyUSB*
      upload_protocol = serial
      monitor_speed = 115200
    
  • This is my file structure:

├── primary
│ ├── include
│ │ ├── flight_module.h
│ │ ├── imu_driver.h
│ │ ├── odom.h
│ │ ├── pmw3901.h
│ │ ├── README
│ │ ├── sensors_define.h
│ │ ├── status.h
│ │ └── tof_driver.h
│ ├── platformio.ini
│ ├── src
│ │ ├── flight_module.cpp
│ │ ├── imu_driver.cpp
│ │ ├── main.cpp
│ │ ├── odom.cpp
│ │ ├── pmw3901.cpp
│ │ ├── status.cpp
│ │ └── tof_driver.cpp

  • And that’s my error:
    src/main.cpp:1:10: fatal error: flight_module.h: No such file or directory

Any ideas what I’m doing wrong?

I have changed the command from:
platform IO SRC --conf
to:
platformio run
and it works.

platformio run is basically what VSCode executes, hence why it works when running a build in VSCode works. Why the ci command isn’t working I don’t know… is this a bug @ivankravets or something that needs configuring?

To reproduce, I added a stupid simple include/something.h

#ifndef _SOMETHING_H_
#define _SOMETHING_H_
struct foo {
    int member;
};
#endif

and empty matching src/something.cpp to otherwise working code I was working on, and pio run ran fine, but pio ci --project-conf=platformio.ini src/main.cpp spat the dummy.

src/main.cpp:2:23: fatal error: something.h: No such file or directory

line 2, col 23 being the end of

#include <something.h>