Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvmPackages_git: switch to using ninja #218620

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pkgs/development/compilers/llvm/git/clang/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, llvm_meta
, monorepoSrc, runCommand
, substituteAll, cmake, libxml2, libllvm, version, python3
, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
, buildLlvmTools
, fixDarwinDylibNames
, enableManpages ? false
Expand All @@ -20,7 +20,7 @@ let

sourceRoot = "${src.name}/${pname}";

nativeBuildInputs = [ cmake python3 ]
nativeBuildInputs = [ cmake ninja python3 ]
++ lib.optional enableManpages python3.pkgs.sphinx
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;

Expand Down Expand Up @@ -112,9 +112,7 @@ let
} // lib.optionalAttrs enableManpages {
pname = "clang-manpages";

buildPhase = ''
make docs-clang-man
'';
ninjaFlags = [ "docs-clang-man" ];

installPhase = ''
mkdir -p $out/share/man/man1
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/git/compiler-rt/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, llvm_meta, version
, monorepoSrc, runCommand
, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt
, cmake, ninja, python3, xcbuild, libllvm, libcxxabi, libxcrypt
, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
}:

Expand All @@ -27,7 +27,7 @@ stdenv.mkDerivation {
inherit src;
sourceRoot = "${src.name}/${baseName}";

nativeBuildInputs = [ cmake python3 libllvm.dev ]
nativeBuildInputs = [ cmake ninja python3 libllvm.dev ]
++ lib.optional stdenv.isDarwin xcbuild.xcrun;
buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;

Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/compilers/llvm/git/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lowPrio, newScope, pkgs, lib, stdenv, cmake
{ lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
, gccForLibs, preLibcCrossHeaders
, libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
Expand Down Expand Up @@ -40,7 +40,7 @@ let
};

tools = lib.makeExtensible (tools: let
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version monorepoSrc buildLlvmTools; });
callPackage = newScope (tools // { inherit stdenv cmake ninja libxml2 python3 isl release_version version monorepoSrc buildLlvmTools; });
mkExtraBuildCommands0 = cc: ''
rsrc="$out/resource-root"
mkdir "$rsrc"
Expand Down Expand Up @@ -220,7 +220,7 @@ let
});

libraries = lib.makeExtensible (libraries: let
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version monorepoSrc; });
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake ninja libxml2 python3 isl release_version version monorepoSrc; });
in {

compiler-rt-libc = callPackage ./compiler-rt {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/compilers/llvm/git/libcxx/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, llvm_meta
, monorepoSrc, runCommand
, cmake, python3, fixDarwinDylibNames, version
, cmake, ninja, python3, fixDarwinDylibNames, version
, cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi
, libcxxabi, libcxxrt
, enableShared ? !stdenv.hostPlatform.isStatic
Expand Down Expand Up @@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
patchShebangs utils/cat_files.py
'';

nativeBuildInputs = [ cmake python3 ]
nativeBuildInputs = [ cmake ninja python3 ]
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;

buildInputs = lib.optionals (!headersOnly) [ cxxabi ];
Expand All @@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";

buildFlags = lib.optional headersOnly "generate-cxx-headers";
ninjaFlags = lib.optional headersOnly "generate-cxx-headers";
installTargets = lib.optional headersOnly "install-cxx-headers";

preInstall = lib.optionalString (stdenv.isDarwin && !headersOnly) ''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/git/libcxxabi/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, cmake, python3
{ lib, stdenv, llvm_meta, cmake, ninja, python3
, monorepoSrc, runCommand, fetchpatch
, cxx-headers, libunwind, version
, enableShared ? !stdenv.hostPlatform.isStatic
Expand Down Expand Up @@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
cd ../runtimes
'';

nativeBuildInputs = [ cmake python3 ];
nativeBuildInputs = [ cmake ninja python3 ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isWasm) libunwind;

cmakeFlags = [
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/git/libunwind/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib, stdenv, llvm_meta, version
, monorepoSrc, runCommand
, cmake
, ninja
, python3
, enableShared ? !stdenv.hostPlatform.isStatic
}:
Expand Down Expand Up @@ -41,7 +42,7 @@ stdenv.mkDerivation rec {

outputs = [ "out" "dev" ];

nativeBuildInputs = [ cmake python3 ];
nativeBuildInputs = [ cmake ninja python3 ];

cmakeFlags = [
"-DLLVM_ENABLE_RUNTIMES=libunwind"
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/git/lld/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, buildLlvmTools
, monorepoSrc, runCommand
, cmake
, ninja
, libxml2
, libllvm
, version
Expand All @@ -27,7 +28,7 @@ stdenv.mkDerivation rec {
./gnu-install-dirs.patch
];

nativeBuildInputs = [ cmake ];
nativeBuildInputs = [ cmake ninja ];
buildInputs = [ libllvm libxml2 ];

cmakeFlags = [
Expand Down
7 changes: 3 additions & 4 deletions pkgs/development/compilers/llvm/git/lldb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, runCommand
, monorepoSrc
, cmake
, ninja
, zlib
, ncurses
, swig
Expand Down Expand Up @@ -49,7 +50,7 @@ stdenv.mkDerivation (rec {
outputs = [ "out" "lib" "dev" ];

nativeBuildInputs = [
cmake python3 which swig lit makeWrapper lua5_3
cmake ninja python3 which swig lit makeWrapper lua5_3
] ++ lib.optionals enableManpages [
python3.pkgs.sphinx python3.pkgs.recommonmark
];
Expand Down Expand Up @@ -120,9 +121,7 @@ stdenv.mkDerivation (rec {
} // lib.optionalAttrs enableManpages {
pname = "lldb-manpages";

buildPhase = ''
make docs-lldb-man
'';
ninjaFlags = [ "docs-lldb-man" ];

propagatedBuildInputs = [];

Expand Down
14 changes: 5 additions & 9 deletions pkgs/development/compilers/llvm/git/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, runCommand
, fetchpatch
, cmake
, ninja
, python3
, libffi
, enableGoldPlugin ? (!stdenv.isDarwin && !stdenv.targetPlatform.isWasi)
Expand Down Expand Up @@ -50,7 +51,7 @@ in stdenv.mkDerivation (rec {

outputs = [ "out" "lib" "dev" "python" ];

nativeBuildInputs = [ cmake python3 ]
nativeBuildInputs = [ cmake ninja python3 ]
++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];

buildInputs = [ libxml2 libffi ]
Expand Down Expand Up @@ -103,7 +104,7 @@ in stdenv.mkDerivation (rec {
preConfigure = ''
# Workaround for configure flags that need to have spaces
cmakeFlagsArray+=(
-DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar'
-DLLVM_LIT_ARGS="-svj''${NIX_BUILD_CORES} --no-progress-bar"
)
'';

Expand Down Expand Up @@ -245,15 +246,10 @@ in stdenv.mkDerivation (rec {
} // lib.optionalAttrs enableManpages {
pname = "llvm-manpages";

buildPhase = ''
make docs-llvm-man
'';

propagatedBuildInputs = [];

installPhase = ''
make -C docs install
'';
ninjaFlags = [ "docs-llvm-man" ];
installTargets = [ "install-docs-llvm-man" ];

postPatch = null;
postInstall = null;
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/llvm/git/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, monorepoSrc
, runCommand
, cmake
, ninja
, llvm
, lit
, clang-unwrapped
Expand Down Expand Up @@ -32,7 +33,7 @@ stdenv.mkDerivation rec {

outputs = [ "out" "dev" ];

nativeBuildInputs = [ cmake perl pkg-config lit ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [ llvm ];

# Unsup:Pass:XFail:Fail
Expand Down