!ZFqvHUjUqgONNObpSJ:matrix.org

cross-rs

226 Members
Development of the Cross cross-compilation tool https://github.com/cross-rs/cross28 Servers

Load older messages


SenderMessageTime
16 Feb 2024
@emilgardis:matrix.orgemilgardishttps://github.com/cross-rs/cross-toolchains/issues/5515:13:04
@emilgardis:matrix.orgemilgardiswrong repo :D15:13:09
@emilgardis:matrix.orgemilgardishttps://github.com/cross-rs/cross/issues/144715:13:26
@yamafaktory:matrix.orgDavy DuperronAwesome! Many thanks!15:17:02
23 Feb 2024
@louis030195:matrix.orglouis030195 joined the room.12:38:39
@louis030195:matrix.orglouis030195

Hi guys!

I'm trying to use cross for the first time in a github ci but facing some issues with libssl:

error: failed to run custom build command for `openssl-sys v0.9.101`

Caused by:
  process didn't exit successfully: `/target/release/build/openssl-sys-0be3773e0c8a3530/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: 
  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags openssl

  The system library `openssl` required by crate `openssl-sys` was not found.
  The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `openssl.pc`.


  --- stderr
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.101/build/find_normal.rs:190:5:


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.101


  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

However I installed it and set the path but still facing the issue:

      # Install libssl-dev for cross-compiling
      - name: Install libssl-dev
        run: |
          sudo apt-get update && sudo apt-get install -y libssl-dev
          echo "PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> $GITHUB_ENV

This is my ci.yml:
https://gist.github.com/louis030195/4faae29696c1bac2b0014723faccf899#file-ci-yml-L91

Any chance you know what's wrong?

Thanks!

12:42:00
@niedzwiedzw:matrix.orgWojciech NiedźwiedźRedacted or Malformed Event12:52:42
@niedzwiedzw:matrix.orgWojciech NiedźwiedźRedacted or Malformed Event12:53:11
@niedzwiedzw:matrix.orgWojciech NiedźwiedźRedacted or Malformed Event12:53:38
@niedzwiedzw:matrix.orgWojciech NiedźwiedźRedacted or Malformed Event12:53:50
@niedzwiedzw:matrix.orgWojciech NiedźwiedźRedacted or Malformed Event12:53:53
24 Feb 2024
@emilgardis:matrix.orgemilgardis
In reply to @louis030195:matrix.org

Hi guys!

I'm trying to use cross for the first time in a github ci but facing some issues with libssl:

error: failed to run custom build command for `openssl-sys v0.9.101`

Caused by:
  process didn't exit successfully: `/target/release/build/openssl-sys-0be3773e0c8a3530/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: 
  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags openssl

  The system library `openssl` required by crate `openssl-sys` was not found.
  The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `openssl.pc`.


  --- stderr
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.101/build/find_normal.rs:190:5:


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.101


  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

However I installed it and set the path but still facing the issue:

      # Install libssl-dev for cross-compiling
      - name: Install libssl-dev
        run: |
          sudo apt-get update && sudo apt-get install -y libssl-dev
          echo "PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> $GITHUB_ENV

This is my ci.yml:
https://gist.github.com/louis030195/4faae29696c1bac2b0014723faccf899#file-ci-yml-L91

Any chance you know what's wrong?

Thanks!

Hey! Cross uses containers to run cargo in, basically, you need to install libssl in the container, not on the host. See https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#adding-dependencies-to-existing-images
00:52:27
@emilgardis:matrix.orgemilgardishttps://github.com/cross-rs/cross?tab=readme-ov-file#option-1-configuring-cross-directly-in-your-cargotoml00:53:26
@louis030195:matrix.orglouis030195
In reply to @emilgardis:matrix.org
Hey! Cross uses containers to run cargo in, basically, you need to install libssl in the container, not on the host. See https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#adding-dependencies-to-existing-images

Thanks!

Now I get this



   Compiling cfg-if v1.0.0
   Compiling pin-project-lite v0.2.13
   Compiling libc v0.2.153
   Compiling once_cell v1.19.0
error: failed to run custom build command for `libc v0.2.153`

Caused by:
  process didn't exit successfully: `/target/release/build/libc-15d09615a2760925/build-script-build` (exit status: 1)
  --- stderr
  /target/release/build/libc-15d09615a2760925/build-script-build: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /target/release/build/libc-15d09615a2760925/build-script-build)
  /target/release/build/libc-15d09615a2760925/build-script-build: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /target/release/build/libc-15d09615a2760925/build-script-build)
  /target/release/build/libc-15d09615a2760925/build-script-build: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /target/release/build/libc-15d09615a2760925/build-script-build)
warning: build failed, waiting for other jobs to finish...

Should I install libc in the image too?

