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

kn - static binary build issue with openssl #3

Open
gaganyaan2 opened this issue Oct 29, 2022 · 12 comments
Open

kn - static binary build issue with openssl #3

gaganyaan2 opened this issue Oct 29, 2022 · 12 comments
Assignees

Comments

@gaganyaan2
Copy link
Owner

After installing libssl-dev on ubuntu and openssl-devel on fedora still the same issue.

error details - #2 (comment)

Able to build using custom docker image from https://github.com/koolwithk/rust-musl-builder (fork from https://github.com/emk/rust-musl-builder ) and after tha kn build was successful.

docker run  -it -v "$(pwd)":/home/rust/src koolwithk/rust-musl:1.64.0  cargo build --target=x86_64-unknown-linux-musl  --release

Currently working on arm64 build of https://github.com/koolwithk/rust-musl-builder with aarch64

sudo docker  buildx build --push --platform linux/arm64  -t koolwithk/rust-musl:1.64.0-arm64 .
----more logs
 => ERROR [11/14] RUN env CARGO_HOME=/opt/rust/cargo cargo install -f cargo-deb &&     rm -rf /opt/rust/cargo/registry/                    238.8s
----more logs
#16 230.2    Compiling memchr v2.5.0
#16 230.3    Compiling rayon-core v1.9.3
#16 231.3 error[E0463]: can't find crate for `core`
#16 231.3   |
#16 231.3   = note: the `x86_64-unknown-linux-musl` target may not be installed
#16 231.3   = help: consider downloading the target with `rustup target add x86_64-unknown-linux-musl`
#16 231.3 
#16 231.3 error[E0463]: can't find crate for `compiler_builtins`
#16 231.3 
#16 231.5 For more information about this error, try `rustc --explain E0463`.
#16 231.5 error: could not compile `cfg-if` due to 2 previous errors
#16 231.5 warning: build failed, waiting for other jobs to finish...
#16 238.2 error: failed to compile `cargo-deb v1.40.5`, intermediate artifacts can be found at `/tmp/cargo-installfYsjZr`
------
error: failed to solve: executor failed running [/bin/sh -c env CARGO_HOME=/opt/rust/cargo cargo install -f cargo-deb &&     rm -rf /opt/rust/cargo/registry/]: exit code: 101
@gaganyaan2
Copy link
Owner Author

Even on raspberrypi could not build rust-musl-builder docker image. Not sure why it's looking for x86_64-unknown-linux-musl

  Downloaded cargo_toml v0.13.0
   Compiling libc v0.2.137
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.47
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-unknown-linux-musl` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-unknown-linux-musl`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-deb v1.40.5`, intermediate artifacts can be found at `/tmp/cargo-installEMaQgR`
The command '/bin/sh -c env CARGO_HOME=/opt/rust/cargo cargo install -f cargo-deb &&     rm -rf /opt/rust/cargo/registry/' returned a non-zero code: 101

Here is Dockerfile:

# Use Ubuntu 18.04 LTS as our base image.
FROM --platform=${TARGETPLATFORM:-linux/arm64} ubuntu:18.04

# The Rust toolchain to use when building our image.  Set by `hooks/build`.
ARG TOOLCHAIN=stable

# The OpenSSL version to use. Here is the place to check for new releases:
#
# - https://www.openssl.org/source/
#
# ALSO UPDATE hooks/build!
ARG OPENSSL_VERSION=1.1.1m

# Versions for other dependencies. Here are the places to check for new
# releases:
#
# - https://github.com/rust-lang/mdBook/releases
# - https://github.com/dylanowen/mdbook-graphviz/releases
# - https://github.com/EmbarkStudios/cargo-about/releases
# - https://github.com/rustsec/rustsec/releases
# - https://github.com/EmbarkStudios/cargo-deny/releases
# - http://zlib.net/
# - https://ftp.postgresql.org/pub/source/
#
# We're stuck on PostgreSQL 11 until we figure out
# https://github.com/emk/rust-musl-builder/issues.
ARG MDBOOK_VERSION=0.4.14
ARG MDBOOK_GRAPHVIZ_VERSION=0.1.3
ARG CARGO_ABOUT_VERSION=0.4.4
ARG CARGO_AUDIT_VERSION=0.16.0
ARG CARGO_DENY_VERSION=0.11.0
ARG ZLIB_VERSION=1.2.13
ARG POSTGRESQL_VERSION=11.14

# Make sure we have basic dev tools for building C libraries.  Our goal here is
# to support the musl-libc builds and Cargo builds needed for a large selection
# of the most popular crates.
#
# We also set up a `rust` user by default. This user has sudo privileges if you
# need to install any more software.
RUN apt-get update && \
    export DEBIAN_FRONTEND=noninteractive && \
    apt-get install -yq \
        build-essential \
        cmake \
        curl \
        file \
        git \
        graphviz \
        musl-dev \
        musl-tools \
        libpq-dev \
        libsqlite-dev \
        libssl-dev \
        linux-libc-dev \
        pkgconf \
        sudo \
        unzip \
        xutils-dev \
        && \
    apt-get clean && rm -rf /var/lib/apt/lists/* && \
    useradd rust --user-group --create-home --shell /bin/bash --groups sudo

# - `mdbook` is the standard Rust tool for making searchable HTML manuals.
# - `mdbook-graphviz` allows using inline GraphViz drawing commands to add illustrations.
# - `cargo-about` generates a giant license file for all dependencies.
# - `cargo-audit` checks for security vulnerabilities. We include it for backwards compat.
# - `cargo-deny` does everything `cargo-audit` does, plus check licenses & many other things.
# RUN curl -fLO https://github.com/rust-lang-nursery/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-aarch64-unknown-linux-gnu.tar.gz && \
#     tar xf mdbook-v$MDBOOK_VERSION-aarch64-unknown-linux-gnu.tar.gz && \
#     mv mdbook /usr/local/bin/ && \
#     rm -f mdbook-v$MDBOOK_VERSION-aarch64-unknown-linux-gnu.tar.gz && \
#     curl -fLO https://github.com/dylanowen/mdbook-graphviz/releases/download/v$MDBOOK_GRAPHVIZ_VERSION/mdbook-graphviz_v${MDBOOK_GRAPHVIZ_VERSION}_aarch64-unknown-linux-musl.zip && \
#     unzip mdbook-graphviz_v${MDBOOK_GRAPHVIZ_VERSION}_aarch64-unknown-linux-musl.zip && \
#     mv mdbook-graphviz /usr/local/bin/ && \
#     rm -f mdbook-graphviz_v${MDBOOK_GRAPHVIZ_VERSION}_aarch64-unknown-linux-musl.zip && \
#     curl -fLO https://github.com/EmbarkStudios/cargo-about/releases/download/$CARGO_ABOUT_VERSION/cargo-about-$CARGO_ABOUT_VERSION-aarch64-unknown-linux-musl.tar.gz && \
#     tar xf cargo-about-$CARGO_ABOUT_VERSION-aarch64-unknown-linux-musl.tar.gz && \
#     mv cargo-about-$CARGO_ABOUT_VERSION-aarch64-unknown-linux-musl/cargo-about /usr/local/bin/ && \
#     rm -rf cargo-about-$CARGO_ABOUT_VERSION-aarch64-unknown-linux-musl.tar.gz cargo-about-$CARGO_ABOUT_VERSION-aarch64-unknown-linux-musl && \
#     curl -fLO https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv${CARGO_AUDIT_VERSION}/cargo-audit-aarch64-unknown-linux-gnu-v${CARGO_AUDIT_VERSION}.tgz && \
#     tar xf cargo-audit-aarch64-unknown-linux-gnu-v${CARGO_AUDIT_VERSION}.tgz && \
#     cp cargo-audit-aarch64-unknown-linux-gnu-v${CARGO_AUDIT_VERSION}/cargo-audit /usr/local/bin/ && \
#     rm -rf cargo-audit-aarch64-unknown-linux-gnu-v${CARGO_AUDIT_VERSION}.tgz cargo-audit-aarch64-unknown-linux-gnu-v${CARGO_AUDIT_VERSION} && \
#     curl -fLO https://github.com/EmbarkStudios/cargo-deny/releases/download/$CARGO_DENY_VERSION/cargo-deny-$CARGO_DENY_VERSION-aarch64-unknown-linux-musl.tar.gz && \
#     tar xf cargo-deny-$CARGO_DENY_VERSION-aarch64-unknown-linux-musl.tar.gz && \
#     mv cargo-deny-$CARGO_DENY_VERSION-aarch64-unknown-linux-musl/cargo-deny /usr/local/bin/ && \
#     rm -rf cargo-deny-$CARGO_DENY_VERSION-aarch64-unknown-linux-musl cargo-deny-$CARGO_DENY_VERSION-aarch64-unknown-linux-musl.tar.gz

# Static linking for C++ code
RUN ln -s "/usr/bin/g++" "/usr/bin/musl-g++"

# Build a static library version of OpenSSL using musl-libc.  This is needed by
# the popular Rust `hyper` crate.
#
# We point /usr/local/musl/include/linux at some Linux kernel headers (not
# necessarily the right ones) in an effort to compile OpenSSL 1.1's "engine"
# component. It's possible that this will cause bizarre and terrible things to
# happen. There may be "sanitized" header
RUN echo "Building OpenSSL" && \
    ls /usr/include/linux && \
    mkdir -p /usr/local/musl/include && \
    ln -s /usr/include/linux /usr/local/musl/include/linux && \
    ln -s /usr/include/aarch64-linux-gnu/asm /usr/local/musl/include/asm && \
    ln -s /usr/include/asm-generic /usr/local/musl/include/asm-generic && \
    cd /tmp && \
    short_version="$(echo "$OPENSSL_VERSION" | sed s'/[a-z]$//' )" && \
    curl -fLO "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" || \
        curl -fLO "https://www.openssl.org/source/old/$short_version/openssl-$OPENSSL_VERSION.tar.gz" && \
    tar xvzf "openssl-$OPENSSL_VERSION.tar.gz" && cd "openssl-$OPENSSL_VERSION" && \
    env CC=musl-gcc ./Configure no-shared no-zlib -fPIC --prefix=/usr/local/musl -DOPENSSL_NO_SECURE_MEMORY linux-aarch64 && \
    env C_INCLUDE_PATH=/usr/local/musl/include/ make depend && \
    env C_INCLUDE_PATH=/usr/local/musl/include/ make && \
    make install && \
    rm /usr/local/musl/include/linux /usr/local/musl/include/asm /usr/local/musl/include/asm-generic && \
    rm -r /tmp/*

RUN echo "Building zlib" && \
    cd /tmp && \
    curl -fLO "http://zlib.net/zlib-$ZLIB_VERSION.tar.gz" && \
    tar xzf "zlib-$ZLIB_VERSION.tar.gz" && cd "zlib-$ZLIB_VERSION" && \
    CC=musl-gcc ./configure --static --prefix=/usr/local/musl && \
    make && make install && \
    rm -r /tmp/*

RUN echo "Building libpq" && \
    cd /tmp && \
    curl -fLO "https://ftp.postgresql.org/pub/source/v$POSTGRESQL_VERSION/postgresql-$POSTGRESQL_VERSION.tar.gz" && \
    tar xzf "postgresql-$POSTGRESQL_VERSION.tar.gz" && cd "postgresql-$POSTGRESQL_VERSION" && \
    CC=musl-gcc CPPFLAGS=-I/usr/local/musl/include LDFLAGS=-L/usr/local/musl/lib ./configure --with-openssl --without-readline --prefix=/usr/local/musl && \
    cd src/interfaces/libpq && make all-static-lib && make install-lib-static && \
    cd ../../bin/pg_config && make && make install && \
    rm -r /tmp/*

# (Please feel free to submit pull requests for musl-libc builds of other C
# libraries needed by the most popular and common Rust crates, to avoid
# everybody needing to build them manually.)

# Install a `git credentials` helper for using GH_USER and GH_TOKEN to access
# private repositories if desired. We make sure this is configured for root,
# here, and for the `rust` user below.
ADD git-credential-ghtoken /usr/local/bin/ghtoken
RUN git config --global credential.https://github.saobby.my.eu.org.helper ghtoken

# Set up our path with all our binary directories, including those for the
# musl-gcc toolchain and for our Rust toolchain.
#
# We use the instructions at https://github.com/rust-lang/rustup/issues/2383
# to install the rustup toolchain as root.
ENV RUSTUP_HOME=/opt/rust/rustup \
    PATH=/home/rust/.cargo/bin:/opt/rust/cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Install our Rust toolchain and the `musl` target.  We patch the
# command-line we pass to the installer so that it won't attempt to
# interact with the user or fool around with TTYs.  We also set the default
# `--target` to musl so that our users don't need to keep overriding it
# manually.
RUN curl https://sh.rustup.rs -sSf | \
    env CARGO_HOME=/opt/rust/cargo \
        sh -s -- -y --default-toolchain $TOOLCHAIN --profile minimal --no-modify-path && \
    env CARGO_HOME=/opt/rust/cargo \
        rustup component add rustfmt && \
    env CARGO_HOME=/opt/rust/cargo \
        rustup component add clippy && \
    env CARGO_HOME=/opt/rust/cargo \
        rustup target add aarch64-unknown-linux-musl
ADD cargo-config.toml /opt/rust/cargo/config

# Set up our environment variables so that we cross-compile using musl-libc by
# default.
ENV aarch64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR=/usr/local/musl/ \
    aarch64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC=1 \
    PQ_LIB_STATIC_aarch64_UNKNOWN_LINUX_MUSL=1 \
    PG_CONFIG_aarch64_UNKNOWN_LINUX_GNU=/usr/bin/pg_config \
    PKG_CONFIG_ALLOW_CROSS=true \
    PKG_CONFIG_ALL_STATIC=true \
    LIBZ_SYS_STATIC=1 \
    TARGET=musl

# Install some useful Rust tools from source (as few as we can, because these
# slow down image builds). This will use the static linking toolchain, but that
# should be OK.
#
# - `cargo-deb` builds Debian packages.
RUN env CARGO_HOME=/opt/rust/cargo cargo install -f cargo-deb && \
    rm -rf /opt/rust/cargo/registry/

# Allow sudo without a password.
ADD sudoers /etc/sudoers.d/nopasswd

# Run all further code as user `rust`, create our working directories, install
# our config file, and set up our credential helper.
#
# You should be able to switch back to `USER root` from another `Dockerfile`
# using this image if you need to do so.
USER rust
RUN mkdir -p /home/rust/libs /home/rust/src /home/rust/.cargo && \
    ln -s /opt/rust/cargo/config /home/rust/.cargo/config && \
    git config --global credential.https://github.saobby.my.eu.org.helper ghtoken

# Expect our source code to live in /home/rust/src.  We'll run the build as
# user `rust`, which will be uid 1000, gid 1000 outside the container.
WORKDIR /home/rust/src

@gaganyaan2
Copy link
Owner Author

gaganyaan2 commented Oct 29, 2022

after editing cargo-config.toml

[build]
# Target musl-libc by default when running Cargo.
target = "aarch64-unknown-linux-musl"

[target.armv7-unknown-linux-musleabihf]
linker = "arm-linux-gnueabihf-gcc"
----more logs 
error: failed to run custom build command for `lzma-sys v0.1.19`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installBYCsH6/release/build/lzma-sys-86327d577db224fc/build-script-build` (exit status: 1)
  --- stdout

----more logs
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:root=/tmp/cargo-installBYCsH6/aarch64-unknown-linux-musl/release/build/lzma-sys-937da754e499bff9/out
  cargo:include=/opt/rust/cargo/registry/src/github.com-1ecc6299db9ec823/lzma-sys-0.1.19/xz-5.2/src/liblzma/api
  TARGET = Some("aarch64-unknown-linux-musl")
  OPT_LEVEL = Some("3")
  HOST = Some("aarch64-unknown-linux-gnu")
  CC_aarch64-unknown-linux-musl = None
  CC_aarch64_unknown_linux_musl = None
  TARGET_CC = None
  CC = None
  CROSS_COMPILE = None
  CFLAGS_aarch64-unknown-linux-musl = None
  CFLAGS_aarch64_unknown_linux_musl = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("neon,pmuv3")
  running: "aarch64-linux-musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "/opt/rust/cargo/registry/src/github.com-1ecc6299db9ec823/lzma-sys-0.1.19" "-Wall" "-Wextra" "-std=c99" "-pthread" "-DHAVE_CONFIG_H=1" "-o" "/tmp/cargo-installBYCsH6/aarch64-unknown-linux-musl/release/build/lzma-sys-937da754e499bff9/out/xz-5.2/src/liblzma/common/stream_decoder.o" "-c" "xz-5.2/src/liblzma/common/stream_decoder.c"

  --- stderr


  error occurred: Failed to find tool. Is `aarch64-linux-musl-gcc` installed?


warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-deb v1.40.5`, intermediate artifacts can be found at `/tmp/cargo-installBYCsH6`
The command '/bin/sh -c env CARGO_HOME=/opt/rust/cargo cargo install -f cargo-deb &&     rm -rf /opt/rust/cargo/registry/' returned a non-zero code: 101
  • with docker buildx
[build]
# Target musl-libc by default when running Cargo.
target = "aarch64-unknown-linux-musl"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-gnu-gcc"
rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]

[target.armv7-unknown-linux-musleabihf]
linker = "arm-linux-gnueabihf-gcc"
#17 317.7   running: "aarch64-linux-musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-static" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "/opt/rust/cargo/registry/src/github.com-1ecc6299db9ec823/lzma-sys-0.1.19" "-Wall" "-Wextra" "-std=c99" "-pthread" "-DHAVE_CONFIG_H=1" "-o" "/tmp/cargo-installjhgoKs/aarch64-unknown-linux-musl/release/build/lzma-sys-12d9d7b4b801726f/out/xz-5.2/src/liblzma/common/auto_decoder.o" "-c" "xz-5.2/src/liblzma/common/auto_decoder.c"
#17 317.7   exit status: 127
#17 317.7 
#17 317.7   --- stderr
#17 317.7 
#17 317.7 
#17 317.7   error occurred: Command "aarch64-linux-musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-static" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "/opt/rust/cargo/registry/src/github.com-1ecc6299db9ec823/lzma-sys-0.1.19" "-Wall" "-Wextra" "-std=c99" "-pthread" "-DHAVE_CONFIG_H=1" "-o" "/tmp/cargo-installjhgoKs/aarch64-unknown-linux-musl/release/build/lzma-sys-12d9d7b4b801726f/out/xz-5.2/src/liblzma/common/auto_decoder.o" "-c" "xz-5.2/src/liblzma/common/auto_decoder.c" with args "aarch64-linux-musl-gcc" did not execute successfully (status code exit status: 127).
#17 317.7 
#17 317.7 
#17 317.7 warning: build failed, waiting for other jobs to finish...
#17 353.0 error: failed to compile `cargo-deb v1.40.5`, intermediate artifacts can be found at `/tmp/cargo-installjhgoKs`
------
error: failed to solve: executor failed running [/bin/sh -c env CARGO_HOME=/opt/rust/cargo cargo install -f cargo-deb &&     rm -rf /opt/rust/cargo/registry/]: exit code: 101

may be related to rust-lang/rust#46651 (comment) ?

@gaganyaan2
Copy link
Owner Author

gaganyaan2 commented Oct 29, 2022

Able to build arm64 image after updating the cargo-config.toml

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-gnu-gcc"
rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]

[target.armv7-unknown-linux-musleabihf]
linker = "arm-linux-gnueabihf-gcc"

Here is docker image - koolwithk/rust-musl:1.64.0-arm64

build instruction and arm64.Dockerfile - https://github.com/koolwithk/rust-musl-builder#rust-musl-builder-arm64-support

reference - rust-lang/rust#46651 (comment)

@gaganyaan2
Copy link
Owner Author

Still having the openssl issue even with custom docker image for rust-musl-builder with openssl koolwithk/rust-musl:1.64.0-arm64

#15 134.1 error: failed to run custom build command for `openssl-sys v0.9.77`
#15 134.1 
#15 134.1 Caused by:
#15 134.1   process didn't exit successfully: `/home/rust/src/target/release/build/openssl-sys-f63ab03a87e35638/build-script-main` (exit status: 101)
#15 134.1   --- stdout
#15 134.1   cargo:rustc-cfg=const_fn
#15 134.1   cargo:rustc-cfg=openssl
#15 134.1   cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR
#15 134.1   AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR unset
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
#15 134.1   OPENSSL_LIB_DIR unset
#15 134.1   cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR
#15 134.1   AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR unset
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
#15 134.1   OPENSSL_INCLUDE_DIR unset
#15 134.1   cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR
#15 134.1   AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR unset
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_DIR
#15 134.1   OPENSSL_DIR unset
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_STATIC
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_PATH
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_PATH
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_LIBDIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
#15 134.1   cargo:rerun-if-env-changed=SYSROOT
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_STATIC
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
#15 134.1   cargo:rustc-link-lib=ssl
#15 134.1   cargo:rustc-link-lib=dl
#15 134.1   cargo:rustc-link-lib=crypto
#15 134.1   cargo:rustc-link-lib=dl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_STATIC
#15 134.1   cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_PATH
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_PATH
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_LIBDIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-musl
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_musl
#15 134.1   cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
#15 134.1   cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
#15 134.1   cargo:rerun-if-changed=build/expando.c
#15 134.1   OPT_LEVEL = Some("3")
#15 134.1   TARGET = Some("aarch64-unknown-linux-musl")
#15 134.1   HOST = Some("aarch64-unknown-linux-gnu")
#15 134.1   CC_aarch64-unknown-linux-musl = None
#15 134.1   CC_aarch64_unknown_linux_musl = None
#15 134.1   TARGET_CC = None
#15 134.1   CC = None
#15 134.1   CROSS_COMPILE = None
#15 134.1   CFLAGS_aarch64-unknown-linux-musl = None
#15 134.1   CFLAGS_aarch64_unknown_linux_musl = None
#15 134.1   TARGET_CFLAGS = None
#15 134.1   CFLAGS = None
#15 134.1   CRATE_CC_NO_DEFAULTS = None
#15 134.1   DEBUG = Some("false")
#15 134.1   CARGO_CFG_TARGET_FEATURE = Some("crt-static,neon,pmuv3")
#15 134.1   running: "aarch64-linux-musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-static" "-I" "/usr/include" "-Wall" "-Wextra" "-E" "build/expando.c"
#15 134.1   exit status: 127
#15 134.1 
#15 134.1   --- stderr
#15 134.1   thread 'main' panicked at '
#15 134.1   Header expansion error:
#15 134.1   Error { kind: ToolExecError, message: "Command \"aarch64-linux-musl-gcc\" \"-O3\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-static\" \"-I\" \"/usr/include\" \"-Wall\" \"-Wextra\" \"-E\" \"build/expando.c\" with args \"aarch64-linux-musl-gcc\" did not execute successfully (status code exit status: 127)." }
#15 134.1 
#15 134.1   Failed to find OpenSSL development headers.
#15 134.1 
#15 134.1   You can try fixing this setting the `OPENSSL_DIR` environment variable
#15 134.1   pointing to your OpenSSL installation or installing OpenSSL headers package
#15 134.1   specific to your distribution:
#15 134.1 
#15 134.1       # On Ubuntu
#15 134.1       sudo apt-get install libssl-dev
#15 134.1       # On Arch Linux
#15 134.1       sudo pacman -S openssl
#15 134.1       # On Fedora
#15 134.1       sudo dnf install openssl-devel
#15 134.1       # On Alpine Linux
#15 134.1       apk add openssl-dev
#15 134.1 
#15 134.1   See rust-openssl documentation for more information:
#15 134.1 
#15 134.1       https://docs.rs/openssl
#15 134.1   ', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.77/build/main.rs:185:13
#15 134.1   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#15 134.1 warning: build failed, waiting for other jobs to finish...
------
error: failed to solve: executor failed running [/bin/sh -c cargo build --target $arch-unknown-linux-musl --release]: exit code: 101

@gaganyaan2
Copy link
Owner Author

after creating symlink for aarch64-linux-musl-gcc

sudo ln -s /usr/bin/aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-musl-gcc
   Compiling num-integer v0.1.45
error[E0277]: the trait bound `i128: traits::Num` is not satisfied
   --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/lib.rs:406:14
    |
406 |         impl Integer for $T {
    |              ^^^^^^^ the trait `traits::Num` is not implemented for `i128`
...
831 | impl_integer_for_isize!(i128, test_integer_i128);
    | ------------------------------------------------ in this macro invocation
    |
    = help: the following other types implement trait `traits::Num`:
              f32
              f64
              i16
              i32
              i64
              i8
              isize
              u16
            and 4 others
note: required by a bound in `Integer`
   --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/lib.rs:37:28
    |
37  | pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
    |                            ^^^ required by this bound in `Integer`
    = note: this error originates in the macro `impl_integer_for_isize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u128: traits::Num` is not satisfied
    --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/lib.rs:835:14
     |
835  |         impl Integer for $T {
     |              ^^^^^^^ the trait `traits::Num` is not implemented for `u128`
...
1057 | impl_integer_for_usize!(u128, test_integer_u128);
     | ------------------------------------------------ in this macro invocation
     |
     = help: the following other types implement trait `traits::Num`:
               f32
               f64
               i16
               i32
               i64
               i8
               isize
               u16
             and 4 others
note: required by a bound in `Integer`
    --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/lib.rs:37:28
     |
37   | pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
     |                            ^^^ required by this bound in `Integer`
     = note: this error originates in the macro `impl_integer_for_usize` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `i128: traits::Num` is not satisfied
   --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/roots.rs:136:14
    |
136 |         impl Roots for $T {
    |              ^^^^^ the trait `traits::Num` is not implemented for `i128`
...
170 | signed_roots!(i128, u128);
    | ------------------------- in this macro invocation
    |
    = help: the following other types implement trait `traits::Num`:
              f32
              f64
              i16
              i32
              i64
              i8
              isize
              u16
            and 4 others
note: required by a bound in `Roots`
   --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/roots.rs:9:18
    |
9   | pub trait Roots: Integer {
    |                  ^^^^^^^ required by this bound in `Roots`
    = note: this error originates in the macro `signed_roots` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u128: traits::Num` is not satisfied
   --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/roots.rs:204:14
    |
204 |         impl Roots for $T {
    |              ^^^^^ the trait `traits::Num` is not implemented for `u128`
...
390 | unsigned_roots!(u128);
    | --------------------- in this macro invocation
    |
    = help: the following other types implement trait `traits::Num`:
              f32
              f64
              i16
              i32
              i64
              i8
              isize
              u16
            and 4 others
note: required by a bound in `Roots`
   --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/roots.rs:9:18
    |
9   | pub trait Roots: Integer {
    |                  ^^^^^^^ required by this bound in `Roots`
    = note: this error originates in the macro `unsigned_roots` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `num-integer` due to 4 previous errors

@gaganyaan2
Copy link
Owner Author

for fixing num-integer v0.1.45 remove 128 with 64 or 32

sed -i 's/128/32/g' /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/roots.rs
sed -i 's/128/64/g'  /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.45/src/lib.rs

@gaganyaan2
Copy link
Owner Author

not statically linked binary. fails to run on other arm64 machine

rust@e13ee56362cb:~/src/target/aarch64-unknown-linux-musl/release$ ldd kn
	linux-vdso.so.1 (0x0000ffff896b2000)
	libssl.so.1.1 => /usr/lib/aarch64-linux-gnu/libssl.so.1.1 (0x0000ffff895fc000)
	libcrypto.so.1.1 => /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000ffff893bb000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff8938f000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff89236000)
	/lib/ld-linux-aarch64.so.1 (0x0000ffff89686000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff89221000)
rust@e13ee56362cb:~/src/target/aarch64-unknown-linux-musl/release$ ./kn
/home/rust/.kube/config : kubeconfig file does not exists 
root@lp-arm-1:~/kx-kn-rust/kn/target/aarch64-unknown-linux-musl/release# ./kn
thread 'main' panicked at 'unexpected getrandom error: 0', library/std/src/sys/unix/rand.rs:111:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
root@lp-arm-1:~/kx-kn-rust/kn/target/aarch64-unknown-linux-musl/release# 
root@lp-arm-1:~/kx-kn-rust/kn/target/aarch64-unknown-linux-musl/release# ldd kn
	linux-vdso.so.1 (0x0000ffff983ce000)
	libssl.so.1.1 => /lib/aarch64-linux-gnu/libssl.so.1.1 (0x0000ffff98304000)
	libcrypto.so.1.1 => /lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000ffff98076000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff98046000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff97ed3000)
	/lib/ld-linux-aarch64.so.1 (0x0000ffff9839e000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff97ebf000)

@gaganyaan2 gaganyaan2 self-assigned this Oct 29, 2022
@gaganyaan2
Copy link
Owner Author

apt-get install musl-tools clang llvm -y
export  CC_aarch64_unknown_linux_musl=clang
export AR_aarch64_unknown_linux_musl=llvm-ar
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"

source - briansmith/ring#1414 (comment)

cargo rustc --target aarch64-unknown-linux-musl -- -C link-arg=-lgcc
   Compiling kube v0.75.0
   Compiling kn v0.1.0 (/home/rust/src)
warning: unused imports: `Mapping`, `Value`
  --> src/kn.rs:10:18
   |
10 | use serde_yaml::{Mapping, Value};
   |                  ^^^^^^^  ^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: use of deprecated function `std::env::home_dir`: This function's behavior is unexpected and probably not what you want. Consider using a crate from crates.io instead.
  --> src/kubeconfig.rs:16:24
   |
16 |     let homedir = env::home_dir().unwrap().as_path().display().to_string();
   |                        ^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: value assigned to `kubeconfig` is never read
 --> src/kubeconfig.rs:7:13
  |
7 |     let mut kubeconfig = "";
  |             ^^^^^^^^^^
  |
  = note: `#[warn(unused_assignments)]` on by default
  = help: maybe it is overwritten before being read?

warning: value assigned to `kn` is never read
 --> src/flags.rs:6:13
  |
6 |     let mut kn = "";
  |             ^^
  |
  = help: maybe it is overwritten before being read?

