LINBIT / drbd-reactor

Monitors DRBD resources via plugins.
Apache License 2.0
31 stars 8 forks source link

Can not build drbd-reactor on debian buster #6

Closed kvaps closed 2 years ago

kvaps commented 2 years ago

Dockerfile

FROM debian:buster as reactor-builder

ARG REACTOR_GITREPO=https://github.com/LINBIT/drbd-reactor
ARG REACTOR_VERSION=0.6.1

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
 && apt-get -y install build-essential debhelper git cargo rustc dh-python bash-completion \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*

RUN git clone --recurse-submodules ${REACTOR_GITREPO} /drbd-reactor
WORKDIR /drbd-reactor
RUN git reset --hard v${REACTOR_VERSION} \
 && install /dev/null /usr/local/bin/lbvers.py \
 && make debrelease VERSION=${REACTOR_VERSION} \
 && mv drbd-reactor-${REACTOR_VERSION}.tar.gz ../drbd-reactor_${REACTOR_VERSION}.orig.tar.gz \
 && tar -C / -xvf ../drbd-reactor_${REACTOR_VERSION}.orig.tar.gz
WORKDIR /drbd-reactor-${REACTOR_VERSION}
RUN dpkg-buildpackage -us -uc

Output:

cargo build --offline --release
   Compiling proc-macro2 v1.0.37
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.91
   Compiling serde_derive v1.0.136
   Compiling version_check v0.9.4
   Compiling serde v1.0.136
   Compiling libc v0.2.124
   Compiling memchr v2.4.1
   Compiling unicode-width v0.1.9
   Compiling log v0.4.16
   Compiling serde_json v1.0.79
   Compiling unicode-segmentation v1.9.0
   Compiling ryu v1.0.9
   Compiling bitflags v1.3.2
   Compiling itoa v1.0.1
   Compiling anyhow v1.0.57
   Compiling cfg-if v1.0.0
   Compiling signal-hook v0.3.13
   Compiling regex-syntax v0.6.25
   Compiling lazy_static v1.4.0
   Compiling shell-words v1.1.0
   Compiling glob v0.3.0
   Compiling textwrap v0.11.0
   Compiling heck v0.3.3
   Compiling clap v2.34.0
error[E0658]: use of unstable library feature 'matches_macro'
   --> /drbd-reactor-0.6.1/vendor/clap/src/errors.rs:392:10
    |
392 |         !matches!(
    |          ^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/65721

error[E0658]: `if` is not allowed in a `const fn`
  --> /drbd-reactor-0.6.1/vendor/clap/src/app/settings.rs:7:1
   |
7  | / bitflags! {
8  | |     struct Flags: u64 {
9  | |         const SC_NEGATE_REQS       = 1;
10 | |         const SC_REQUIRED          = 1 << 1;
...  |
51 | |     }
52 | | }
   | |_^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/49146
   = note: this error originates in a macro outside of the current crate (in Nightlybuilds, run with -Z external-macro-backtrace for more info)

error[E0658]: `if` is not allowed in a `const fn`
  --> /drbd-reactor-0.6.1/vendor/clap/src/args/settings.rs:6:1
   |
6  | / bitflags! {
7  | |     struct Flags: u32 {
8  | |         const REQUIRED         = 1;
9  | |         const MULTIPLE         = 1 << 1;
...  |
28 | |     }
29 | | }
   | |_^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/49146
   = note: this error originates in a macro outside of the current crate (in Nightlybuilds, run with -Z external-macro-backtrace for more info)

   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling aho-corasick v0.7.18
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `clap`.
warning: build failed, waiting for other jobs to finish...
error: build failed
make[1]: Leaving directory '/drbd-reactor-0.6.1'
make[1]: *** [Makefile:35: build] Error 101
dh_auto_build: make -j1 returned exit code 2
make: *** [debian/rules:4: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
rck commented 2 years ago

needs a newer rust toolchain, upstream fixed in https://github.com/LINBIT/drbd-reactor/commit/10a5fd0e205ec426d72ed6ae4a4922ca81678e86 . Please upgrade your build image