Loading pkgs/by-name/wi/wild/adapterTest.nix 0 → 100644 +99 −0 Original line number Diff line number Diff line { lib, stdenv, makeBinaryWrapper, gcc, wild, binutils-unwrapped-all-targets, clang, lld, clang-tools, }: let # These wrappers are REQUIRED for the Wild test suite to pass # # Write a wrapper for GCC that passes -B to *unwrapped* binutils. # This ensures that if -fuse-ld=bfd is used, gcc picks up unwrapped ld.bfd # instead of the hardcoded wrapper search directory. # We pass it last because apparently gcc likes picking ld from the *first* -B, # which we want our wild target directory to be if passed. gccWrapper = stdenv.mkDerivation { inherit (gcc) name; dontUnpack = true; dontConfigure = true; dontInstall = true; buildInputs = [ makeBinaryWrapper ]; buildPhase = '' runHook preBuild makeWrapper ${lib.getExe gcc} $out/bin/gcc \ --append-flag -B${binutils-unwrapped-all-targets}/bin runHook postBuild ''; }; gppWrapper = stdenv.mkDerivation { dontUnpack = true; dontConfigure = true; dontInstall = true; name = "g++-wrapped"; buildInputs = [ makeBinaryWrapper ]; buildPhase = '' runHook preBuild makeWrapper ${lib.getExe' gcc "g++"} $out/bin/g++ \ --append-flag -B${binutils-unwrapped-all-targets}/bin runHook postBuild ''; }; in { testWild = wild.overrideAttrs { pname = "wild-tests"; doCheck = true; doInstallCheck = false; dontBuild = true; buildType = "debug"; checkInputs = [ stdenv.cc.libc.out stdenv.cc.libc.static ]; # https://github.com/davidlattimore/wild/discussions/832#discussioncomment-14482948 checkFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "--skip=integration_test::program_name_71___unresolved_symbols_object_c__" ]; # wild's tests compare the outputs of several different linkers. nixpkgs's # patching and wrappers change the output behavior, so we must make sure # that their behavior is compatible. # # Does not work if they are put in nativeCheckInputs or checkInputs preCheck = '' export LD_LIBRARY_PATH=${ lib.makeLibraryPath [ stdenv.cc.cc.lib ] }:$LD_LIBRARY_PATH export PATH=${ lib.makeBinPath [ binutils-unwrapped-all-targets clang gccWrapper gppWrapper lld clang-tools ] }:$PATH ''; installPhase = "touch $out"; }; } pkgs/by-name/wi/wild/package.nix 0 → 100644 +60 −0 Original line number Diff line number Diff line { lib, fetchFromGitHub, callPackage, versionCheckHook, rustPlatform, pkg-config, zstd, nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "wild"; version = "0.7.0"; src = fetchFromGitHub { owner = "davidlattimore"; repo = "wild"; tag = finalAttrs.version; hash = "sha256-x0IZuWjj0LRMj4pu2FVaD8SENm/UVtE1e4rl0EOZZZM="; }; cargoHash = "sha256-5s0qS8y0+EH+R1tgN2W5/+t+GdjbQdRVLlcA2KjpHsE="; cargoBuildFlags = [ "-p wild-linker" ]; strictDeps = true; nativeBuildInputs = [ pkg-config ]; buildInputs = [ zstd ]; env.ZSTD_SYS_USE_PKG_CONFIG = true; doCheck = false; # Tests are ran in passthru tests doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgramArg = "--version"; passthru = { updateScript = nix-update-script { }; tests = callPackage ./adapterTest.nix { wild = finalAttrs.finalPackage; }; }; meta = { description = "Very fast linker for Linux"; homepage = "https://github.com/davidlattimore/wild"; changelog = "https://github.com/davidlattimore/wild/blob/${finalAttrs.version}/CHANGELOG.md"; license = [ lib.licenses.asl20 # or lib.licenses.mit ]; mainProgram = "wild"; maintainers = with lib.maintainers; [ RossSmyth ]; platforms = lib.platforms.linux; }; }) Loading
pkgs/by-name/wi/wild/adapterTest.nix 0 → 100644 +99 −0 Original line number Diff line number Diff line { lib, stdenv, makeBinaryWrapper, gcc, wild, binutils-unwrapped-all-targets, clang, lld, clang-tools, }: let # These wrappers are REQUIRED for the Wild test suite to pass # # Write a wrapper for GCC that passes -B to *unwrapped* binutils. # This ensures that if -fuse-ld=bfd is used, gcc picks up unwrapped ld.bfd # instead of the hardcoded wrapper search directory. # We pass it last because apparently gcc likes picking ld from the *first* -B, # which we want our wild target directory to be if passed. gccWrapper = stdenv.mkDerivation { inherit (gcc) name; dontUnpack = true; dontConfigure = true; dontInstall = true; buildInputs = [ makeBinaryWrapper ]; buildPhase = '' runHook preBuild makeWrapper ${lib.getExe gcc} $out/bin/gcc \ --append-flag -B${binutils-unwrapped-all-targets}/bin runHook postBuild ''; }; gppWrapper = stdenv.mkDerivation { dontUnpack = true; dontConfigure = true; dontInstall = true; name = "g++-wrapped"; buildInputs = [ makeBinaryWrapper ]; buildPhase = '' runHook preBuild makeWrapper ${lib.getExe' gcc "g++"} $out/bin/g++ \ --append-flag -B${binutils-unwrapped-all-targets}/bin runHook postBuild ''; }; in { testWild = wild.overrideAttrs { pname = "wild-tests"; doCheck = true; doInstallCheck = false; dontBuild = true; buildType = "debug"; checkInputs = [ stdenv.cc.libc.out stdenv.cc.libc.static ]; # https://github.com/davidlattimore/wild/discussions/832#discussioncomment-14482948 checkFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "--skip=integration_test::program_name_71___unresolved_symbols_object_c__" ]; # wild's tests compare the outputs of several different linkers. nixpkgs's # patching and wrappers change the output behavior, so we must make sure # that their behavior is compatible. # # Does not work if they are put in nativeCheckInputs or checkInputs preCheck = '' export LD_LIBRARY_PATH=${ lib.makeLibraryPath [ stdenv.cc.cc.lib ] }:$LD_LIBRARY_PATH export PATH=${ lib.makeBinPath [ binutils-unwrapped-all-targets clang gccWrapper gppWrapper lld clang-tools ] }:$PATH ''; installPhase = "touch $out"; }; }
pkgs/by-name/wi/wild/package.nix 0 → 100644 +60 −0 Original line number Diff line number Diff line { lib, fetchFromGitHub, callPackage, versionCheckHook, rustPlatform, pkg-config, zstd, nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "wild"; version = "0.7.0"; src = fetchFromGitHub { owner = "davidlattimore"; repo = "wild"; tag = finalAttrs.version; hash = "sha256-x0IZuWjj0LRMj4pu2FVaD8SENm/UVtE1e4rl0EOZZZM="; }; cargoHash = "sha256-5s0qS8y0+EH+R1tgN2W5/+t+GdjbQdRVLlcA2KjpHsE="; cargoBuildFlags = [ "-p wild-linker" ]; strictDeps = true; nativeBuildInputs = [ pkg-config ]; buildInputs = [ zstd ]; env.ZSTD_SYS_USE_PKG_CONFIG = true; doCheck = false; # Tests are ran in passthru tests doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgramArg = "--version"; passthru = { updateScript = nix-update-script { }; tests = callPackage ./adapterTest.nix { wild = finalAttrs.finalPackage; }; }; meta = { description = "Very fast linker for Linux"; homepage = "https://github.com/davidlattimore/wild"; changelog = "https://github.com/davidlattimore/wild/blob/${finalAttrs.version}/CHANGELOG.md"; license = [ lib.licenses.asl20 # or lib.licenses.mit ]; mainProgram = "wild"; maintainers = with lib.maintainers; [ RossSmyth ]; platforms = lib.platforms.linux; }; })