error: linking with `rust-lld` failed: exit status: 1
  |
  = note: "rust-lld" "-flavor" "gnu" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crt1.o" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crti.o" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtbegin.o" "/tmp/rustcE2KzVn/symbols.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.144g052e5dbty9ag.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.18zotmj5z6i1olbr.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.19p0wgpy8cnj02vd.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1av7q8i3lsoc9do0.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1bt6jxlms7bgoetc.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1ch7tajqgtumct0n.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1cpvh34thkjtges3.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1e939xtyepib0wz.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1fjefy1i1kwi00a1.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1h6p1wzmbgaibw7i.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1kcx7cwgx7agsz0j.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1mktwdq98c1yc4yq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1oc1iorl6xk1dtel.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1p5vd4t0s3te52vw.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1p7qxs2ps42zynzn.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1qzxk60jzvl94rt8.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1r0nw752is07kz2e.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1r0oeucpy2vsi6xb.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1sdpi1cidnr80em8.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1t9xfegv8c8e7r6y.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1tw8gvh5wn7py1po.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1ufs0v1xcl5auior.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1upg9a7lz76d7t63.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1vdop96bctkxa7pj.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1vkd83ahraz4vunr.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1vlhoxllg9skghxe.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.1yj2v8aytvfc24vy.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.229h1m22bd35cwms.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.23dtxemw4m67as5c.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.23rac6zh3ldyfn1.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.259yepobsietxpkx.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.281y4ikhkpo5tsjz.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2bc35adb1a63u5e1.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2e1v0zm9vj00zqze.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2ehwbez79wtcv7pa.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2f70pjve1eh842x9.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2fajx31y7o3ymij5.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2fbn427z34gmigqn.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2ffpa9v8vfi59vnl.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2fo0qxa0sr4yqnxq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2hg46atkysd6e7jp.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2i3zwhiu9atpzr31.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2i4jzyg0yrmjwhis.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2i76rg0f60jbnsl3.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2jm9ve1vv1lirn5j.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2lskau6u0sd6c77d.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2lxsh0t140f60vyi.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2mbg6k6nym2u3ajs.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2pvbt7cf8260zrm9.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2qjspvp77stwuhk4.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2wo197397r0ni7n5.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2y20zty4q0hmgtm9.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2y9qo7xo2rlijnn.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.2ztoe6x8x1jcudej.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.31z7ia14da7m0g7g.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.31zgyv3p1fymjltq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.34ornzxtyvwgp8wi.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.34qov4dc71iouig.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.35v4flhpqk4fvney.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.362ng6s4hslg4pnc.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.37aj6l7urvbx1ky9.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.38lhslqusy6b3gow.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.39ak92pws3w2q4k0.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.39h744lqldvkor69.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3ccfl2as0cs64bj8.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3clde4jkguwidhaq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3dsm5rewl54degou.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3elnoxi0z6iwx01q.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3flcb0ussd62jvir.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3g1fmj8moubsumq1.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3gsrs9mrrb7a8fvw.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3guaxatyhsym5ljv.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3hbrq91cmj5vj3y.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3jdk9z4di5ts84f4.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3jljtkyholq3s3hq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3k1q1i367lqhcycb.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3kv78w98jm9cmp4l.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3lur0xh5p1h7kv1r.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3m1sc39rtqsuy1xu.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3nl8787fali26hvl.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3nyw6j5ubakd2ma.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3oui1ola56ipc3kl.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3p0qvge2i54ojao7.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3pm0sq6cw5p2xfjj.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3qxyz03y6oh818r.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3toflt34jdp7czya.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3u3egt9bl5845nem.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3v7hemppit5fejux.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.3vbiu0k9swoxzkm3.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.40gazi0bai9dar0c.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.41xsvvsz42589ena.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.42oj2zkyu54dult4.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4351ju2nlj7webis.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.43hl5vlqwkp87g13.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.44atz0od754eh2jw.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.45tf54o3cjm14b8i.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.486l0350xeu45wwp.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.489btgbqv5l8ledu.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.48tt5i5bo7n0swmi.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.49ryjtd81f0guw8e.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4a54qygkzv03zj9v.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4al79muxxsxsdfzx.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4ato7j3n9mopmxjk.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4c89q2yr50agz5t.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4d2wda0hpgox97bc.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4e4geb1q5nau2n8y.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4ksnytkwugxqxhjh.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4mggkj6sl97g6pzg.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4mjzyeyeq6680qwt.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4nhlc97e7c1umpty.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4qhl71i8jp4vizht.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4rkf9pr46rh17zrn.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4se7pz9qesy7jhmy.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4tjsvoasf3s20gih.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4vz9fi3lwvlu86az.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4xmcazq7uq5tlfnw.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4y8lrsjtgg4m554a.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4ycy99yrmg6tfyhh.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.4zkvdds253u13fow.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.52ipce0xtn6go5sn.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.52ken3lpixfscrrm.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.52wyoraup1yn18v2.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.5347o8vd35zq7hw1.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.53py8nm8oqf6v742.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.541v2rscg34htmh9.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.558etf99r4qiywzg.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.5blvxl6ddpjoqo6.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.5buqveaqy42cquuc.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.5drvxl6953ub6xxf.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.5e3kx4azlfqcctfj.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.5f7vxf58q7oh4v5b.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.6y37lmqpzgd9xuz.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.8dww3sy6nu0xu6b.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.8wcexxmxxsdhbvv.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.abetq1x3069d4qm.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.agnmuo2nv6enoe3.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.awshesgg6o979l4.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.but9ai5mo8asd8o.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.crlgsu0v4linoe2.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.d13ejp7h6opxonq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.deiauq5zlrp14i1.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.gbrjnrwgeyjaoo6.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.ghjqtpuyob87l9d.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.hqeu9lqol0xq36v.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.hs7cfgwfmj33mv7.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.mlam1ip7jpjb0vf.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.ohtj60xrd7yrumb.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.p33g1edj73w0x5k.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.qaol811w5mts4h0.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.sgu8eznr2ir408u.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.u77jvpqbpyctivq.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.uhedejmyjdaeoe3.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.xp8rhv2vczyq9wr.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.yonw82g36qdfjd3.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.zgyntpc1lxtuht0.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.zqihpqx07jng4en.rcgu.o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b.37u06muv3l4rcan6.rcgu.o" "--as-needed" "-L" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps" "-L" "/home/rust/src/target/debug/deps" "-L" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib" "-Bstatic" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libserde_yaml-203723b35fd78325.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libunsafe_libyaml-37acd4fc8adb8c2b.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libcolored-d63a4fe85ed45a57.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liblazy_static-1150859162b2466a.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libatty-988d2b85298fe46c.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libkube-77100ef03c6c24a9.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libkube_runtime-a0745ff0e3a6fc66.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libahash-e2ed60e8057bb42d.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libkube_client-ac5330dfc2b52e68.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libpem-e65fea35eb40ed93.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libserde_yaml-78140441cfb96f46.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhyper_openssl-204a4afa38e99c72.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liblinked_hash_set-9da0efb5e1e641f4.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtokio_openssl-d4099d4c3e1eabd9.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libdirs_next-82c542a7281af9ce.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libdirs_sys_next-1cda2c4fcb469078.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libopenssl-6eeb302c226f11b5.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libforeign_types-292d079e3269315a.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libforeign_types_shared-744ca33817ff6619.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libopenssl_sys-031d1d224553ec76.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhyper_timeout-3f0a63e8beb00762.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtokio_io_timeout-5585ee23ffb0b43c.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libsecrecy-b3ae5862a5e1c49b.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libzeroize-6da53dc97b6147a1.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libjsonpath_lib-5921b7bb5bc0ed01.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtower_http-c670e38647d01fcb.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libbitflags-5cc40f2c5f27cdc7.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtower-c16da5bbcacfdfdc.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libpin_project-82e37e414af1bbf8.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtower_layer-3a0f6be397ad851e.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtokio_util-ba150fd6a0c0adbc.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhyper-61c27ef426b86c6f.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libwant-a1240e517e8e1ad5.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtry_lock-4ce5455c33fa0bbf.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhttparse-f927dd0b6c95e18c.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtower_service-a66762c0fa0f62c3.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhttp_body-e6e09e3a046691cb.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtokio-8d9e18f6d566c7d2.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libsignal_hook_registry-9144123edca5b734.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libnum_cpus-aa7ff93e63c2fc28.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libsocket2-b58c3dec5be6dd2f.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libmio-60a20abb585f893e.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libparking_lot-8190029a83d1539c.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libparking_lot_core-29324ba7b723ca07.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libsmallvec-6b417843d56cca91.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liblock_api-d5e18b0582dbe00d.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libscopeguard-2038bf65aba375e8.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libeither-4dbc6ae1c0005882.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtracing-0209ec1203207a1f.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liblog-30d408a2b137961e.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtracing_core-9ede1bee10b21562.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libkube_core-3984ed7bfece8b9d.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libjson_patch-b8fbc9fee71f7b92.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtreediff-d15e54543c760e45.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libschemars-7d7d8831c8893c90.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libdyn_clone-b0c12fb9575a6776.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libonce_cell-f021e8cab8c03a83.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libk8s_openapi-1bd87aee85437077.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libbase64-e926f7297d72e428.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liburl-ec18f0da46887a04.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libidna-710e246f1e7da090.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libunicode_normalization-f8e8f1dbf72a3303.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtinyvec-99a1654fb693615e.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libtinyvec_macros-872a980b517e36be.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libunicode_bidi-5c42981748308930.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libform_urlencoded-84146860697f2cb9.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libserde_value-be9f1c2752949d0c.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libordered_float-abfc97670f31e213.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libserde_json-0437f826549e1be2.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libryu-8471df35ae4f0714.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libindexmap-1e1f1ec2784a99d6.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhashbrown-099bcb902d2336b6.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libpercent_encoding-475a39194a3a9fdd.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libhttp-5b2f30e912064493.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libitoa-4e83b7a7455ebfd4.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libbytes-ac36e9f65bc57273.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfnv-3c204b3c8df6d716.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libchrono-7fef2c87e0283355.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libiana_time_zone-14e6829f567f3bc6.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libnum_integer-df8d53280639b1c9.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libnum_traits-f6075760ce76baae.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libthiserror-f8c837fa3b8c21d5.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libserde-ad1ee6daa82a0335.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures-dda43e3cefb62cd7.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_executor-3ebf856213a68452.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_util-bff36951471919f0.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libmemchr-9f54f98ea447a07f.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_io-05c5f7d291bd0b7e.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libslab-30ddcc92ea8a2b57.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_channel-b29cee5fee289a2a.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libpin_project_lite-7d08aaa307f6b836.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_sink-ca3762bd6e77ed95.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_task-d8bb6a88f43fdea6.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libpin_utils-8f4e565796b2ec23.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libfutures_core-25e64485fef773b1.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libbackoff-bb7cc393f3802685.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/librand-425ec607405323f3.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/librand_chacha-09ca2399a7e7135c.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libppv_lite86-016f64e3e784f5da.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/librand_core-834843e62343251e.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libgetrandom-401b6b640a557925.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liblibc-eb1ddffcaf49ee32.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libinstant-45af2c6bd48af370.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libcfg_if-48b9703270744c0b.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/libyaml_rust-aec4a9c8d61c2845.rlib" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/liblinked_hash_map-4137706d9547d3f4.rlib" "--start-group" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd-e3a93624fabaeb38.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libpanic_unwind-0b9f1468ea0bfb14.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libobject-c87d2d2cf76f9aaa.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libmemchr-f2cd823962bba02f.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libaddr2line-4611e5b3f158314c.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libgimli-bdd9adb3b0cc39e5.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_demangle-c98aae893c12ec62.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd_detect-b7f97ec48b5fc26e.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libhashbrown-63d222189eedc35a.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libminiz_oxide-c34ef21e3a75daaa.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libadler-7108b1cfb98688d8.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_alloc-9b3b6bede7d80cef.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libunwind-9b91a1cdf2c55742.rlib" "-lunwind" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-55e29f41c2a93f83.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/liblibc-acf6b462c6f520e9.rlib" "-lc" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/liballoc-52beb50dfe7c18a9.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_core-6ac41ddcf6a09a4b.rlib" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libcore-500624ead17ebeb2.rlib" "--end-group" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-ee4c65da8befe454.rlib" "-Bdynamic" "-lssl" "-lcrypto" "-ldl" "--eh-frame-hdr" "-znoexecstack" "-L" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib" "-L" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained" "-o" "/home/rust/src/target/aarch64-unknown-linux-musl/debug/deps/kn-4e6d3ae4e0a4853b" "--gc-sections" "-static" "-zrelro" "-znow" "-lgcc" "-lgcc" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtend.o" "/opt/rust/rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtn.o"
  = note: rust-lld: error: unable to find library -lssl
          rust-lld: error: unable to find library -lcrypto
          rust-lld: error: unable to find library -ldl
          rust-lld: error: unable to find library -lgcc
          rust-lld: error: unable to find library -lgcc
          

