Skip to content
Snippets Groups Projects
Commit c549839f authored by Patrick Baudin's avatar Patrick Baudin
Browse files

Merge branch 'feature/patrick/nix-tests-tarball' into 'master'

[NIX] tests tarball compilation

See merge request frama-c/frama-c!2209
parents dddf3870 483da4ed
No related branches found
No related tags found
No related merge requests found
......@@ -151,6 +151,30 @@ CFP:
tags:
- nix
build-distrib-tarball:
stage: build
variables:
CURRENT: $CI_COMMIT_REF_NAME
DEFAULT: "master"
OCAML: "4_05"
FRAMA_CI_OPT: "--override frama-c:$CI_COMMIT_REF_NAME,$CI_COMMIT_SHA"
script:
- nix/frama-ci.sh build -A frama-c.build-distrib-tarball
tags:
- nix
build-from-distrib-tarball:
stage: tests
variables:
CURRENT: $CI_COMMIT_REF_NAME
DEFAULT: "master"
OCAML: "4_05"
FRAMA_CI_OPT: "--override frama-c:$CI_COMMIT_REF_NAME,$CI_COMMIT_SHA"
script:
- nix/frama-ci.sh build -A frama-c.build-from-distrib-tarball
tags:
- nix
internal:
stage: distrib_and_compatibility
variables:
......
......@@ -2,7 +2,7 @@
{ pkgs, stdenv, src ? ../., opam2nix, ocaml_version ? "ocaml-ng.ocamlPackages_4_05.ocaml", plugins ? { } }:
let mk_buildInputs = { opamPackages ? [] } :
[ pkgs.gnugrep pkgs.gnused pkgs.autoconf pkgs.gnumake pkgs.gcc pkgs.ncurses pkgs.time pkgs.python3 pkgs.perl] ++ opam2nix.build {
[ pkgs.gnugrep pkgs.gnused pkgs.autoconf pkgs.gnumake pkgs.gcc pkgs.ncurses pkgs.time pkgs.python3 pkgs.perl pkgs.file] ++ opam2nix.build {
specs = opam2nix.toSpecs ([ "ocamlfind" "zarith" "ocamlgraph"
{ name = "coq"; constraint = "=8.7.2"; }
] ++ opamPackages ++
......@@ -63,7 +63,7 @@ rec {
lint = stdenv.mkDerivation {
name = "frama-c-lint";
inherit src;
buildInputs = (mk_buildInputs {opamPackages = [ "ocp-indent" ];} ) ++ [ pkgs.bc plugins.headache.installed pkgs.file ];
buildInputs = (mk_buildInputs {opamPackages = [ "ocp-indent" ];} ) ++ [ pkgs.bc plugins.headache.installed ];
outputs = [ "out" ];
postPatch = ''
patchShebangs .
......@@ -105,10 +105,11 @@ rec {
'';
};
distrib = stdenv.mkDerivation {
name = "frama-c-distrib";
build-distrib-tarball = stdenv.mkDerivation {
name = "frama-c-build-distrib-tarball";
inherit src;
buildInputs = buildInputs ++ [ plugins.headache.installed ];
outputs = [ "out" ];
postPatch = ''
patchShebangs .
'';
......@@ -119,16 +120,19 @@ rec {
'';
buildPhase = ''
make DISTRIB="frama-c-archive" src-distrib
tar -zcf frama-c-tests-archive.tar.gz tests src/plugins/*/tests
'';
installPhase = ''
tar -C $out --strip-components=1 -xf frama-c-archive.tar.gz
tar -C $out --strip-components=1 -xzf frama-c-archive.tar.gz
tar -C $out -xzf frama-c-tests-archive.tar.gz
'';
};
tests-distrib = stdenv.mkDerivation {
name = "frama-c-tests-distrib";
inherit distrib buildInputs;
outputs = [ "out" "build_dir" ];
build-from-distrib-tarball = stdenv.mkDerivation {
name = "frama-c-build-from-distrib-tarball";
inherit buildInputs;
src = build-distrib-tarball.out ;
outputs = [ "out" ];
configurePhase = ''
unset CC
autoconf
......@@ -136,10 +140,9 @@ rec {
'';
buildPhase = ''
make -j 4
make tests -j4 PTESTS_OPTS="-error-code -j 4"
'';
installPhase = ''
make install
true
'';
};
......@@ -176,7 +179,7 @@ rec {
inherit src;
buildInputs = (mk_buildInputs { opamPackages = [ "xml-light" ];} ) ++
[ pkgs.getopt pkgs.which
pkgs.libxslt pkgs.libxml2 pkgs.file pkgs.autoPatchelfHook stdenv.cc.cc.lib
pkgs.libxslt pkgs.libxml2 pkgs.autoPatchelfHook stdenv.cc.cc.lib
];
counter_examples_src = plugins.counter-examples.src;
genassigns_src = plugins.genassigns.src;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment