forked from rarias/jungle
Compare commits
5 Commits
dd7f24f455
...
1fba0a14a8
Author | SHA1 | Date | |
---|---|---|---|
1fba0a14a8 | |||
d6621e939a | |||
67726c1d44 | |||
a971ed6a54 | |||
06581e455c |
@ -12,4 +12,9 @@ jobs:
|
||||
runs-on: native
|
||||
steps:
|
||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
||||
- run: nix build -L --no-link --print-out-paths .#bsc-ci.all
|
||||
- run: nix build -L --no-link --print-out-paths .#bsc.ci.all
|
||||
build:cross:
|
||||
runs-on: native
|
||||
steps:
|
||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
||||
- run: nix build -L --no-link --print-out-paths .#bsc.ci.cross
|
||||
|
@ -42,9 +42,7 @@ in
|
||||
# full nixpkgs with our overlay applied
|
||||
legacyPackages.${system} = pkgs;
|
||||
|
||||
hydraJobs = {
|
||||
inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross;
|
||||
};
|
||||
hydraJobs = self.legacyPackages.${system}.bsc.hydraJobs;
|
||||
|
||||
# propagate nixpkgs lib, so we can do bscpkgs.lib
|
||||
inherit (nixpkgs) lib;
|
||||
|
51
overlay.nix
51
overlay.nix
@ -94,12 +94,18 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
pkgs = filterAttrs (_: isDerivation) bscPkgs;
|
||||
# For now, only build toplevel packages in CI/Hydra
|
||||
pkgsTopLevel = filterAttrs (_: isDerivation) bscPkgs;
|
||||
|
||||
crossTargets = [ "riscv64" ];
|
||||
cross = prev.lib.genAttrs crossTargets (target:
|
||||
final.pkgsCross.${target}.bsc-ci.pkgs
|
||||
);
|
||||
# Native build in that platform doesn't imply cross build works
|
||||
canCrossCompile = platform: pkg:
|
||||
(isDerivation pkg) &&
|
||||
# Must be defined explicitly
|
||||
(pkg.meta.cross or false) &&
|
||||
(meta.availableOn platform pkg);
|
||||
|
||||
# For now only RISC-V
|
||||
crossSet = { riscv64 = final.pkgsCross.riscv64.bsc.pkgsTopLevel; };
|
||||
|
||||
buildList = name: paths:
|
||||
final.runCommandLocal name { } ''
|
||||
@ -113,22 +119,31 @@ let
|
||||
printf '%s\n' $deps >$out
|
||||
'';
|
||||
|
||||
crossList = builtins.mapAttrs (t: v: buildList t (builtins.attrValues v)) cross;
|
||||
|
||||
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgs);
|
||||
testList = buildList "ci-tests" (collect isDerivation tests);
|
||||
|
||||
all = buildList' "ci-all" [ pkgsList testList ];
|
||||
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgsTopLevel);
|
||||
testsList = buildList "ci-tests" (collect isDerivation tests);
|
||||
allList = buildList' "ci-all" [ pkgsList testsList ];
|
||||
# For now only RISC-V
|
||||
crossList = buildList "ci-cross"
|
||||
(filter
|
||||
(canCrossCompile final.pkgsCross.riscv64.stdenv.hostPlatform)
|
||||
(builtins.attrValues crossSet.riscv64));
|
||||
|
||||
in bscPkgs // {
|
||||
# Prevent accidental usage of bsc attribute
|
||||
bsc = throw "the bsc attribute is deprecated, packages are now in the root";
|
||||
# Prevent accidental usage of bsc-ci attribute
|
||||
bsc-ci = throw "the bsc-ci attribute is deprecated, use bsc.ci";
|
||||
|
||||
# Internal for our CI tests
|
||||
bsc-ci = {
|
||||
inherit pkgs pkgsList;
|
||||
inherit tests testList;
|
||||
inherit cross crossList;
|
||||
inherit all;
|
||||
bsc = {
|
||||
# CI targets for nix build
|
||||
ci = { pkgs = pkgsList; tests = testsList; all = allList; cross = crossList; };
|
||||
|
||||
# Direct access to package sets
|
||||
tests = tests;
|
||||
pkgs = bscPkgs;
|
||||
pkgsTopLevel = pkgsTopLevel;
|
||||
cross = crossSet;
|
||||
|
||||
# Hydra uses attribute sets of pkgs
|
||||
hydraJobs = { tests = tests; pkgs = pkgsTopLevel; cross = crossSet; };
|
||||
};
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#, python3Packages
|
||||
, installShellFiles
|
||||
, symlinkJoin
|
||||
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
|
||||
}:
|
||||
|
||||
let
|
||||
@ -87,7 +88,7 @@ stdenv.mkDerivation rec {
|
||||
--enable-sampling
|
||||
--with-unwind=${libunwind.dev}
|
||||
--with-xml-prefix=${libxml2.dev}
|
||||
--with-papi=${papi}
|
||||
${lib.optionalString enablePapi "--with-papi=${papi}"}
|
||||
${if (mpi != null) then ''--with-mpi=${mpi}''
|
||||
else ''--without-mpi''}
|
||||
--without-dyninst)
|
||||
|
@ -35,6 +35,8 @@ stdenv.mkDerivation rec {
|
||||
CFLAGS=-Wno-implicit-int
|
||||
CPPFLAGS=-I${libtirpc.dev}/include/tirpc
|
||||
LDFLAGS=-ltirpc
|
||||
CC=$CC
|
||||
AR=$AR
|
||||
)
|
||||
'';
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
, jemallocNanos6 ? null
|
||||
, cachelineBytes ? 64
|
||||
, enableGlibcxxDebug ? false
|
||||
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
|
||||
, useGit ? false
|
||||
, gitUrl ? "ssh://git@bscpm04.bsc.es/nanos6/nanos6"
|
||||
, gitBranch ? "master"
|
||||
@ -47,6 +48,8 @@ let
|
||||
};
|
||||
|
||||
source = if (useGit) then git else release;
|
||||
|
||||
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
||||
in
|
||||
stdenv.mkDerivation (source // {
|
||||
pname = "nanos6";
|
||||
@ -71,9 +74,13 @@ in
|
||||
"--disable-all-instrumentations"
|
||||
"--enable-ovni-instrumentation"
|
||||
"--with-ovni=${ovni}"
|
||||
"--with-boost=${boost.dev}"
|
||||
] ++
|
||||
(optional enableJemalloc "--with-jemalloc=${jemallocNanos6}") ++
|
||||
(optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG");
|
||||
(optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG") ++
|
||||
# Most nanos6 api symbols are resolved at runtime, so prefer
|
||||
# ifunc by default
|
||||
(optional isCross "--with-symbol-resolution=ifunc");
|
||||
|
||||
postConfigure = lib.optionalString (!enableDebug) ''
|
||||
# Disable debug
|
||||
@ -97,16 +104,14 @@ in
|
||||
# TODO: papi_version is needed for configure:
|
||||
# ./configure: line 27378: papi_version: command not found
|
||||
# This probably breaks cross-compilation
|
||||
papi
|
||||
];
|
||||
] ++ lib.optionals enablePapi [ papi ];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
numactl
|
||||
hwloc
|
||||
papi
|
||||
ovni
|
||||
];
|
||||
] ++ lib.optionals enablePapi [ papi ];
|
||||
|
||||
# Create a script that sets NANOS6_HOME
|
||||
postInstall = ''
|
||||
|
@ -7,7 +7,7 @@
|
||||
, numactl
|
||||
, hwloc
|
||||
, papi
|
||||
, enablePapi ? true
|
||||
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
|
||||
, cacheline ? 64 # bits
|
||||
, ovni ? null
|
||||
, useGit ? false
|
||||
|
@ -55,4 +55,7 @@ in
|
||||
doCheck = true;
|
||||
checkTarget = "test";
|
||||
hardeningDisable = [ "all" ];
|
||||
meta = {
|
||||
cross = true;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user