Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(acap-build): Allow building apps without the ACAP Native SDK #134

Merged
merged 7 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
- name: Update generated files
run: devcontainer exec --workspace-folder . make --always-make check_generated_files check_generated_files_container
- name: Update generated without acap-build
run: devcontainer exec --remote-env ACAP_SDK_LOCATION=/opt/axis/ --workspace-folder . make check_generated_files_container
run: devcontainer exec --remote-env ACAP_BUILD_IMPL=equivalent --workspace-folder . make check_generated_files_container
- name: Run other checks
run: devcontainer exec --workspace-folder . make check_other
27 changes: 27 additions & 0 deletions .github/workflows/on-host-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,34 @@ jobs:
- name: Shell setup
# This step typically needs to be done once per shell session.
# To verify that the procedure has worked, some checks are run as well.
# TODO: Simplify shell session setup; exporting two variables seems excessive
run: |
export ACAP_SDK_LOCATION=$HOME/axis/
source ./init_env.sh
export ACAP_BUILD_IMPL=equivalent
make check_generated_files
debian_and_ubuntu_no_sdk:
runs-on: ubuntu-22.04
# If the sysroots from the ACAP Native SDK are not needed, then the Rust implementation of
# `acap-build` can be used for an easier setup:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu g++-arm-linux-gnueabihf
- name: Install Rust toolchain
run: rustup show
- name: Install Cargo package
run: |
cargo install --locked [email protected]
cargo install --locked --path crates/cargo-acap-build
- name: Build the app
run: |
make apps/hello_world/LICENSE
cargo-acap-build -- --package hello_world
env:
ACAP_BUILD_IMPL: equivalent
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_THUMBV7NEON_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
82 changes: 77 additions & 5 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ serde = "1.0.204"
serde_json = "1.0.120"
syslog = "6.1.1"
tar = "0.4.40"
tempdir = "0.3.7"
tempfile = "3.10.1"
thiserror = "1.0.61"
tokio = "1.38.1"
Expand Down
1 change: 1 addition & 0 deletions apps-aarch64.checksum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
e33b272e596e7ff1a8c45837ed60946f5498890c target-aarch64/acap/Challenge_Build_Tools_1_0_0_all.eap
12a30609c7fa463e1e8d0405665d2aa17d4349c4 target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap
6db963922ca2ceb25715bbdb6445b504c307d432 target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap
f99e344e5bf6fc4cd59715b9a4b784a83df27342 target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap
Expand Down
1 change: 1 addition & 0 deletions apps-aarch64.filesize
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
859 target-aarch64/acap/Challenge_Build_Tools_1_0_0_all.eap
3698 target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap
2213 target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap
2083 target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap
Expand Down
5 changes: 5 additions & 0 deletions apps/challenge_build_tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]
name = "challenge_build_tools"
version = "1.0.0-alpha+2024"
edition.workspace = true
publish = false
50 changes: 50 additions & 0 deletions apps/challenge_build_tools/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"schemaVersion": "1.7.0",
"acapPackageConf": {
"setup": {
"appName": "challenge_build_tools",
"appId": "0",
"architecture": "all",
"embeddedSdkVersion": "3.0",
"friendlyName": "Challenge Build Tools",
"user": {
"username": "sdk",
"group": "sdk"
},
"runMode": "never",
"runOptions": "my run options",
"vendor": "Axis Communications",
"vendorUrl": "https:www.axis.com",
"version": "1.0.0-alpha+2024"
},
"configuration": {
"settingPage": "index.html",
"httpConfig": [
{
"type": "fastCgi",
"name": "my-fast-cgi",
"access": "admin"
},
{
"type": "transferCgi",
"name": "my-transfer-cgi",
"access": "operator"
},
{
"type": "directory",
"access": "viewer"
}
],
"paramConfig": [
{
"name": "my-parameter",
"default": "yes",
"type": "bool:no,yes"
}
]
},
"copyProtection": {
"method": "none"
}
}
}
7 changes: 7 additions & 0 deletions apps/challenge_build_tools/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! An app designed to exercise many parts of the build tools, especially those not covered by
//! other apps to find differences between the build tool implementations.
//! It probably won't run since it is marked as architecture independent in the manifest.
//!
//! All applications require a program, but for this example it doesn't need to do anything,
//! hence the empty main function.
fn main() {}
6 changes: 6 additions & 0 deletions crates/acap-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ edition = "2021"

[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] }
dirs = { workspace = true }
env_logger = { workspace = true }
glob = { workspace = true }
log = { workspace = true }
semver = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = ["preserve_order"] }
tempfile = { workspace = true }
regex = { workspace = true }
tempdir = { workspace = true }
Loading