-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add acap-ssh-utils bin and lib crate (#19)
This is primarily intended as a building block for a more tightly integrated development tool, where it will come in handy for implementing analogs of `cargo run` and `cargo test`, both of which will cross-compile a binary and execute it on target. But, since it solves a common problem among ACAP developers using any language, it is factored out into its own lib crate with a thin binary crate wrapper. The crate is focused around the package as a unit that is patched and run. Since every ACAP developer have systems set up to produce `.eap` files I expect this to be an accessible interface. An earlier version allowed individual files to be replaced. This was driven by working with build systems, including my own, that did not package tests as `.eap` files or were slow to produce `.eap` files. I now think that these issues are better addressed in the build system since the action of creating the tar archive should in theory be cheap. In `install-system-packages.sh`: - Add `sshpass` because it is needed by `acap-ssh-utils` which in turn needs it because I have not found a way to add authorized keys for users other than root. In `.gitignore`: - Add `/.env` because defining the `AXIS_DEVICE_*` variables in a file makes it reduces the friction of rebuilding the dev container and to run tests. In `Makefile`: - Export the `AXIS_*` variables to make sure they are available for scripts when the default values are used. This is particularly useful for the password argument since it allows programs such as `acap-ssh-utils` to pick this up from the environment, which is better from a security perspective (that tool still passes it as an argument to other commands though). - Always set `RUST_LOG` and `RUST_LOG_STYLE` when running on target because I found that most of the time this is what I wanted and oftentimes I did not want to set it for `cargo-acap-build` and `acap-ssh-utils` at the same time.
- Loading branch information
1 parent
9b0350d
commit 4400657
Showing
15 changed files
with
775 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ apt-get install \ | |
iputils-ping \ | ||
libglib2.0-dev \ | ||
pkg-config \ | ||
python3-venv | ||
python3-venv \ | ||
sshpass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ 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 | ||
# Install packages from this project into venv | ||
cargo install --root ${VIRTUAL_ENV} --target-dir /tmp/target --path ../crates/acap-ssh-utils | ||
cargo install --root ${VIRTUAL_ENV} --target-dir /tmp/target --path ../crates/cargo-acap-build | ||
|
||
rm -r /tmp/target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
* | ||
!/.devhost/ | ||
!/crates/acap-ssh-utils | ||
!/crates/cargo-acap-build | ||
!/rust-toolchain.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.env | ||
/.idea/ | ||
/init_env.sh | ||
/target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "inspect_env" | ||
version = "1.0.0" | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
log = { workspace = true } | ||
|
||
acap-logging = { workspace = true } |
Oops, something went wrong.