Skip to content
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

tools/ci: Switch kconfig-frontend to kconfiglib #8504

Merged
merged 5 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion boards/risc-v/esp32c6/esp32c6-devkit/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ if ARCH_BOARD_ESP32C6_DEVKIT
config ESP32C6_DEVKIT_RUN_IRAM
bool "Run from IRAM"
default n
---help---

endif # ARCH_BOARD_ESP32C6_DEVKIT
23 changes: 14 additions & 9 deletions tools/Unix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,10 @@ pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT)
KCONFIG_ENV = APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR)
KCONFIG_ENV += APPSBINDIR=${CONFIG_APPS_DIR} BINDIR=${TOPDIR}

KCONFIG_LIB = $(shell command -v menuconfig 2> /dev/null)
LOADABLE = $(shell grep "=m$$" $(TOPDIR)/.config)
ifeq ($(CONFIG_BUILD_LOADABLE)$(LOADABLE),)
KCONFIG_LIB = $(shell command -v menuconfig 2> /dev/null)
endif

# Prefer "kconfiglib" if host OS supports it

Expand All @@ -616,20 +619,22 @@ ifeq ($(KCONFIG_LIB),)
KCONFIG_NCONFIG = kconfig-nconf Kconfig
KCONFIG_QCONFIG = kconfig-qconf Kconfig
KCONFIG_GCONFIG = kconfig-gconf Kconfig
KCONFIG_SAVEDEFCONFIG = kconfig-conf Kconfig --savedefconfig
KCONFIG_SAVEDEFCONFIG = kconfig-conf Kconfig --savedefconfig defconfig.tmp
define kconfig_tweak_disable
kconfig-tweak --file $1 -u $2
endef
else
KCONFIG_OLDCONFIG = oldconfig
KCONFIG_OLDDEFCONFIG = olddefconfig
KCONFIG_MENUCONFIG = menuconfig
KCONFIG_NCONFIG = guiconfig
PURGE_MODULE_WARNING = 2>&1 | grep -v "warning: the 'modules' option is not supported"
KCONFIG_OLDCONFIG = oldconfig ${PURGE_MODULE_WARNING}
KCONFIG_OLDDEFCONFIG = olddefconfig ${PURGE_MODULE_WARNING}
KCONFIG_MENUCONFIG = menuconfig ${PURGE_MODULE_WARNING}
KCONFIG_NCONFIG = guiconfig ${PURGE_MODULE_WARNING}
KCONFIG_QCONFIG = ${KCONFIG_NCONFIG}
KCONFIG_GCONFIG = ${KCONFIG_NCONFIG}
KCONFIG_SAVEDEFCONFIG = savedefconfig --out
KCONFIG_SAVEDEFCONFIG = savedefconfig --out defconfig.tmp ${PURGE_MODULE_WARNING}
define kconfig_tweak_disable
sed -i '/$2/d' $1
$(Q) sed -i'.orig' '/$2/d' $1
$(Q) rm -f $1.orig
endef
endif

Expand Down Expand Up @@ -671,7 +676,7 @@ gconfig: apps_preconfig
$(Q) ${KCONFIG_ENV} ${KCONFIG_GCONFIG}

savedefconfig: apps_preconfig
$(Q) ${KCONFIG_ENV} ${KCONFIG_SAVEDEFCONFIG} defconfig.tmp
$(Q) ${KCONFIG_ENV} ${KCONFIG_SAVEDEFCONFIG}
$(Q) $(call kconfig_tweak_disable,defconfig.tmp,CONFIG_APPS_DIR)
$(Q) grep "CONFIG_ARCH=" .config >> defconfig.tmp
$(Q) grep "^CONFIG_ARCH_CHIP_" .config >> defconfig.tmp; true
Expand Down
22 changes: 12 additions & 10 deletions tools/ci/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ function elf-toolchain {
}

function gen-romfs {
add_path "${tools}"/genromfs/usr/bin

if [ ! -f "${tools}/genromfs/usr/bin/genromfs" ]; then
git clone https://bitbucket.org/nuttx/tools.git "${tools}"/nuttx-tools
cd "${tools}"/nuttx-tools
tar zxf genromfs-0.5.2.tar.gz -C "${tools}"
cd "${tools}"/genromfs-0.5.2
make install PREFIX="${tools}"/genromfs
cd "${tools}"
rm -rf genromfs-0.5.2
if ! type genromfs &> /dev/null; then
case ${os} in
Darwin)
brew tap PX4/px4
brew install genromfs
;;
Linux)
apt-get install -y genromfs
;;
esac
fi
}

Expand All @@ -242,6 +242,7 @@ function kconfig-frontends {
add_path "${tools}"/kconfig-frontends/bin

if [ ! -f "${tools}/kconfig-frontends/bin/kconfig-conf" ]; then
git clone https://bitbucket.org/nuttx/tools.git "${tools}"/nuttx-tools
cd "${tools}"/nuttx-tools/kconfig-frontends
./configure --prefix="${tools}"/kconfig-frontends \
--disable-kconfig --disable-nconf --disable-qconf \
Expand Down Expand Up @@ -287,6 +288,7 @@ function python-tools {
cxxfilt \
esptool==3.3.1 \
imgtool==1.9.0 \
kconfiglib \
pexpect==4.8.0 \
pyelftools \
pyserial==3.5 \
Expand Down
13 changes: 4 additions & 9 deletions tools/ci/docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ RUN mkdir bloaty -p \
&& cmake -DCMAKE_SYSTEM_PREFIX_PATH=/tools/bloaty \
&& make install

RUN cd nuttx-tools \
&& mkdir genromfs \
&& tar -C genromfs --strip-components=1 -xf genromfs-0.5.2.tar.gz \
&& cd genromfs \
&& make install PREFIX=/tools/genromfs

RUN cd nuttx-tools/kconfig-frontends \
&& ./configure --enable-mconf --disable-gconf --disable-qconf --enable-static --prefix=/tools/kconfig-frontends \
&& make install
Expand Down Expand Up @@ -239,6 +233,7 @@ RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q
gcc \
gcc-avr \
gcc-multilib \
genromfs \
gettext \
git \
lib32z1-dev \
Expand Down Expand Up @@ -276,7 +271,8 @@ ENV PIP_NO_CACHE_DIR=0
# We are using the minimal python installation from the system so include
# setuptools and also wheel so we can use the binary releases of packages
# instead of requiring them to be compiled.
RUN pip3 install setuptools wheel
RUN pip3 install setuptools
RUN pip3 install wheel
# Install CodeChecker and use it to statically analyze the code.
RUN pip3 install CodeChecker
# Install cvt2utf to check for non-UTF characters.
Expand All @@ -285,6 +281,7 @@ RUN pip3 install cvt2utf
RUN pip3 install cxxfilt
RUN pip3 install esptool
RUN pip3 install imgtool
RUN pip3 install kconfiglib
RUN pip3 install pexpect==4.8.0
RUN pip3 install pyelftools
RUN pip3 install pyserial==3.5
Expand All @@ -300,8 +297,6 @@ WORKDIR /tools
# Pull in the tools we just built for nuttx
COPY --from=nuttx-tools /tools/bloaty/ bloaty/
ENV PATH="/tools/bloaty/bin:$PATH"
COPY --from=nuttx-tools /tools/genromfs/ /tools/genromfs/
ENV PATH="/tools/genromfs/usr/bin:$PATH"
COPY --from=nuttx-tools /tools/kconfig-frontends/ kconfig-frontends/
ENV PATH="/tools/kconfig-frontends/bin:$PATH"

Expand Down