mocaccinoOS / mocaccino

:musical_score: where magic happens
69 stars 7 forks source link

sandox failed while compiling rustc (for gnome-chess first package) #44

Open dufresnep opened 2 years ago

dufresnep commented 2 years ago

Luet version:

CPU architecture, OS, and Version:

Linux roxanne 5.10.73-mocaccino #5.10.73-Mocaccino SMP Sun Oct 17 12:00:14 UTC 2021 x86_64 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz GenuineIntel GNU/Linux

Describe the bug

While building my first package (gnome-chess)... 325 packages were building ... problem happened with rustc I presume for firefox-esr...

    rust installed.

        * Applying 1.47.0-ignore-broken-and-non-applicable-tests.patch ...
       patching file src/test/codegen/sparc-struct-abi.rs
       patching file src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
       patching file src/test/run-make-fulldeps/long-linker-command-lines/Makefile
       patching file src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
       patching file src/test/ui/env-funky-keys.rs
       Hunk #1 succeeded at 1 with fuzz 1.
        [ ok ]
        * Applying 1.49.0-gentoo-musl-target-specs.patch ...
        [ ok ]
        * Applying 1.53.0-rustversion-1.0.5.patch ...
        [ ok ]
        * Applying 1.53.0-miri-vergen.patch ...
        [ ok ]
       Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
        * Rust configured with the following flags:

       RUSTFLAGS=
       RUSTFLAGS_BOOTSTRAP=
       RUSTFLAGS_NOT_BOOTSTRAP=
       CFLAGS_i686-unknown-linux-gnu=-m32
       CFLAGS_x86_64-unknown-linux-gnu=-m64

        * config.toml contents:
       changelog-seen = 2
       [llvm]
       download-ci-llvm = false
       optimize = true
       release-debuginfo = false
       assertions = false
       ninja = true
       targets = "X86"
       experimental-targets = ""
       link-shared = false
       [build]
       build-stage = 2
       test-stage = 2
       doc-stage = 2
       build = "x86_64-unknown-linux-gnu"
       host = ["x86_64-unknown-linux-gnu"]
       target = ["i686-unknown-linux-gnu","x86_64-unknown-linux-gnu"]
       cargo = "/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/cargo"
       rustc = "/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustc"
       rustfmt = "/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustfmt"
       docs = false
       compiler-docs = false
       submodules = false
       python = "python3.9"
       locked-deps = true
       vendor = true
       extended = true
       tools = ["cargo",]
       verbose = 2
       sanitizers = false
       profiler = false
       cargo-native-static = false
       [install]
       prefix = "/usr/lib/rust/1.53.0"
       sysconfdir = "etc"
       docdir = "share/doc/rust"
       bindir = "bin"
       libdir = "lib"
       mandir = "share/man"
       [rust]
       # https://github.com/rust-lang/rust/issues/54872
       codegen-units-std = 1
       optimize = true
       debug = false
       debug-assertions = false
       debug-assertions-std = false
       debuginfo-level = 0
       debuginfo-level-rustc = 0
       debuginfo-level-std = 0
       debuginfo-level-tools = 0
       debuginfo-level-tests = 0
       backtrace = true
       incremental = false
       default-linker = "x86_64-pc-linux-gnu-gcc"
       parallel-compiler = false
       channel = "stable"
       description = "gentoo"
       rpath = false
       verbose-tests = true
       optimize-tests = true
       codegen-tests = true
       dist-src = false
       remap-debuginfo = true
       lld = false
       # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
       # https://github.com/rust-lang/rust/issues/74976
       # https://github.com/rust-lang/rust/issues/76526
       deny-warnings = true
       backtrace-on-ice = true
       jemalloc = false
       [dist]
       src-tarball = false
       compression-formats = ["gz"]
       [target.i686-unknown-linux-gnu]
       cc = "x86_64-pc-linux-gnu-gcc"
       cxx = "x86_64-pc-linux-gnu-g++"
       linker = "x86_64-pc-linux-gnu-gcc"
       ar = "x86_64-pc-linux-gnu-ar"
       [target.x86_64-unknown-linux-gnu]
       cc = "x86_64-pc-linux-gnu-gcc"
       cxx = "x86_64-pc-linux-gnu-g++"
       linker = "x86_64-pc-linux-gnu-gcc"
       ar = "x86_64-pc-linux-gnu-ar"

       Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
       running: /var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/cargo build --manifest-path /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/src/bootstrap/Cargo.toml --verbose --locked --frozen
          Compiling proc-macro2 v1.0.24
            Running `/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustc --crate-name build_script_build --edition=2018 /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/vendor/proc-macro2-1.0.24/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=a256cda1382f5913 -C extra-filename=-a256cda1382f5913 --out-dir /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/build/proc-macro2-a256cda1382f5913 -L dependency=/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps --cap-lints allow -Cdebuginfo=2 -C linker=x86_64-pc-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings`
          Compiling unicode-xid v0.2.1
          Compiling syn v1.0.65
          Compiling version_check v0.9.1
            Running `/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustc --crate-name unicode_xid /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/vendor/unicode-xid/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=c078344b72fe454b -C extra-filename=-c078344b72fe454b --out-dir /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps -L dependency=/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps --cap-lints allow -Cdebuginfo=2 -C linker=x86_64-pc-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings`
            Running `/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustc --crate-name build_script_build --edition=2018 /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/vendor/syn-1.0.65/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' -C metadata=46d688fce783eff3 -C extra-filename=-46d688fce783eff3 --out-dir /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/build/syn-46d688fce783eff3 -L dependency=/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps --cap-lints allow -Cdebuginfo=2 -C linker=x86_64-pc-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings`
            Running `/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustc --crate-name version_check /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/vendor/version_check-0.9.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=ba52ab7cd747d25d -C extra-filename=-ba52ab7cd747d25d --out-dir /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps -L dependency=/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps --cap-lints allow -Cdebuginfo=2 -C linker=x86_64-pc-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings`
        * /var/tmp/portage/sys-apps/sandbox-2.24/work/sandbox-2.24/libsandbox/trace.c:do_peekstr():134: failure (Operation not permitted):
        * ISE:do_peekstr:process_vm_readv( * /var/tmp/portage/sys-apps/sandbox-2.24/work/sandbox-2.24/libsandbox/trace.c:do_peekstr():134: failure (Operation not permitted):
        * ISE:do_peekstr:process_vm_readv(472421, 0x00007f56002fcac0{0x00007f560075b010, 0x970}, 1, 0x00007f56002fcad0{0x00007fea8b874690, 0x970}, 1, 0) failed: Operation not permitted
       472418, 0x00007f56004fdac0{0x00007f5600761010, 0x970}, 1, 0x00007f56004fdad0{0x00007f5820e9d690, 0x970}, 1, 0) failed: Operation not permitted
        * /var/tmp/portage/sys-apps/sandbox-2.24/work/sandbox-2.24/libsandbox/trace.c:do_peekstr():134: failure (Operation not permitted):
        * ISE:do_peekstr:process_vm_readv(472424, 0x00007f55fbdfcac0{0x00007f5600758010, 0x970}, 1, 0x00007f55fbdfcad0{0x00007f05f7a70690, 0x970}, 1, 0) failed: Operation not permitted
        * /var/tmp/portage/sys-apps/sandbox-2.24/work/sandbox-2.24/libsandbox/trace.c:do_peekstr():134: failure (Operation not permitted):
        * ISE:do_peekstr:process_vm_readv(472423, 0x00007f55fbffdac0{0x00007f5600758010, 0x970}, 1, 0x00007f55fbffdad0{0x00007fb03016f690, 0x970}, 1, 0) failed: Operation not permitted
       error: could not compile `unicode-xid`

       Caused by:
         process didn't exit successfully: `/var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/rustc --crate-name unicode_xid /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/vendor/unicode-xid/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=c078344b72fe454b -C extra-filename=-c078344b72fe454b --out-dir /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps -L dependency=/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/build/bootstrap/debug/deps --cap-lints allow -Cdebuginfo=2 -C linker=x86_64-pc-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings` (signal: 6, SIGABRT: process abort signal)
       warning: build failed, waiting for other jobs to finish...
       error: build failed
       Traceback (most recent call last):
         File "/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/./x.py", line 27, in <module>
           bootstrap.main()
         File "/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/src/bootstrap/bootstrap.py", line 1191, in main
           bootstrap(help_triggered)
         File "/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/src/bootstrap/bootstrap.py", line 1162, in bootstrap
           build.build_bootstrap()
         File "/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/src/bootstrap/bootstrap.py", line 919, in build_bootstrap
           run(args, env=env, verbose=self.verbose)
         File "/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/src/bootstrap/bootstrap.py", line 153, in run
           raise RuntimeError(err)
       RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.53.0/work/rust-stage0/bin/cargo build --manifest-path /var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src/src/bootstrap/Cargo.toml --verbose --locked --frozen
        * ERROR: dev-lang/rust-1.53.0::gentoo failed (compile phase):
        *   (no error message)
        * 
        * Call stack:
        *     ebuild.sh, line 127:  Called src_compile
        *   environment, line 3736:  Called die
        * The specific snippet of code:
        *       env $(cat "${S}"/config.env) RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die )
        * 
        * If you need support, post the output of `emerge --info '=dev-lang/rust-1.53.0::gentoo'`,
        * the complete build log and the output of `emerge -pqv '=dev-lang/rust-1.53.0::gentoo'`.
        * The complete build log is located at '/var/tmp/portage/dev-lang/rust-1.53.0/temp/build.log'.
        * The ebuild environment file is located at '/var/tmp/portage/dev-lang/rust-1.53.0/temp/environment'.
        * Working directory: '/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src'
        * S: '/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src'
        * Messages for package sys-libs/libomp-12.0.1 merged to /package/:
        * Unable to find kernel sources at /package/usr/src/linux
        * Unable to calculate Linux Kernel version for build, attempting to use running version
        * Messages for package sys-apps/systemd-249.4-r4 merged to /package/:
        * Unable to find kernel sources at /package/usr/src/linux
        * Unable to calculate Linux Kernel version for build, attempting to use running version
        * Messages for package sys-apps/portage-3.0.20-r6 merged to /package/:
        * Unable to find kernel sources at /package/usr/src/linux
        * Unable to calculate Linux Kernel version for build, attempting to use running version
        * Messages for package sys-apps/baselayout-2.7 merged to /package/:
        * You should reboot now to get /run mounted with tmpfs!
        * Messages for package acct-user/systemd-journal-remote-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'systemd-journal-remote' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/systemd-coredump-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'systemd-coredump' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/systemd-network-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'systemd-network' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/systemd-oom-0 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'systemd-oom' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/systemd-resolve-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'systemd-resolve' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/systemd-timesync-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'systemd-timesync' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/polkitd-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'polkitd' ...
        *  - Shell: /bin/false
        * Messages for package dev-libs/nspr-4.30 merged to /package/:
        * User patches applied.
        * Messages for package acct-user/messagebus-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'messagebus' ...
        *  - Shell: /bin/false
        * Messages for package app-text/libpaper-1.1.28 merged to /package/:
        * run e.g. "paperconfig -p letter" as root to use letter-pagesizes
        * Messages for package acct-user/unbound-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'unbound' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/portage-0 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'portage' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/sshd-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'sshd' ...
        *  - Shell: /bin/false
        * Messages for package media-fonts/urw-fonts-2.4.9 merged to /package/:
        * If you upgraded from urw-fonts-2.1-r2 some fonts will look a bit
        * different. Take a look at bug #208990 if interested.
        * Messages for package acct-user/avahi-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'avahi' ...
        *  - Shell: /bin/false
        * Messages for package acct-user/avahi-autoipd-0-r1 merged to /package/:
        * Unable to identify the shell to use, proceeding with userland default.
        * Updating shell for user 'avahi-autoipd' ...
        *  - Shell: /bin/false
        * Messages for package sys-apps/keyutils-1.6.1 merged to /package/:
        * Unable to find kernel sources at /package/usr/src/linux
        * Unable to calculate Linux Kernel version for build, attempting to use running version
        * Messages for package media-fonts/liberation-fonts-2.1.3 merged to /package/:
        * The following fontconfig configuration files have been installed:
        * 
        *   60-liberation.conf
        * 
        * Use `eselect fontconfig` to enable/disable them.
        * Messages for package dev-lang/rust-1.53.0:
        * ERROR: dev-lang/rust-1.53.0::gentoo failed (compile phase):
        *   (no error message)
        * 
        * Call stack:
        *     ebuild.sh, line 127:  Called src_compile
        *   environment, line 3736:  Called die
        * The specific snippet of code:
        *       env $(cat "${S}"/config.env) RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die )
        * 
        * If you need support, post the output of `emerge --info '=dev-lang/rust-1.53.0::gentoo'`,
        * the complete build log and the output of `emerge -pqv '=dev-lang/rust-1.53.0::gentoo'`.
        * The complete build log is located at '/var/tmp/portage/dev-lang/rust-1.53.0/temp/build.log'.
        * The ebuild environment file is located at '/var/tmp/portage/dev-lang/rust-1.53.0/temp/environment'.
        * Working directory: '/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src'
        * S: '/var/tmp/portage/dev-lang/rust-1.53.0/work/rustc-1.53.0-src'
 INFO   The command '/bin/sh -c emerge --root /package games-board/gnome-chess' returned a non-zero code: 1
  ERROR    Error: failed building package image: Could not push image: quay.io/mocaccinocache/desktop:c9117b4edce74112f66d8291a4ddc8711e14959ba6b34a537613ae9eedb4b1f8 gnome-chess-apps-0.1.dockerfile: Could not build image: quay.io/mocaccinocache/desktop:c9117b4edce74112f66d8291a4ddc8711e14959ba6b34a537613ae9eedb4b1f8 gnome-chess-apps-0.1.dockerfile: Failed running command: : exit status 1
  ERROR    Bailing out

To Reproduce

Expected behavior

Logs

Additional context

dufresnep commented 2 years ago

about: https://forums.gentoo.org/posting.php?mode=quote&p=8442934&sid=663d5e7e20adb891817f20fea9809a3d Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")

dufresnep commented 2 years ago

https://forums.gentoo.org/viewtopic-t-1125304-start-0.html will try: docker run --cap-add=SYS_PTRACE

oh... it must be called with the "image" to be run... so I don't know where to put that.

mudler commented 2 years ago

you should be able by disabling the "ipc-sandbox network-sandbox pid-sandbox" features. Sandbox isn't really needed as the build is already happening in a container

LinuxUserGD commented 2 years ago

https://forums.gentoo.org/viewtopic-t-1125304-start-0.html will try: docker run --cap-add=SYS_PTRACE

oh... it must be called with the "image" to be run... so I don't know where to put that.

Maybe try to add FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox" to /etc/portage/make.conf (standard filesystem) if all docker containers share the same global config files.

Edit: It installed rust-bin instead of compiling rust but failed at last docker stage (see https://github.com/mocaccinoOS/mocaccino/issues/51 for different issue).