trunnion / cargo-acap

A tool to build Rust programs for the AXIS Camera Application Platform
Apache License 2.0
10 stars 5 forks source link

Build fixes and a small refactor #4

Closed karlri closed 2 years ago

karlri commented 2 years ago

Really awesome tool, thank you! Now it works in proxy environment and with async-std. I also refactored one file with unsafe code that was correct but now that MaybeUninit landed it's perhaps more appropriate to use that. The refactor enforces the C lifetime contracts rather than addressing them in comments.

karlri commented 2 years ago

I suppose it's strange to look only at http_proxy, I guess https_proxy might differ.

karlri commented 2 years ago

I guess my changes would require publishing a new docker image, I don't know how but I built one locally. I tested with:

docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy .
docker tag 696bb277c02a karlattempt2:1.61.0

Then I tested that I do get the errors without that special image:

cargo acap build # expected errors
[... snip ...]
error[E0432]: unresolved imports `core::sync::atomic::AtomicI64`, `core::sync::atomic::AtomicU64`
  --> /.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.10/src/lib.rs:79:49
   |
79 |             pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64};
   |                                                 ^^^^^^^^^  ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
   |                                                 |
   |                                                 no `AtomicI64` in `sync::atomic`

Then I tested that the errors go away with my image:

➜  your-app git:(master) ✗ cargo acap --docker-image=karlattempt2 build
cargo-acap: using Docker image karlattempt2:1.61.0
cargo-acap: building target aarch64
    Finished release [optimized] target(s) in 0.02s
cargo-acap: building target armv5tej
    Finished release [optimized] target(s) in 0.03s
cargo-acap: building target armv6
    Finished release [optimized] target(s) in 0.04s
cargo-acap: building target armv7
    Finished release [optimized] target(s) in 0.03s
cargo-acap: building target armv7hf
    Finished release [optimized] target(s) in 0.03s
cargo-acap: building target mips
    Finished release [optimized] target(s) in 0.02s
willglynn commented 2 years ago

Now, how best to rebuild existing image tags…

willglynn commented 2 years ago

Oh, that was straightforward. I manually invoked the relevant GitHub action for 1.62.0, 1.61.0, and 1.60.0, which should (🤞) result in new builds from the updated Dockerfile getting pushed to the corresponding tags.

cargo-acap invokes docker run and not docker run --pull, so you may have to docker pull trunnion/cargo-acap:1.62.0 to pull the updated image with that tag once that lands at the registry.