-
Notifications
You must be signed in to change notification settings - Fork 967
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
Arduino CLI fails to build when parameter --build-property build.extra_flags=-Werror
is specified
#1709
Comments
Hi @zfields For STM32 core, Which arduino-cli version you used? I've tested and SWAN_R5 is built properly. |
That is great news! So that means I must be missing something in my environment I suppose? If I understand correctly, you are saying that I can compile (in the most basic sense) using I'm using the latest version of the Arduino CLI v0.21.1, running it on Linux. I've prepared a Dockerfile, so you can see my exact environment: # Copyright 2022 Blues Inc. All rights reserved.
# Use of this source code is governed by licenses granted by the
# copyright holder including that found in the LICENSE file.
# Build development environment
# docker build --file Dockerfile.arduino-cli --tag arduino-buildpack .
# Launch development environment
# docker run --entrypoint bash --interactive --rm --tty --volume "$(pwd)":/host-volume/ --workdir /host-volume/ arduino-buildpack
# Define global arguments
ARG DEBIAN_FRONTEND="noninteractive"
ARG UID=1000
ARG USER="blues"
# POSIX compatible (Linux/Unix) base image
FROM debian:stable-slim
# Import global arguments
ARG DEBIAN_FRONTEND
# Define local arguments
ARG ARDUINO_CLI_VERSION=0.21.1
ARG BINDIR=/usr/local/bin
ARG ECHO_BC_FILE='$bcfile'
# Define environment variables
ENV ARDUINO_UPDATER_ENABLE_NOTIFICATION=false
# Establish development environment
RUN ["dash", "-c", "\
apt-get update --quiet \
&& apt-get install --assume-yes --no-install-recommends --quiet \
bash \
ca-certificates \
curl \
python-is-python3 \
python3 \
python3-pip \
ssh \
&& pip install \
pyserial \
&& apt-get clean \
&& apt-get purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
"]
# Download/Install Arduino CLI
RUN ["dash", "-c", "\
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=${BINDIR} sh -s ${ARDUINO_CLI_VERSION} \
# && arduino-cli completion bash > /usr/share/bash-completion/completions/arduino-cli.sh \
&& mkdir -p /etc/bash_completion.d/ \
&& arduino-cli completion bash > /etc/bash_completion.d/arduino-cli.sh \
&& echo >> /etc/bash.bashrc \
# && echo \"for bcfile in /usr/share/bash-completion/completions/* ; do\" >> /etc/bash.bashrc \
# && echo \"for bcfile in /etc/bash_completion.d/* ; do\" >> /etc/bash.bashrc \
# && echo \" [ -f \\\"${ECHO_BC_FILE}\\\" ] && . \\\"${ECHO_BC_FILE}\\\"\" >> /etc/bash.bashrc \
# && echo \"done\" >> /etc/bash.bashrc \
"]
# Configure Arduino CLI
RUN ["dash", "-c", "\
arduino-cli config init \
&& arduino-cli config add board_manager.additional_urls \
https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json \
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json \
https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/main/package_sparkfun_apollo3_index.json \
https://raw.githubusercontent.com/adafruit/arduino-board-index/gh-pages/package_adafruit_index.json \
https:/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json \
&& arduino-cli core update-index \
&& arduino-cli core install arduino:avr \
&& arduino-cli core install arduino:mbed_nano \
&& arduino-cli core install arduino:samd \
&& arduino-cli core install STMicroelectronics:stm32 \
&& arduino-cli core install esp32:esp32 \
&& arduino-cli core install SparkFun:apollo3 \
&& arduino-cli core install adafruit:nrf52 \
&& arduino-cli core install adafruit:samd \
&& arduino-cli core install rp2040:rp2040 \
&& arduino-cli lib install \"Blues Wireless Notecard\" \
"]
ENTRYPOINT ["arduino-cli"]
CMD ["help"] |
Probably.
Yes. It has been tested on Linux and Windows with ardunio-cli 0.21.1.
OK but I've no idea about this. GHA also uses docker and it works fine. GHA: On my Linux host:
|
Okay, I over-simplified my example to make it easier to share. I can confirm, when using the most basic command syntax you provided, the This works:
In my actual use case, I'm trying to ensure our examples compile without warning on our ST hardware, and I want to fail the build if a warning is encountered. So I added two additional build arguments:
Adding them back one at a time, I was able to narrow it down to By adding this one parameter to the build it causes everyone of my ST boards to fail in a similar fashion, given a message like the one below.
This is bizarre, because the build does not produce any warnings when So I guess the name of this bug should be, "Arduino CLI fails to build when parameter This only occurs when attempting to build using the ST platform. I have been able to compile for the esp32, nrf52, apollo, mbed and avr platforms without issue. |
--build-property build.extra_flags=-Werror
is specified
Hi @zfields You redefine a property which is defined in the boards.txt: Line 5814 in 949ecc8
So that is normal it fails. An issue exists on arduino-cli to avoid such issue: Extract:
In your case you can define it properly,(I didn't test):
or you can use the |
Oh wow, that's unreal. Sorry for not sharing the full detail in the first place, I couldn't imagine that would be the problem. For the sake of CI, I would like to have a single formation of the compile command and substitute { fqbn } and { sketch }. I would like to learn more about the other approach. Where is |
Here: Anyway I do not advise to use -Werror as probably HAL will raised some warnings which will be converted as error but as we use HAL from the Cube "as is", no issue about this will be accepted here. For those warnings, they have to be submitted to the official repo on https:/STMicroelectronics/. I close this issue as it is invalid and it is not the place to discuss arduino-cli options. |
Sharing the results (for others who may find this) of my continued research and conversations with the Arduino CLI maintainer, @per1234. Based on the flags I was attempting to send, The property I originally tried to modify, Modifying |
Fixes stm32duino#1709 Signed-off-by: Frederic Pillon <[email protected]>
Fixes #1709 Signed-off-by: Frederic Pillon <[email protected]>
Fixes stm32duino#1709 Signed-off-by: Frederic Pillon <[email protected]>
The Arduino CLI compiles most firmware using the following parameter and an
.ino
file.For example:
If I try this with an ST board I get the following error:
I compiled the firmware in the Arduino IDE and I noticed the
--fqbn
used is more complex.I tried to compile using the Arduino CLI with the more complex
--fqbn
parameter, but I'm still hitting the same issue.What am I missing? I have compiled sketches (including this one) for nearly every platform I can think of, but I cannot get ST to compile.
The text was updated successfully, but these errors were encountered: