lol

Merge pull request #230191 from Artturin/cleanuptests1

tests.rustCustomSysroot: remove unmaintained and broken by upstream test

authored by

Weijia Wang and committed by
GitHub
d3d531c5 2b8f1156

+5 -66
+5 -5
pkgs/test/cc-wrapper/multilib.nix
··· 10 10 NIX_DEBUG=1 $CC -v 11 11 NIX_DEBUG=1 $CXX -v 12 12 13 - printf "checking whether compiler builds valid C binaries... " >&2 13 + printf "checking whether compiler builds valid C binaries...\n " >&2 14 14 $CC -o cc-check ${./cc-main.c} 15 15 ./cc-check 16 16 17 - printf "checking whether compiler builds valid 32bit C binaries... " >&2 17 + printf "checking whether compiler builds valid 32bit C binaries...\n " >&2 18 18 $CC -m32 -o c32-check ${./cc-main.c} 19 19 ./c32-check 20 20 21 - printf "checking whether compiler builds valid 64bit C binaries... " >&2 21 + printf "checking whether compiler builds valid 64bit C binaries...\n " >&2 22 22 $CC -m64 -o c64-check ${./cc-main.c} 23 23 ./c64-check 24 24 25 - printf "checking whether compiler builds valid 32bit C++ binaries... " >&2 25 + printf "checking whether compiler builds valid 32bit C++ binaries...\n " >&2 26 26 $CXX -m32 -o cxx32-check ${./cxx-main.cc} 27 27 ./cxx32-check 28 28 29 - printf "checking whether compiler builds valid 64bit C++ binaries... " >&2 29 + printf "checking whether compiler builds valid 64bit C++ binaries...\n " >&2 30 30 $CXX -m64 -o cxx64-check ${./cxx-main.cc} 31 31 ./cxx64-check 32 32
-1
pkgs/test/default.nix
··· 53 53 54 54 pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }); 55 55 56 - rustCustomSysroot = callPackage ./rust-sysroot {}; 57 56 buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { }; 58 57 importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { }; 59 58
-60
pkgs/test/rust-sysroot/default.nix
··· 1 - { lib, rust, rustPlatform, fetchFromGitHub }: 2 - 3 - let 4 - mkBlogOsTest = target: rustPlatform.buildRustPackage rec { 5 - name = "blog_os-sysroot-test"; 6 - 7 - src = fetchFromGitHub { 8 - owner = "phil-opp"; 9 - repo = "blog_os"; 10 - rev = "4e38e7ddf8dd021c3cd7e4609dfa01afb827797b"; 11 - sha256 = "0k9ipm9ddm1bad7bs7368wzzp6xwrhyfzfpckdax54l4ffqwljcg"; 12 - }; 13 - 14 - cargoSha256 = "1x8iwgy1irgfkv2yjkxm6479nwbrk82b0c80jm7y4kw0s32r01lg"; 15 - 16 - inherit target; 17 - 18 - RUSTFLAGS = "-C link-arg=-nostartfiles"; 19 - 20 - # Tests don't work for `no_std`. See https://os.phil-opp.com/testing/ 21 - doCheck = false; 22 - 23 - meta = with lib; { 24 - description = "Test for using custom sysroots with buildRustPackage"; 25 - maintainers = with maintainers; [ aaronjanse ]; 26 - platforms = lib.platforms.x86_64; 27 - }; 28 - }; 29 - 30 - # The book uses rust-lld for linking, but rust-lld is not currently packaged for NixOS. 31 - # The justification in the book for using rust-lld suggests that gcc can still be used for testing: 32 - # > Instead of using the platform's default linker (which might not support Linux targets), 33 - # > we use the cross platform LLD linker that is shipped with Rust for linking our kernel. 34 - # https://github.com/phil-opp/blog_os/blame/7212ffaa8383122b1eb07fe1854814f99d2e1af4/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md#L157 35 - targetContents = { 36 - "llvm-target" = "x86_64-unknown-none"; 37 - "data-layout" = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"; 38 - "arch" = "x86_64"; 39 - "target-endian" = "little"; 40 - "target-pointer-width" = "64"; 41 - "target-c-int-width" = "32"; 42 - "os" = "none"; 43 - "executables" = true; 44 - "linker-flavor" = "gcc"; 45 - "panic-strategy" = "abort"; 46 - "disable-redzone" = true; 47 - "features" = "-mmx,-sse,+soft-float"; 48 - }; 49 - 50 - in { 51 - blogOS-targetByFile = mkBlogOsTest (builtins.toFile "x86_64-blog_os.json" (builtins.toJSON targetContents)); 52 - blogOS-targetByNix = let 53 - plat = lib.systems.elaborate { config = "x86_64-none"; } // { 54 - rustc = { 55 - config = "x86_64-blog_os"; 56 - platform = targetContents; 57 - }; 58 - }; 59 - in mkBlogOsTest (rust.toRustTargetSpec plat); 60 - }