Skip to content

Docker image build errors #1

@slax57

Description

@slax57

Hi!

Following the answer on issue rusty-horizon/rust-examples#2, I tried to build the docker image provided on this repo.

I faced several build errors, which I'll list below:

#27 11.41 The following packages have unmet dependencies:
#27 11.53  cmake : Depends: libcurl3 (>= 7.16.2) but it is not installable
#27 11.55 E: Unable to correct problems, you have held broken packages.
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c apt-get update && apt-get install -y git && apt-get -t stretch-backports install -y cmake]: runc did not terminate sucessfully
Caused by:
  the `default-run` manifest key is unstable

Caused by:
  feature `default-run` is required

consider adding `cargo-features = ["default-run"]` to the manifest

I workaround those issues the following way:

-RUN apt-get update && apt-get install -y git && apt-get -t stretch-backports install -y cmake
+RUN apt-get update && apt-get install -y git && apt-get install -y cmake
+RUN rustup install nightly
-RUN cargo install xargo
+RUN cargo +nightly install xargo

With all that fixed, I still get the following error, which seems to be very similar as the one raised in rusty-horizon/rust-examples#2:

#22 84.57    Compiling libc v0.2.46
#22 84.57      Running `rustc --crate-name core /root/.rustup/toolchains/nightly-2019-01-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=9ef47930db987ddf -C extra-filename=-9ef47930db987ddf --out-dir /tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps --target aarch64-horizon-elf -L dependency=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps -L dependency=/tmp/xargo.9k9q5jIiywrA/target/release/deps --sysroot /root/.xargo -Z force-unstable-if-unmarked`
#22 84.57      Running `rustc --crate-name build_script_build /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/build.rs --color never --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="align"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="rustc-std-workspace-core"' -C metadata=7a148dd319e2d3ee -C extra-filename=-7a148dd319e2d3ee --out-dir
/tmp/xargo.9k9q5jIiywrA/target/release/build/libc-7a148dd319e2d3ee -L dependency=/tmp/xargo.9k9q5jIiywrA/target/release/deps --cap-lints allow`
#22 85.01      Running `/tmp/xargo.9k9q5jIiywrA/target/release/build/libc-7a148dd319e2d3ee/build-script-build`
#22 100.4    Compiling rustc-std-workspace-core v1.0.0 (/root/.rustup/toolchains/nightly-2019-01-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core)
#22 100.4      Running `rustc --crate-name rustc_std_workspace_core /root/.rustup/toolchains/nightly-2019-01-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=19334507dbe0cd2c -C extra-filename=-19334507dbe0cd2c --out-dir /tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps --target aarch64-horizon-elf -L dependency=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps -L dependency=/tmp/xargo.9k9q5jIiywrA/target/release/deps --extern core=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps/libcore-9ef47930db987ddf.rlib --sysroot /root/.xargo -Z force-unstable-if-unmarked`
#22 100.5      Running `rustc --crate-name libc /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/src/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="align"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="rustc-std-workspace-core"' -C metadata=44dcceef922a5f36 -C extra-filename=-44dcceef922a5f36 --out-dir /tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps --target aarch64-horizon-elf -L dependency=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps -L dependency=/tmp/xargo.9k9q5jIiywrA/target/release/deps --extern rustc_std_workspace_core=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps/librustc_std_workspace_core-19334507dbe0cd2c.rlib --cap-lints allow --sysroot /root/.xargo -Z force-unstable-if-unmarked --cfg core_cvoid`
#22 100.8 error[E0412]: cannot find type `Option` in this scope
#22 100.8    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/src/unix/newlib/mod.rs:723:36
#22 100.8     |
#22 100.8 723 |     pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
#22 100.8     |                                    ^^^^^^ not found in this scope
#22 100.8 help: possible candidates are found in other modules, you can import them into scope
#22 100.8     |
#22 100.8 1   | use core::option::Option;
#22 100.8     |
#22 100.8 1   | use core::prelude::v1::Option;
#22 100.8     |
#22 100.8
#22 100.8 error[E0412]: cannot find type `Option` in this scope
#22 100.8    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/src/unix/newlib/mod.rs:724:35
#22 100.8     |
#22 100.8 724 |                           parent: Option<unsafe extern fn()>,
#22 100.8     |                                   ^^^^^^ not found in this scope
#22 100.8 help: possible candidates are found in other modules, you can import them into scope
#22 100.8     |
#22 100.8 1   | use core::option::Option;
#22 100.8     |
#22 100.8 1   | use core::prelude::v1::Option;
#22 100.8     |
#22 100.8
#22 100.8 error[E0412]: cannot find type `Option` in this scope
#22 100.8    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/src/unix/newlib/mod.rs:725:34
#22 100.8     |
#22 100.8 725 |                           child: Option<unsafe extern fn()>) -> ::c_int;
#22 100.8     |                                  ^^^^^^ not found in this scope
#22 100.8 help: possible candidates are found in other modules, you can import them into scope
#22 100.8     |
#22 100.8 1   | use core::option::Option;
#22 100.8     |
#22 100.8 1   | use core::prelude::v1::Option;
#22 100.8     |
#22 100.8
#22 100.8 error: aborting due to 3 previous errors
#22 100.8
#22 100.8 For more information about this error, try `rustc --explain E0412`.
#22 100.8 error: Could not compile `libc`.
#22 100.8
#22 100.8 Caused by:
#22 100.8   process didn't exit successfully: `rustc --crate-name libc /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.46/src/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="align"' --cfg 'feature="rustc-dep-of-std"' --cfg 'feature="rustc-std-workspace-core"' -C metadata=44dcceef922a5f36 -C extra-filename=-44dcceef922a5f36 --out-dir /tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps --target aarch64-horizon-elf -L dependency=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps -L dependency=/tmp/xargo.9k9q5jIiywrA/target/release/deps --extern rustc_std_workspace_core=/tmp/xargo.9k9q5jIiywrA/target/aarch64-horizon-elf/release/deps/librustc_std_workspace_core-19334507dbe0cd2c.rlib --cap-lints allow --sysroot /root/.xargo -Z force-unstable-if-unmarked --cfg core_cvoid` (exit code: 1)
#22 100.8 error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.9k9q5jIiywrA/Cargo.toml" "--target" "aarch64-horizon-elf" "-v" "-p" "libc"` failed with exit code: Some(101)
#22 100.8 note: run with `RUST_BACKTRACE=1` for a backtrace
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c cd /tmp/sysroot-builder/
&&     xargo build --target aarch64-horizon-elf -vv # rerun]: runc did not terminate sucessfully

I have to admit I don't understand really what I am doing wrong 😬 ...

Any ideas ?

Many thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions