arduino / arduino/ArduinoCore-arc32

Should extra_flags be empty in platform.txt?

Open
#599 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
330
Forks
281
PR merge metrics
No merged PRs in 30d

Description

In my continuous integration pipeline, I was using the arduino-cli to compile an Arduino library example for the Intel:arc32:arduino_101 like:

```
arduino-cli compile --build-properties compiler.cpp.extra_flags='-DIN_CI' --fqbn "Intel:arc32:arduino_101" "examples/Continuous"
```

The `IN_CI` define is supposed to let me modify my code example if I'm compiling in the CI.

However, I get this error message:

```ShellSession
/home/ryantm/.arduino15/packages/Intel/hardware/arc32/2.0.4/cores/arduino/error.h:24:19: fatal error: os/os.h: No such file or directory
#include "os/os.h"
```

If I add in the [cpp.extra_flags](https://github.com/arduino/ArduinoCore-arc32/blob/00f50b3f231cee5f5bf1c9395e278160ab9edab1/platform.txt#L40), it compiles fine:

```ShellSession
$ arduino-cli compile --build-properties 'compiler.cpp.extra_flags=-DIN_CI -D__CPU_ARC__ -DCLOCK_SPEED=32 -DCONFIG_SOC_GPIO_32 -DCONFIG_SOC_GPIO_AON -DINFRA_MULTI_CPU_SUPPORT -DCFW_MULTI_CPU_SUPPORT -DHAS_SHARED_MEM -I{build.system.path}/libarc32_arduino101/common -I{build.system.path}/libarc32_arduino101/drivers -I{build.system.path}/libarc32_arduino101/bootcode -I{build.system.path}/libarc32_arduino101/framework/include' --fqbn "Intel:arc32:arduino_101" "examples/Continuous"
Sketch uses 20708 bytes (13%) of program storage space. Maximum is 155648 bytes.
```

I also noticed that the [avr core](https://github.com/arduino/ArduinoCore-avr/blob/60f0d0b125e06dbf57b800192c80e5f60d681438/platform.txt#L42) does not populate these extra_flags.

I haven't found documentation on it, but I believe that the extra_flags should be empty so that the local build system can use them.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with platform.txt around the compiler.cpp.extra_flags definition cited in the issue, then compare it with the AVR core's platform.txt entry. Reproduce the arduino-cli compile command for the Intel:arc32:arduino_101 target with and without the supplied flags, and determine whether the platform configuration should provide them; done means the CI example compiles with the intended extra define and the configuration is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.