Skip to content

Commit

Permalink
Merge pull request #25 from shishir-dey/ci/set-up-github-codespaces-a…
Browse files Browse the repository at this point in the history
…nd-docker

Manually extract and link the binaries
  • Loading branch information
shishir-dey authored Nov 30, 2024
2 parents 3e05006 + e761a35 commit f85c40c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Use a lightweight base image
FROM ubuntu:20.04

# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive

# Update and install required packages
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
Expand All @@ -15,16 +13,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install xpack ARM GCC toolchain
# Install xpack ARM GCC toolchain globally
RUN npm install --global @xpack-dev-tools/arm-none-eabi-gcc

# Debug: List npm global directories and check installation
RUN npm list -g @xpack-dev-tools/arm-none-eabi-gcc

# Find and symlink the ARM GCC binaries
RUN GCC_PATH=$(find /root/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc -name "bin" -type d | head -n 1) && \
if [ -z "$GCC_PATH" ]; then echo "ARM GCC toolchain not found"; exit 1; fi && \
ln -s $GCC_PATH/* /usr/local/bin/
# Manually extract and link the binaries
RUN PACKAGE_DIR=$(npm list -g @xpack-dev-tools/arm-none-eabi-gcc | grep -oP '(?<=\/)@xpack-dev-tools\/arm-none-eabi-gcc@[^\s]+') && \
if [ -z "$PACKAGE_DIR" ]; then echo "Package not found"; exit 1; fi && \
FULL_PATH="/usr/local/lib/node_modules/$PACKAGE_DIR" && \
mkdir -p /opt/arm-gcc && \
cp -r $FULL_PATH/* /opt/arm-gcc/ && \
ln -s /opt/arm-gcc/bin/* /usr/local/bin/

# Verify installation
RUN arm-none-eabi-gcc --version
Expand Down

0 comments on commit f85c40c

Please sign in to comment.