devtools: update devcontainer to reliably execute on amd64 env

This change makes it so that the devcontainer in this project is able to
build and wrap all supported platforms. There is a pre-existing issue on
arm64 devices preventing the openrtx_gd77_wrap and openrtx_dm1801_wrap
targets from working, which is being tracked in
https://github.com/OpenRTX/OpenRTX/issues/344.

Co-authored-by: Peter Buchegger <peter@pbuchegger.at>
This commit is contained in:
Ryan Turner 2025-09-07 13:54:42 -05:00 committed by Silvano Seva
parent 12dc81aef2
commit 26b15d46f3
4 changed files with 69 additions and 30 deletions

View File

@ -1,7 +1,7 @@
FROM ubuntu:24.04 AS build FROM ubuntu:24.04
# dependencies for miosix compiler # Install dependencies
RUN apt-get update -y && apt-get install -y \ RUN apt-get update -y && apt-get install -y --no-install-recommends \
git \ git \
wget \ wget \
sudo \ sudo \
@ -17,6 +17,21 @@ RUN apt-get update -y && apt-get install -y \
libelf-dev \ libelf-dev \
perl \ perl \
libexpat1-dev \ libexpat1-dev \
ca-certificates \
pkg-config \
meson \
cmake \
libstdc++6 \
libusb-1.0-0 \
libusb-1.0-0-dev \
dfu-util \
libsdl2-dev \
libcodec2-dev \
libreadline-dev \
gcc \
g++ \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# compile miosix compiler # compile miosix compiler
@ -25,31 +40,35 @@ RUN git clone --depth 1 https://github.com/fedetft/miosix-kernel.git \
&& sh download.sh \ && sh download.sh \
&& bash install-script.sh -j`nproc` && bash install-script.sh -j`nproc`
# Build radio_tool from source (since the deb package doesnt support all architectures)
RUN git clone https://github.com/v0l/radio_tool \
&& cd radio_tool \
&& git checkout tags/v0.3.0 \
&& mkdir build && cd build \
&& cmake .. \
&& make -j4 \
&& make install
ENV PATH="$PATH:/usr/local/bin"
# 2th stage build # Install opengd77 sources and put the firmware loader and tools in PATH
FROM ubuntu:24.04 RUN git clone https://github.com/open-ham/OpenGD77.git /tmp/OpenGD77
ENV PATH="$PATH:/tmp/OpenGD77/tools/Python/FirmwareLoader:/tmp/OpenGD77/firmware/tools"
# copy arm-miosix-eabi compiler from build stage # Install Python 3.11 using the deadsnakes PPA
COPY --from=build /opt /opt RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y python3.11 python3.11-venv python3.11-dev \
&& rm -rf /var/lib/apt/lists/*
# create symbolic links to compiler # Create and activate virtual environment
RUN ln -s /opt/arm-miosix-eabi/bin/* /bin/ ENV VIRTUAL_ENV=/opt/venv
RUN python3.11 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# dependencies for the project # Copy requirements.txt and install dependencies
RUN apt-get update -y && apt-get install -y \ WORKDIR /app
git \ COPY requirements.txt .
pkg-config \ RUN pip install --no-cache-dir -U pip && \
build-essential \ pip install --no-cache-dir -r requirements.txt
meson \
libsdl2-dev \
libreadline-dev \
dfu-util \
cmake \
libusb-1.0-0 \
libusb-1.0-0-dev \
codec2 \
libcodec2-dev \
&& rm -rf /var/lib/apt/lists/*
# fix error from git with different users
RUN git config --system --add safe.directory '*'

View File

@ -1,5 +1,19 @@
{ {
"build": { "build": {
"dockerfile": "Dockerfile" "dockerfile": "Dockerfile",
} "context": "..",
"args": {
"BUILDKIT_STEP_LOG_MAX_SIZE": "10485760" // 10 MiB
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"mesonbuild.mesonbuild",
"ms-python.python"
]
}
},
"postCreateCommand": "meson setup --cross-file cross_arm.txt build_arm && meson setup --cross-file cross_cm7.txt build_cm7 && meson setup build_linux"
} }

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"C_Cpp.default.compileCommands": "/workspaces/OpenRTX/build_arm/compile_commands.json",
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild"
}

View File

@ -3,4 +3,6 @@ pyusb>=1.2.1
meson>=1.2.0 meson>=1.2.0
ffmpeg ffmpeg
cairosvg>=2.7.1 cairosvg>=2.7.1
numpy>=1.25.2 numpy>=1.25.2
intelhex==2.3.0
urllib3