From 5e50b8a25dde18a518e61482d4875cfc28a494cf Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Wed, 14 Feb 2024 00:51:31 +0900 Subject: [PATCH] =?UTF-8?q?arm64=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 14 ++++++++++++-- src/args.rs | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2976b95..146e06d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,8 @@ RUN set -x && \ libcap-dev \ lld \ musl-dev &&\ - cargo build --release && \ - ldd target/release/setcap-static + cargo build --release +# ldd target/release/setcap-static # RUN --mount=type=bind,rw,source=.,target=/host \ # cp -avf target/release/setcap-static /host/setcap-static @@ -27,3 +27,13 @@ RUN set -x && \ FROM scratch COPY --from=build /app/target/release/setcap-static /setcap-static + +# buildah push e5bcd588c41f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-amd64 +# podman push e051029260e7 harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-arm64 +# podman manifest create \ +# harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2 \ +# harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-amd64 \ +# harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2-arm64 +# podman push 88cf0c74f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0.2 +# podman push 88cf0c74f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:0.0-latest +# podman push 88cf0c74f harbor.repository.lb.home.dc.internal.amuz.es/infrastructure/setcap-static:latest \ No newline at end of file diff --git a/src/args.rs b/src/args.rs index 0611624..3938051 100644 --- a/src/args.rs +++ b/src/args.rs @@ -118,7 +118,7 @@ impl<'a> Iterator for IntoIter<'a> { /// ///It is UB to pass non-C string as it requires \0 unsafe fn c_str_to_rust(ptr: *const u8) -> Result<&'static str, core::str::Utf8Error> { - let len = libc::strlen(ptr as *const i8); + let len = libc::strlen(ptr as *const c_char); let parts = core::slice::from_raw_parts(ptr, len); core::str::from_utf8(parts) } @@ -127,7 +127,7 @@ unsafe fn c_str_to_rust(ptr: *const u8) -> Result<&'static str, core::str::Utf8E /// ///It is UB to pass non-C string as it requires \0 unsafe fn c_str_to_rust_unchecked(ptr: *const u8) -> &'static str { - let len = libc::strlen(ptr as *const i8); + let len = libc::strlen(ptr as *const c_char); let parts = core::slice::from_raw_parts(ptr, len); core::str::from_utf8_unchecked(parts) }