warning: `kn` (bin "kn") generated 4 warnings
error: could not compile `kn` due to previous error; 4 warnings emitted

@gaganyaan2
Copy link
Owner Author

gaganyaan2 commented Oct 30, 2022

Failed error: linking with aarch64-linux-gnu-gcc failed: exit status: 1

cargo rustc --target aarch64-unknown-linux-musl -- -C link-arg="-lgcc -lc -ldl"
  = note: /usr/bin/ld: cannot find -lgcc -lc -ldl
          collect2: error: ld returned 1 exit status
          

warning: `kn` (bin "kn") generated 4 warnings
error: could not compile `kn` due to previous error; 4 warnings emitted

after that

sudo cp /lib/aarch64-linux-musl/libc.so /lib/aarch64-linux-gnu/

build works but not statically linked.

@gaganyaan2
Copy link
Owner Author

build binary but working on outside of container.
But not working in alpine docker image

cargo rustc --target aarch64-linux-gnu-gcc -- -C "target-feature=+crt-static" -C link-arg="-lgcc"
cargo build --target=aarch64-unknown-linux-musl  --release

alpine

/ # ldd kn
	/lib/ld-linux-aarch64.so.1 (0xffffaa5f9000)
	libssl.so.1.1 => /lib/libssl.so.1.1 (0xffffaa253000)
	libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0xffffaa003000)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by kn)
	libpthread.so.0 => /lib/ld-linux-aarch64.so.1 (0xffffaa5f9000)
	libdl.so.2 => /lib/ld-linux-aarch64.so.1 (0xffffaa5f9000)
	libc.so.6 => /lib/ld-linux-aarch64.so.1 (0xffffaa5f9000)
Error relocating kn: __res_init: symbol not found
Error relocating kn: _Unwind_GetIPInfo: symbol not found
Error relocating kn: _Unwind_GetDataRelBase: symbol not found
Error relocating kn: _Unwind_GetRegionStart: symbol not found
Error relocating kn: _Unwind_SetGR: symbol not found
Error relocating kn: _Unwind_GetTextRelBase: symbol not found
Error relocating kn: _Unwind_Resume: symbol not found
Error relocating kn: _Unwind_DeleteException: symbol not found
Error relocating kn: gnu_get_libc_version: symbol not found
Error relocating kn: _Unwind_RaiseException: symbol not found
Error relocating kn: _Unwind_GetIP: symbol not found
Error relocating kn: _Unwind_Backtrace: symbol not found
Error relocating kn: _Unwind_GetLanguageSpecificData: symbol not found
Error relocating kn: _Unwind_SetIP: symbol not found

@gaganyaan2 gaganyaan2 changed the title kn - build issue with openssl kn - static binary build issue with openssl Oct 30, 2022
@gaganyaan2
Copy link
Owner Author

updated Cargo.toml kube dependencies and used rustls-tls instead of openssl

kube = { version = "0.75.0", default-features = false, features = ["runtime", "derive", "client", "rustls-tls"] }

It's faling with below error.

   Compiling tokio-io-timeout v1.2.0
   Compiling tokio-util v0.7.4
   Compiling secrecy v0.8.0
   Compiling tower-http v0.3.4
   Compiling serde_yaml v0.8.26
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/home/alok/kx-kn/kn/target/release/build/ring-c0a105218b2127e9/build-script-build` (exit status: 101)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-unknown-linux-musl")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_x86_64-unknown-linux-musl = None
  CC_x86_64_unknown_linux_musl = None
  TARGET_CC = None
  CC = None
  CROSS_COMPILE = None
  CFLAGS_x86_64-unknown-linux-musl = None
  CFLAGS_x86_64_unknown_linux_musl = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")

  --- stderr
  running "musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-U_FORTIFY_SOURCE" "-DNDEBUG" "-c" "-o/home/alok/kx-kn/kn/target/x86_64-unknown-linux-musl/release/build/ring-d41bbc5b2d5f8002/out/aesni-x86_64-elf.o" "/home/alok/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesni-x86_64-elf.S"
  thread 'main' panicked at 'failed to execute ["musl-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-U_FORTIFY_SOURCE" "-DNDEBUG" "-c" "-o/home/alok/kx-kn/kn/target/x86_64-unknown-linux-musl/release/build/ring-d41bbc5b2d5f8002/out/aesni-x86_64-elf.o" "/home/alok/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesni-x86_64-elf.S"]: No such file or directory (os error 2)', /home/alok/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:653:9

using messense/rust-musl-cross:aarch64-musl docker image able to build statically linked binary but it gives below error if there is config file.

root@lp-arm-1:~# ./kn 
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: HyperError(hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: UnsupportedNameType } }))', src/kn.rs:43:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


root@lp-arm-1:~# unset KUBECONFIG 
root@lp-arm-1:~# ./kn 
/root/.kube/config : kubeconfig file does not exists 

also tested with rust:1.60.0-buster docker image but no luck.

@gaganyaan2
Copy link
Owner Author

gaganyaan2 commented Nov 1, 2022

Finally able to build statically linked binary with messense/rust-musl-cross:aarch64-musl docker image

added below openssl in Cargo.toml

openssl = { version = "0.10", features = ["vendored"] }
apt install pkg-config perl make
apt install libssl-dev
cargo build --target aarch64-unknown-linux-musl --release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant