Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • redox redox
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 226
    • Issues 226
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • redoxredox
  • Issues
  • #1336
Closed
Open
Created Apr 18, 2021 by ogkloo@ogkloo1 of 1 task completed1/1 task

Docker build fails on NixOS

  • I agree that I have searched opened and closed issues to prevent duplicates.

I'm on NixOS, which is unsupported at the moment. I started to write up a shell for it, but decided to first try building the project with docker.

Edit

Modified the docker run command:

$ docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \                                               
    --security-opt seccomp=unconfined --security-opt apparmor=unconfined \
    -e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
    -v redox-1000-100-cargo:/run/current-system/sw/bin/cargo \
    -v redox-"$(id -u)-$(id -g)"-rustup:/run/current-system/sw/bin/rustup \
    -v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make all

Which results in:

Changing user id:group to 1000:100. Please wait...
info: syncing channel updates for 'nightly-2020-07-27-x86_64-unknown-linux-gnu'
info: latest update on 2020-07-27, rust version 1.47.0-nightly (6c8927b0c 2020-07-26)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
mk/depends.mk:18: *** xargo 0.3.20 not found, run "cargo install --force --version 0.3.20 xargo".  Stop.

So I installed xargo as per instructions:

$ cargo install --force --version 0.3.20 xargo

And ran it again with the same output. Running the container interactively and then installing the correct version of xargo there seems to result in a different error related to relibc. So now I'm trying to rebuild the container but am held up by a problem with apt.

Description

When attempting to build using Docker on NixOS as per instructions in docker/, the build fails with:

$ docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \                                                                                                                                                                                                                          
    -e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
    -v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
    -v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
    -v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all
cargo build --manifest-path cookbook/Cargo.toml --release
error: override toolchain '/home/user/redox/prefix/x86_64-unknown-redox/relibc-install' is not installed
info: caused by: the RUSTUP_TOOLCHAIN environment variable specifies an uninstalled toolchain
Makefile:44: recipe for target 'fetch' failed
make: *** [fetch] Error 1

I attempted to run the docker container interactively, ./bootstrap.sh -d, and then make fetch all. This fails with the same error as above. make all also fails with these panics:

thread 'main' panicked at 'unexpected -vV format', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.1.7/src/lib.rs:126:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'unexpected -vV format', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.1.7/src/lib.rs:126:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'unexpected -vV format', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.1.7/src/lib.rs:126:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'unexpected -vV format', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.1.7/src/lib.rs:126:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'unexpected -vV format', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.1.7/src/lib.rs:Makefile:178: recipe for target '"target/x86_64-unknown-redox"/release/crt0.o' failed
126make[1]: *** ["target/x86_64-unknown-redox"/release/crt0.o] Error 101
:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Environment info

Docker version 19.03.12, build v19.03.12

NixOS version 20.09

Nix version 2.3.10

Steps to reproduce

  1. Run git clone https://gitlab.redox-os.org/redox-os/redox.git ; cd redox
  2. Then
$ git pull --rebase --recurse-submodules && git submodule sync \
    && git submodule update --recursive --init
  1. Run Docker container
$ docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
    -e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
    -v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
    -v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
    -v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all

Behavior

  • Expected behavior: Builds Redox
  • Actual behavior: Fails as above.
Edited Apr 21, 2021 by ogkloo
Assignee
Assign to
Time tracking