Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into add_metadata_broker…
Browse files Browse the repository at this point in the history
…_wrapper_and_exampl

* upstream/main:
  Rename environment variables controlling the Makefile (#26)
  Adopt dev container as primary environment (#39)
  Make the `build` verb build for only one target (#31)
  chore(deps): bump ghcr.io/devcontainers/features/common-utils (#38)
  chore(deps): bump log from 0.4.21 to 0.4.22 in the default group (#37)
  Add dev container (#36)
  Add link to acap-rs-app-template in `README.md` (#34)
  Document `python3-venv` dependency (#35)
  fix: Repair `Makefile` (#32)
  fix(embedded_web_page): Put web page in `html/` (#30)
  Organize dependencies consistently (#29)
  chore(deps): bump glib-sys from 0.19.5 to 0.19.8 in the default group (#28)
  chore: Explain more make targets (#27)
  Add embedded web page example (#14)
  chore: Group and sort imports (#23)
  Demonstrate containerized builds (#17)
  Factor out `app_logging` modules to lib crate (#24)
  • Loading branch information
apljungquist committed Jul 5, 2024
2 parents 9050cbd + 64970ae commit 09d9407
Show file tree
Hide file tree
Showing 26 changed files with 381 additions and 114 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "2.4.4",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:85c6505e809cc7c400b21997d7ae6f50811720d591813243f14d98cf2c577041",
"integrity": "sha256:85c6505e809cc7c400b21997d7ae6f50811720d591813243f14d98cf2c577041"
}
}
}
14 changes: 14 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "acap-rs",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
},
"remoteUser": "${localEnv:USER}",
"containerEnv": {
"CARGO_HOME": "/home/${localEnv:USER}/.cargo"
}
}
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!/docker/
!/rust-toolchain.toml
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ updates:
- "minor"
- "patch"
versioning-strategy: lockfile-only
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: "weekly"
15 changes: 11 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
- name: Install dev container dependencies
run: npm install -g @devcontainers/[email protected]
- name: Run checks in dev container
run: |
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . make --always-make check_all
devcontainer exec --workspace-folder . make build AXIS_PACKAGE=licensekey_handler
devcontainer exec --workspace-folder . make build AXIS_PACKAGE=embedded_web_page
- name: Install host dependencies
run: cargo install cross
- name: Run checks
- name: Run checks on host
run: |
make --always-make check_all
PACKAGE=licensekey_handler make build
make check_all
27 changes: 19 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ pkg-config = "0.3.30"
syslog = "6.1.1"
thiserror = "1.0.57"

app-logging = { path = "crates/app-logging" }
licensekey = { path = "crates/licensekey" }
licensekey-sys = { path = "crates/licensekey-sys" }
mdb = { path = "crates/mdb" }
mdb-sys = { path = "crates/mdb-sys" }

Expand Down
60 changes: 60 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
ARG REPO=axisecp
ARG SDK=acap-native-sdk
ARG UBUNTU_VERSION=22.04
ARG VERSION=1.14
ARG BASE_IMAGE=debian:bookworm-20240423

FROM ${REPO}/${SDK}:${VERSION}-aarch64-ubuntu${UBUNTU_VERSION} AS sdk-aarch64
FROM ${REPO}/${SDK}:${VERSION}-armv7hf-ubuntu${UBUNTU_VERSION} AS sdk-armv7hf
FROM ${BASE_IMAGE}

COPY --from=sdk-aarch64 /opt/axis/acapsdk/axis-acap-manifest-tools /opt/axis/acapsdk/axis-acap-manifest-tools
COPY --from=sdk-aarch64 /opt/axis/acapsdk/environment-setup-cortexa53-crypto-poky-linux /opt/axis/acapsdk/environment-setup-cortexa53-crypto-poky-linux
COPY --from=sdk-armv7hf /opt/axis/acapsdk/environment-setup-cortexa9hf-neon-poky-linux-gnueabi /opt/axis/acapsdk/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
COPY --from=sdk-aarch64 /opt/axis/acapsdk/sysroots/aarch64 /opt/axis/acapsdk/sysroots/aarch64
COPY --from=sdk-armv7hf /opt/axis/acapsdk/sysroots/armv7hf /opt/axis/acapsdk/sysroots/armv7hf
COPY --from=sdk-aarch64 /opt/axis/acapsdk/sysroots/x86_64-pokysdk-linux /opt/axis/acapsdk/sysroots/x86_64-pokysdk-linux

RUN apt-get update \
&& apt-get install -y \
build-essential \
clang \
g++-aarch64-linux-gnu \
g++-arm-linux-gnueabihf \
libglib2.0-dev \
pkg-config \
iputils-ping \
python3-jsonschema \
wget \
&& rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

COPY docker/install_rust.sh rust-toolchain.toml ./
RUN ./install_rust.sh \
&& rustup target add \
aarch64-unknown-linux-gnu \
thumbv7neon-unknown-linux-gnueabihf \
&& rm install_rust.sh rust-toolchain.toml

ENV \
SYSROOT_AARCH64=/opt/axis/acapsdk/sysroots/aarch64 \
SYSROOT_ARMV7HF=/opt/axis/acapsdk/sysroots/armv7hf
# The above makes the below easier to read
ENV \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="aarch64-linux-gnu-gcc" \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-args=--sysroot=${SYSROOT_AARCH64}" \
CC_aarch64_axis_linux_gnu="aarch64-linux-gnu-gcc" \
CXX_aarch64_axis_linux_gnu="aarch64-linux-gnu-g++" \
PKG_CONFIG_LIBDIR_aarch64_unknown_linux_gnu="${SYSROOT_AARCH64}/usr/lib/pkgconfig:${SYSROOT_AARCH64}/usr/share/pkgconfig" \
PKG_CONFIG_PATH_aarch64_unknown_linux_gnu="${SYSROOT_AARCH64}/usr/lib/pkgconfig:${SYSROOT_AARCH64}/usr/share/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu="${SYSROOT_AARCH64}" \
CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_GNUEABIHF_LINKER="arm-linux-gnueabihf-gcc" \
CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS="-C link-args=--sysroot=${SYSROOT_ARMV7HF}" \
CC_thumbv7neon_unknown_linux_gnueabihf="arm-linux-gnueabihf-gcc" \
CXX_thumbv7neon_unknown_linux_gnueabihf="arm-linux-gnueabihf-g++" \
PKG_CONFIG_LIBDIR_thumbv7neon_unknown_linux_gnueabihf="${SYSROOT_ARMV7HF}/usr/lib/pkgconfig:${SYSROOT_ARMV7HF}/usr/share/pkgconfig" \
PKG_CONFIG_PATH_thumbv7neon_unknown_linux_gnueabihf="${SYSROOT_ARMV7HF}/usr/lib/pkgconfig:${SYSROOT_ARMV7HF}/usr/share/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR_thumbv7neon_unknown_linux_gnueabihf="${SYSROOT_ARMV7HF}"
Loading

0 comments on commit 09d9407

Please sign in to comment.