Narigo/keepass-diff

Container build fails on Mac OS X (Apple Silicon) with `no such file or directory`

LenzGr opened this issue · 0 comments

After applying the fix suggested in #71 , the container build still fails on Mac OS X (Apple Silicon) with the following error:

podman build -f Containerfile.install -t "keepass-diff:custom-local" .
[1/2] STEP 1/9: FROM clux/muslrust:stable AS builder
[1/2] STEP 2/9: ENV RUSTFLAGS="-C target-cpu=native"
--> Using cache 2e35d51647f60c2d1b168cd81042444f94810383d6c9bca799c68b36a24040ee
--> 2e35d51647f6
[1/2] STEP 3/9: COPY --chown=root:root Cargo.* ./
--> 6e1cac7c8797
[1/2] STEP 4/9: RUN mkdir src/
--> 1f75469b0ead
[1/2] STEP 5/9: RUN echo 'fn main() {println!("dummy build for dependencies")}' > src/main.rs
--> 50e56880a5ff
[1/2] STEP 6/9: RUN cargo build --release
    Updating crates.io index
 Downloading crates ...
  Downloaded adler v1.0.2
  Downloaded block-modes v0.9.1
  Downloaded colorchoice v1.0.0
  Downloaded base64 v0.21.5
  Downloaded secstr v0.5.1
  Downloaded clap_lex v0.6.0
  Downloaded autocfg v1.1.0
  Downloaded block-buffer v0.10.4
  Downloaded anstream v0.6.4
  Downloaded arrayref v0.3.7
  Downloaded anstyle v1.0.4
  Downloaded cfg-if v1.0.0
  Downloaded constant_time_eq v0.3.0
  Downloaded chacha20 v0.9.1
  Downloaded anstyle-query v1.0.0
  Downloaded cipher v0.4.4
  Downloaded cbc v0.1.2
  Downloaded block-padding v0.3.3
  Downloaded salsa20 v0.10.2
  Downloaded inout v0.1.3
  Downloaded errno v0.3.5
  Downloaded subtle v2.5.0
  Downloaded heck v0.4.1
  Downloaded zeroize v1.6.0
  Downloaded crypto-common v0.1.6
  Downloaded rpassword v7.2.0
  Downloaded strsim v0.10.0
  Downloaded hex-literal v0.4.1
  Downloaded rtoolbox v0.0.1
  Downloaded generic-array v0.14.7
  Downloaded terminal_size v0.3.0
  Downloaded digest v0.10.7
  Downloaded version_check v0.9.4
  Downloaded thiserror-impl v1.0.50
  Downloaded thiserror v1.0.50
  Downloaded zeroize_derive v1.4.2
  Downloaded utf8parse v0.2.1
  Downloaded cpufeatures v0.2.11
  Downloaded twofish v0.7.1
  Downloaded termcolor v1.3.0
  Downloaded iana-time-zone v0.1.58
  Downloaded bitflags v2.4.1
  Downloaded byteorder v1.5.0
  Downloaded anstyle-parse v0.2.2
  Downloaded blake2b_simd v1.0.2
  Downloaded arrayvec v0.7.4
  Downloaded clap_derive v4.4.7
  Downloaded getrandom v0.2.10
  Downloaded quote v1.0.33
  Downloaded sha2 v0.10.8
  Downloaded rust-argon2 v2.0.0
  Downloaded miniz_oxide v0.7.1
  Downloaded typenum v1.17.0
  Downloaded unicode-ident v1.0.12
  Downloaded hmac v0.12.1
  Downloaded crc32fast v1.3.2
  Downloaded proc-macro2 v1.0.69
  Downloaded xml-rs v0.8.19
  Downloaded keepass v0.6.6
  Downloaded num-traits v0.2.17
  Downloaded clap v4.4.7
  Downloaded uuid v1.5.0
  Downloaded flate2 v1.0.28
  Downloaded serde v1.0.190
  Downloaded aes v0.8.3
  Downloaded clap_builder v4.4.7
  Downloaded chrono v0.4.31
  Downloaded syn v2.0.38
  Downloaded rustix v0.38.21
  Downloaded libc v0.2.150
  Downloaded linux-raw-sys v0.4.10
   Compiling version_check v0.9.4
   Compiling typenum v1.17.0
   Compiling generic-array v0.14.7
   Compiling proc-macro2 v1.0.69
   Compiling libc v0.2.150
   Compiling unicode-ident v1.0.12
   Compiling crypto-common v0.1.6
   Compiling block-padding v0.3.3
   Compiling quote v1.0.33
   Compiling cfg-if v1.0.0
   Compiling syn v2.0.38
   Compiling inout v0.1.3
   Compiling cipher v0.4.4
   Compiling serde v1.0.190
   Compiling autocfg v1.1.0
   Compiling rustix v0.38.21
   Compiling num-traits v0.2.17
   Compiling block-buffer v0.10.4
   Compiling bitflags v2.4.1
   Compiling crc32fast v1.3.2
   Compiling subtle v2.5.0
   Compiling utf8parse v0.2.1
   Compiling linux-raw-sys v0.4.10
   Compiling anstyle-parse v0.2.2
   Compiling digest v0.10.7
   Compiling cpufeatures v0.2.11
   Compiling constant_time_eq v0.3.0
   Compiling colorchoice v1.0.0
   Compiling anstyle-query v1.0.0
   Compiling arrayvec v0.7.4
   Compiling thiserror v1.0.50
   Compiling anstyle v1.0.4
   Compiling arrayref v0.3.7
   Compiling adler v1.0.2
   Compiling blake2b_simd v1.0.2
   Compiling miniz_oxide v0.7.1
   Compiling anstream v0.6.4
   Compiling thiserror-impl v1.0.50
   Compiling zeroize_derive v1.4.2
   Compiling terminal_size v0.3.0
   Compiling getrandom v0.2.10
   Compiling heck v0.4.1
   Compiling iana-time-zone v0.1.58
   Compiling clap_lex v0.6.0
   Compiling base64 v0.21.5
   Compiling strsim v0.10.0
   Compiling rust-argon2 v2.0.0
   Compiling clap_builder v4.4.7
   Compiling clap_derive v4.4.7
   Compiling chrono v0.4.31
   Compiling uuid v1.5.0
   Compiling flate2 v1.0.28
   Compiling zeroize v1.6.0
   Compiling aes v0.8.3
   Compiling sha2 v0.10.8
   Compiling hmac v0.12.1
   Compiling cbc v0.1.2
   Compiling salsa20 v0.10.2
   Compiling twofish v0.7.1
   Compiling chacha20 v0.9.1
   Compiling secstr v0.5.1
   Compiling rtoolbox v0.0.1
   Compiling block-modes v0.9.1
   Compiling xml-rs v0.8.19
   Compiling hex-literal v0.4.1
   Compiling byteorder v1.5.0
   Compiling keepass v0.6.6
   Compiling rpassword v7.2.0
   Compiling clap v4.4.7
   Compiling termcolor v1.3.0
   Compiling keepass-diff v1.2.0 (/volume)
    Finished release [optimized] target(s) in 20.44s
