Skip to content

Ubuntu 22.04 is using openSSL 3.0 as default #68

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

Closed
klenkiven opened this issue May 17, 2022 · 5 comments
Closed

Ubuntu 22.04 is using openSSL 3.0 as default #68

klenkiven opened this issue May 17, 2022 · 5 comments
Milestone

Comments

@klenkiven
Copy link

klenkiven commented May 17, 2022

When I install newest Ubuntu 22.04, I found that the version of openssl is 3.0. SO I occur the problem with rust-build.

~/.rustup/toolchains/esp-1.60.0.1/bin/cargo: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Now I get a new Solution that compile the openssl 1.1.1. And add compiled openssl 1.1.1 to ld.so.conf. Can solve the problem temproarily.

@MabezDev MabezDev transferred this issue from esp-rs/rust May 17, 2022
@georgik
Copy link
Collaborator

georgik commented May 20, 2022

@klenkiven thank you for reporting the issue. We will check options for the deployment.
@SergioGasquez could you verify it with Dev Container by switching base image to Ubuntu 22.04?

@georgik georgik added this to the v1.62 milestone May 20, 2022
@SergioGasquez
Copy link
Member

SergioGasquez commented May 20, 2022

I was able to reproduce the error using the following Dockerfile:

ARG VARIANT=22.04
FROM ubuntu:${VARIANT}
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# Arguments
ARG CONTAINER_USER=esp
ARG CONTAINER_GROUP=esp
ARG NIGHTLY_TOOLCHAIN_VERSION=nightly
ARG XTENSA_TOOLCHAIN_VERSION=1.61.0.0
ARG ESP_IDF_VERSION=release/v4.4
ARG ESP_BOARD=esp32
ARG INSTALL_RUST_TOOLCHAIN=install-rust-toolchain.sh
# Install dependencies
RUN apt-get update \
    && apt-get install -y git curl gcc clang ninja-build libudev-dev unzip xz-utils \
    python3 python3-pip libusb-1.0-0 libssl-dev pkg-config libtinfo5  libpython2.7 \
    && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
# Set user
RUN adduser --disabled-password --gecos "" ${CONTAINER_USER}
USER ${CONTAINER_USER}
WORKDIR /home/${CONTAINER_USER}
# Install rust toolchain(s) with extra crates
ENV PATH=${PATH}:/home/${CONTAINER_USER}/.cargo/bin:/home/${CONTAINER_USER}/opt/bin
# Use LLVM installer
ADD --chown=${CONTAINER_USER}:${CONTAINER_GROUP} \
    https://github.com/esp-rs/rust-build/releases/download/v${XTENSA_TOOLCHAIN_VERSION}/${INSTALL_RUST_TOOLCHAIN} \
    /home/${CONTAINER_USER}/${INSTALL_RUST_TOOLCHAIN}
RUN chmod a+x ${INSTALL_RUST_TOOLCHAIN} \
    && ./${INSTALL_RUST_TOOLCHAIN} \
    --extra-crates "ldproxy cargo-espflash" \
    --clear-cache "YES" \
    --build-target ${ESP_BOARD} \
    --nightly-version ${NIGHTLY_TOOLCHAIN_VERSION} \
    --esp-idf-version ${ESP_IDF_VERSION} \
    --minified-esp-idf "YES" \
    --export-file /home/${CONTAINER_USER}/export-esp.sh
# Activate ESP-IDF and Xtensa Rust toolchain environment
RUN echo "source /home/${CONTAINER_USER}/export-esp.sh > /dev/null 2>&1" >> ~/.bashrc

And then try to compile esp-idf-template project:

$ cargo install cargo-generate \
&& cargo generate --vcs none --git https://github.com/esp-rs/esp-idf-template cargo \
--name rust-project --define mcu=esp32 --define toolchain=esp \
--define espidfver=v4.4 --define std=true \
&& cd rust-project && cargo +esp build

@Threadzless
Copy link

Threadzless commented Jun 3, 2022

The short term solution to this issue is to install openssl v1.1 alongside v3.

wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar xf openssl-1.1.1o.tar.gz
cd openssl-1.1.1o
./config
make
sudo make install
echo 'export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64"' >> ~/.bashrc
source ~/.bashrc

Of course, making the tool chain work with either version of openssl would be more elegant, but I imagine that will take some time.

@georgik
Copy link
Collaborator

georgik commented Jul 22, 2022

@Threadzless Thank you for suggesting the workaround.
If Ubuntu guys don't fix the linking issue till 1.63, we will add the correction to the installation script.

@georgik georgik modified the milestones: v1.62, v1.63 Jul 22, 2022
@georgik
Copy link
Collaborator

georgik commented Aug 22, 2022

@Threadzless we applied solution of similar problem from mac #128 suggested by @stevecheckoway . It seems that it solved the problem also for Linux.

Added flag to build --enable-cargo-native-static: 90baaec

Please, test 1.63.0.1 release: https://github.com/esp-rs/rust-build/releases/tag/v1.63.0.1

@georgik georgik closed this as completed Aug 22, 2022
georgik added a commit that referenced this issue Aug 22, 2022
* ci: bump up version to 1.63.0.1
* Build without linking to homebrew libs (#128)
* Use cargo install for `cargo-generate`
* Change PowerShell `source` references to `.` (#133)
* Fix README link to releases (#112)
* ci: msys build using shallow repo
* ci: cargo on Linux - use static linking due to ssl issues (#68)

Co-authored-by: Stephen Checkoway <s@pahtak.org>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: David Coles <coles.david@gmail.com>
Co-authored-by: Sven-Hendrik Haase <svenstaro@gmail.com>
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

4 participants