Skip to content

Commit 0dc7fa8

Browse files
btashtonxiaoxiang781216
authored andcommitted
CI: Add bloaty utility to the ci tools
Signed-off-by: Brennan Ashton <[email protected]>
1 parent 553748d commit 0dc7fa8

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

cibuild.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ EXTRA_PATH=
3636

3737
case $os in
3838
Darwin)
39-
install="python-tools u-boot-tools discoteq-flock elf-toolchain gen-romfs kconfig-frontends arm-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain avr-gcc-toolchain"
39+
install="python-tools u-boot-tools discoteq-flock elf-toolchain gen-romfs kconfig-frontends bloaty arm-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain avr-gcc-toolchain"
4040
mkdir -p ${prebuilt}/homebrew
4141
export HOMEBREW_CACHE=${prebuilt}/homebrew
4242
;;
4343
Linux)
44-
install="python-tools gen-romfs gperf kconfig-frontends arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain c-cache"
44+
install="python-tools gen-romfs gperf kconfig-frontends bloaty arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain c-cache"
4545
;;
4646
esac
4747

@@ -137,6 +137,19 @@ function kconfig-frontends {
137137
fi
138138
}
139139

140+
function bloaty {
141+
add_path $prebuilt/bloaty/bin
142+
if [ ! -f "$prebuilt/bloaty/bin/bloaty" ]; then
143+
git clone --depth 1 --branch v1.1 https://github.com/google/bloaty bloaty-src
144+
cd bloaty-src
145+
mkdir -p $prebuilt/bloaty
146+
cmake -DCMAKE_SYSTEM_PREFIX_PATH=$prebuilt/bloaty
147+
make install -j 6
148+
cd $prebuilt
149+
rm -rf bloaty-src
150+
fi
151+
}
152+
140153
function arm-gcc-toolchain {
141154
add_path $prebuilt/gcc-arm-none-eabi/bin
142155

docker/linux/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ RUN apt-get update -qq && apt-get install -y -qq \
2525
###############################################################################
2626
FROM builder-base AS nuttx-tools
2727

28-
RUN apt-get install -y -qq \
28+
RUN apt-get update -qq && apt-get install -y -qq \
2929
flex \
3030
bison \
3131
gperf \
3232
libncurses5-dev \
33-
make
33+
make \
34+
cmake \
35+
g++ \
36+
git
3437

3538
RUN mkdir /tools
3639
WORKDIR /tools
@@ -49,6 +52,12 @@ RUN cd nuttx-tools \
4952
&& cd genromfs \
5053
&& make install PREFIX=/tools/genromfs
5154

55+
RUN mkdir bloaty -p \
56+
&& git clone --depth 1 --branch v1.1 https://github.com/google/bloaty bloaty \
57+
&& cd bloaty \
58+
&& cmake -DCMAKE_SYSTEM_PREFIX_PATH=/tools/bloaty \
59+
&& make install
60+
5261
CMD [ "/bin/bash" ]
5362

5463
###############################################################################
@@ -96,7 +105,7 @@ RUN mkdir xtensa-esp32-elf-gcc && \
96105
curl -s -L "https://dl.espressif.com/dl/xtensa-esp32-elf-gcc8_2_0-esp32-2019r1-rc2-linux-amd64.tar.xz" \
97106
| tar -C xtensa-esp32-elf-gcc --strip-components 1 -xJ
98107

99-
RUN apt-get install -y -qq --no-install-recommends \
108+
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
100109
git bison gperf python python-pip python-setuptools make cmake ninja-build ccache libffi-dev libssl-dev libusb-1.0
101110
RUN git clone --depth 1 --shallow-submodules --recursive https://github.com/espressif/esp-idf.git
102111
# This is unfortunatly going to re-download some of the same toolchains, but will only be used in the context of esp-idf
@@ -174,6 +183,8 @@ COPY --from=nuttx-tools /tools/genromfs/ /tools/genromfs/
174183
ENV PATH="/tools/genromfs/usr/bin:$PATH"
175184
COPY --from=nuttx-tools /tools/kconfig-frontends/ kconfig-frontends/
176185
ENV PATH="/tools/kconfig-frontends/bin:$PATH"
186+
COPY --from=nuttx-tools /tools/bloaty/ bloaty/
187+
ENV PATH="/tools/bloaty/bin:$PATH"
177188

178189
# ARM toolchain
179190
COPY --from=nuttx-toolchain-arm /tools/gcc-arm-none-eabi/ gcc-arm-none-eabi/

0 commit comments

Comments
 (0)