Skip to content

Commit

Permalink
Add cargo-acap-build
Browse files Browse the repository at this point in the history
  • Loading branch information
apljungquist committed Jul 14, 2024
1 parent 4d21da1 commit f59272f
Show file tree
Hide file tree
Showing 24 changed files with 1,214 additions and 75 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ RUN rustup show \
ENV PATH=/usr/local/venv/bin:$PATH \
VIRTUAL_ENV=/usr/local/venv

RUN --mount=type=bind,target=/.devhost,source=.devhost \
cd /.devhost \
RUN --mount=type=bind,target=/context \
cd /context/.devhost \
&& ./install-venv.sh $VIRTUAL_ENV \
&& chmod a+w -R $VIRTUAL_ENV

Expand All @@ -66,3 +66,7 @@ RUN --mount=type=bind,target=/.devhost,source=.devhost \
# TODO: Replace the example in the README with something that does not mount any volumes.
RUN mkdir /.cargo \
&& chmod a+w /.cargo/

# `install-venv.sh` install a rust package which creates the cargo registry directory as root.
# TODO: Improve this because it is slow (200 seconds).
RUN chmod a+w -R $CARGO_HOME $RUSTUP_HOME
5 changes: 5 additions & 0 deletions .devhost/install-venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ rm /tmp/node-v18.16.1-linux-x64.tar.gz
# Install `devcontainer` into venv
npm install -g @devcontainers/[email protected]

# Install `cargo-acap-build` into venv
cargo install --root ${VIRTUAL_ENV} --target-dir /tmp/target --path ../crates/cargo-acap-build

rm -r /tmp/target

# Create `init_env.sh` in a location where it can be sourced conveniently.
if [ ! -z "${INIT_ENV}" ];
then
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*
!/.devhost/
!/crates/cargo-acap-build
!/rust-toolchain.toml
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
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
devcontainer exec --workspace-folder . make build AXIS_PACKAGE=using_a_build_script
Loading

0 comments on commit f59272f

Please sign in to comment.