--> 94e4cda540b5
[1/2] STEP 7/9: RUN rm -f target/x86_64-unknown-linux-musl/release/deps/keepass_diff-*
--> de7d31bb5e9f
[1/2] STEP 8/9: COPY --chown=root:root src ./src
--> 05c28ccf3ded
[1/2] STEP 9/9: RUN cargo build --release
    Finished release [optimized] target(s) in 0.02s
--> 6f81d7497ce3
[2/2] STEP 1/4: FROM scratch
[2/2] STEP 2/4: WORKDIR /app
--> 1500892d69d9
[2/2] STEP 3/4: COPY --from=builder /volume/target/x86_64-unknown-linux-musl/release/keepass-diff /usr/local/bin/
Error: building at STEP "COPY --from=builder /volume/target/x86_64-unknown-linux-musl/release/keepass-diff /usr/local/bin/": checking on sources under "/var/lib/containers/storage/overlay/6487b91e0c90ffbb35c96927a4a0ab9190d6f05d2c8b9a6b1d3cbccc5775227e/merged": copier: stat: "/volume/target/x86_64-unknown-linux-musl/release/keepass-diff": no such file or directory

This is due to the hardcoded architecture names in Containerfile.install. I was able to work around this issue by changing the file per the attached diff. Instead of using a wildcard, it might be possible to determine the architecture and replace that part of the path accordingly.

Containerfile.install.patch