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
RUN apt-get update -y && apt-get install -y \
# Install dependencies
RUN apt-get update -y && apt-get install -y --no-install-recommends \
git \
wget \
sudo \
@ -17,6 +17,21 @@ RUN apt-get update -y && apt-get install -y \
libelf-dev \
perl \
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/*
# compile miosix compiler
@ -25,31 +40,35 @@ RUN git clone --depth 1 https://github.com/fedetft/miosix-kernel.git \
&& sh download.sh \
&& 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
FROM ubuntu:24.04
# Install opengd77 sources and put the firmware loader and tools in PATH
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
COPY --from=build /opt /opt
# Install Python 3.11 using the deadsnakes PPA
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
RUN ln -s /opt/arm-miosix-eabi/bin/* /bin/
# Create and activate virtual environment
ENV VIRTUAL_ENV=/opt/venv
RUN python3.11 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# dependencies for the project
RUN apt-get update -y && apt-get install -y \
git \
pkg-config \
build-essential \
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 '*'
# Copy requirements.txt and install dependencies
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -U pip && \
pip install --no-cache-dir -r requirements.txt

View File

@ -1,5 +1,19 @@
{
"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
ffmpeg
cairosvg>=2.7.1
numpy>=1.25.2
numpy>=1.25.2
intelhex==2.3.0
urllib3