From 1607247a0ad118bec7c242712984f42492c351f3 Mon Sep 17 00:00:00 2001 From: Sam Habiel Date: Fri, 25 Feb 2022 13:22:13 -0700 Subject: [PATCH] [YDBDoc#279] Fix Rust Version in Debian Image (& misc changes) Rust v1.48 (installed from apt in Debian 11) fails as follows when running say_hello_rust: ``` error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.17.0/src/loom/std/mod.rs:29:20 | 29 | pub(crate) use std::hint::spin_loop; | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 for more information error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.17.0/src/loom/std/mod.rs:100:9 | 100 | std::hint::spin_loop(); | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #55002 for more information error[E0658]: use of unstable library feature 'renamed_spin_loop' --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.17.0/src/sync/task/atomic_waker.rs:285:17 | 285 | hint::spin_loop(); | ^^^^^^^^^^^^^^^ | = note: see issue #55002 for more information error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. error: could not compile `tokio`. To learn more, run the command again with --verbose. error: build failed ``` Checking our YDBRust pipeline, our pipeline uses the stable version of Rust (currently v1.59) to run its code. Therefore, I changed this Debian image to install the stable version of Rust. Misc changes: - Remove locales package, and remove US locale. We already use the C.UTF-8 locale, which is fine for YottaDB. Remove LANG and LANGUAGE varaibles, as these are not used by YottaDB. - Remove clang, add gcc, as it's required by go for the tests. gcc must have been implicitly added by other packages removed in the commit. clang isn't needed. - Remove vim, add nano instead. --- Dockerfile-debian | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile-debian b/Dockerfile-debian index 355be5950..b276d5d8d 100644 --- a/Dockerfile-debian +++ b/Dockerfile-debian @@ -93,23 +93,28 @@ RUN apt-get update && \ ca-certificates \ libelf-dev \ libicu-dev \ - locales \ wget \ - vim \ + gcc \ + nano \ procps \ make \ golang \ git \ pkg-config \ - clang \ - cargo \ python3-dev \ python3-setuptools \ libffi-dev \ python3-pip \ && \ apt-get clean -RUN locale-gen en_US.UTF-8 + +# For our Rust Plugin, it doesn't work with Rust 1.48 installed by default on Debian +# Install the latest stable version, per our pipeline in https://gitlab.com/YottaDB/Lang/YDBRust +RUN wget -O rustup-init.sh https://sh.rustup.rs && \ + chmod +x rustup-init.sh && \ + ./rustup-init.sh -y --default-toolchain stable && \ + rm ./rustup-init.sh + WORKDIR /data COPY --from=ydb-release-builder /tmp/yottadb-release /tmp/yottadb-release RUN cd /tmp/yottadb-release \ @@ -120,11 +125,10 @@ RUN cd /tmp/yottadb-release \ --installdir /opt/yottadb/current \ && rm -rf /tmp/yottadb-release ENV ydb_dir=/data \ - LANG=en_US.UTF-8 \ - LANGUAGE=en_US:en \ LC_ALL=C.UTF-8 \ ydb_chset=UTF-8 \ - GOPATH=$HOME/go + GOPATH=$HOME/go \ + EDITOR=/bin/nano # MUPIP RUNDOWN need in the following chain because otherwise ENTRYPOINT complains # about inability to run %XCMD and rundown needed. Cause not known, but this workaround works # and is otherwise benign.