14:56:30
@emilgardis:matrix.orgemilgardis No, you need to do cargo clean, the problem is that rustc doesn't keep track of what the build script depends on, and the same build script is used on the "native" target and the specified target 14:57:58
@emilgardis:matrix.orgemilgardishttps://github.com/cross-rs/cross/issues/72414:58:12
@louis030195:matrix.orglouis030195hmm I did this and it worked too [target.x86_64-unknown-linux-gnu] pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH", "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH && apt-get install --only-upgrade libc6:$CROSS_DEB_ARCH" ] [target.aarch64-unknown-linux-gnu] pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH", "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH && apt-get install --only-upgrade libc6:$CROSS_DEB_ARCH" ] Is cargo clean solution faster?15:10:16
@emilgardis:matrix.orgemilgardisI guess that works, if libc could be updated, but it's not neccessary17:35:49
26 Feb 2024
@therealprof:matrix.org@therealprof:matrix.org left the room.23:38:45
27 Feb 2024
@osvaldorino:matrix.orgosvaldo joined the room.09:21:34
@0xfourzerofour:matrix.orgJP joined the room.20:44:01
@0xfourzerofour:matrix.orgJPAny updates on when the cross base docker images are going to move from 20.04 to 22.04? I have some pretty annoying glibc errors downloading dependencies20:45:09
@0xfourzerofour:matrix.orgJP

e.g

bun: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by bun)

22:11:02
28 Feb 2024
@0xfourzerofour:matrix.orgJPI find this a bit weird because the the aarch64-unknown-linux-gnu container says that it has libc 2.31 installed15:48:13
@0xfourzerofour:matrix.orgJPI started last night creating some PR's for the 0.3 release but I know it will take a while to get those containers updated so I am wondering if there is a workaround for this in the mean time15:49:41
29 Feb 2024
@kibebr:matrix.orgkibebr joined the room.18:16:16
@kibebr:matrix.orgkibebr

Hi, I am trying to compile my Rust application that uses librdkafka and unfortunately, I am having no luck. I end up with:

error: failed to run custom build command for `rdkafka-sys v4.7.0+2.3.0`
Caused by:
  process didn't exit successfully: `/target/release/build/rdkafka-sys-e59c0968b8080fd3/build-script-build` (exit status: 101)
  --- stdout
  Configuring and compiling librdkafka
  CMAKE_TOOLCHAIN_FILE_aarch64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_aarch64_unknown_linux_gnu = Some("/opt/toolchain.cmake")
  CMAKE_GENERATOR_aarch64-unknown-linux-gnu = None
  CMAKE_GENERATOR_aarch64_unknown_linux_gnu = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_aarch64_unknown_linux_gnu = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-unknown-linux-gnu = None
  CMAKE_aarch64_unknown_linux_gnu = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/target/aarch64-unknown-linux-gnu/release/build/rdkafka-sys-40ec9426c7499cc6/out/build" && CMAKE_PREFIX_PATH="/target/aarch64-unknown-linux-gnu/release/build/libz-sys-ece1ef28c293d09f/out:" "cmake" "/cargo/registry/src/index.crates.io-6f17d22bba15001f/rdkafka-sys-4.7.0+2.3.0/librdkafka" "-DRDKAFKA_BUILD_STATIC=1" "-DRDKAFKA_BUILD_TESTS=0" "-DRDKAFKA_BUILD_EXAMPLES=0" "-DCMAKE_INSTALL_LIBDIR=lib" "-DWITH_ZLIB=1" "-DWITH_CURL=0" "-DWITH_SSL=0" "-DWITH_SASL=0" "-DWITH_ZSTD=0" "-DENABLE_LZ4_EXT=0" "-DCMAKE_TOOLCHAIN_FILE=/opt/toolchain.cmake" "-DCMAKE_INSTALL_PREFIX=/target/aarch64-unknown-linux-gnu/release/build/rdkafka-sys-40ec9426c7499cc6/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is GNU 9.4.0
  -- The CXX compiler identification is GNU 9.4.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Looking for pow in m
  -- Looking for pow in m - found
  -- Checking for module 'libsasl2'
  --   Found libsasl2, version 2.1.27
  -- Configuring incomplete, errors occurred!
  See also "/target/aarch64-unknown-linux-gnu/release/build/rdkafka-sys-40ec9426c7499cc6/out/build/CMakeFiles/CMakeOutput.log".
  --- stderr
  Building and linking librdkafka statically
  CMake Error at /usr/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
  Call Stack (most recent call first):
    /usr/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    /usr/local/share/cmake-3.23/Modules/FindZLIB.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    src/CMakeLists.txt:212 (find_package)
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:
  command did not execute successfully, got: exit status: 1
  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This is my Dockerfile, used to build a custom image for Cross:

ARG TARGET=aarch64-unknown-linux-musl
FROM ghcr.io/cross-rs/$TARGET:main AS builder
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    zlib1g-dev \
    libsasl2-dev \
    && apt-get clean

and my Cross.toml

[build]
dockerfile = "./Dockerfile.cross"

does anyone know what am I missing? it says the library is found

18:23:55
@kibebr:matrix.orgkibebrI am compiling for aarch64-unknown-linux-gnu, by the way18:24:28
@kibebr:matrix.orgkibebrRedacted or Malformed Event18:53:21
@kibebr:matrix.orgkibebrPinning Cross to 1.2.5 instead of main made it work19:22:06

There are no newer messages yet.


Back to Room ListRoom Version: 6