tools/ci: add zig, ldc and swift

The main objective is to determine if the examples really work or if they have been obsoleted.
The languages included in the list promote good interoperability with the NuttX API (C predominant).

This will show if they are worth integrating in NuttX.

**FFI method**

- Rust: bindgen or c2rust
- D: importC
- Swift: Bridging header or clang modulemap.
- Zig: `@cImport/@cInclude` or translate-c
This commit is contained in:
Matheus Catarino
2024-08-23 10:57:17 -03:00
committed by Xiang Xiao
parent 282cf2f7d0
commit 25bd3be167
3 changed files with 64 additions and 2 deletions
+40
View File
@@ -69,6 +69,34 @@ RUN mkdir -p $CARGO_HOME \
&& $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi \
&& $CARGO_HOME/bin/rustup target add riscv64gc-unknown-none-elf
# Install Swift
ENV SWIFT_VERSION=6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a
ENV SWIFT_HOME=/tools/swift
RUN mkdir -p ${SWIFT_HOME} \
&& curl -s -O -L https://download.swift.org/swift-6.0-branch/ubuntu2204/swift-${SWIFT_VERSION}/swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz \
&& tar xzf swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz -C ${SWIFT_HOME} \
&& rm swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz
# Install Zig latest release
ENV ZIG_VERSION=0.13.0
ENV ZIG_HOME=/tools/zig
RUN mkdir -p ${ZIG_HOME} \
&& curl -s -O -L https://github.com/marler8997/zigup/releases/download/v2024_05_05/zigup-x86_64-linux.tar.gz \
&& tar xzf zigup-x86_64-linux.tar.gz -C ${ZIG_HOME} \
&& rm zigup-x86_64-linux.tar.gz \
&& chmod +x ${ZIG_HOME}/zigup \
&& ${ZIG_HOME}/zigup fetch --install-dir ${ZIG_HOME} ${ZIG_VERSION} \
&& chmod +x ${ZIG_HOME}/${ZIG_VERSION}/files/zig
# Install LDC2 latest release
ENV LDC_VERSION=1.39.0
ENV D_HOME=/tools/ldc2
RUN mkdir -p ${D_HOME} \
&& curl -s -O -L https://github.com/ldc-developers/ldc/releases/download/v${LDC_VERSION}/ldc2-${LDC_VERSION}-linux-x86_64.tar.xz \
&& tar xf ldc2-${LDC_VERSION}-linux-x86_64.tar.xz -C ${D_HOME} \
&& rm ldc2-${LDC_VERSION}-linux-x86_64.tar.xz
RUN mkdir /tools/gn -p \
&& cd /tools/gn \
&& git clone https://gn.googlesource.com/gn gn \
@@ -383,6 +411,18 @@ ENV CARGO_HOME=/tools/rust/cargo
ENV RUSTUP_HOME=/tools/rust/rustup
ENV PATH="/tools/rust/cargo/bin:$PATH"
# Pull in the Zig v0.13.0 toolchain
COPY --from=nuttx-tools /tools/zig/ /tools/zig/
ENV PATH="/tools/zig/0.13.0/files:$PATH"
# Pull in the ldc2 1.39.0 toolchain
COPY --from=nuttx-tools /tools/ldc2/ /tools/ldc2/
ENV PATH="/tools/ldc2/ldc2-1.39.0-linux-x86_64/bin:$PATH"
# Pull in the swift 6.0 toolchain
COPY --from=nuttx-tools /tools/swift/ /tools/swift/
ENV PATH="/tools/swift/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a/bin:$PATH"
# ARM toolchain
COPY --from=nuttx-toolchain-arm /tools/clang-arm-none-eabi/ clang-arm-none-eabi/
# RUN cp /usr/bin/clang-extdef-mapping-10 clang-arm-none-eabi/bin/clang-extdef-mapping