Skip to content

Commit

Permalink
[YDBDoc#279] Fix Rust Version in Debian Image (& misc changes)
Browse files Browse the repository at this point in the history
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 <rust-lang/rust#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 <rust-lang/rust#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 <rust-lang/rust#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.
  • Loading branch information
shabiel committed Feb 25, 2022
1 parent f2f77cc commit 1607247
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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.
Expand Down

0 comments on commit 1607247

Please sign in to comment.