From 37207e94e9e49e8799a2822292efa452755472da Mon Sep 17 00:00:00 2001
From: Allan Blanchard <allan.blanchard@cea.fr>
Date: Tue, 12 Apr 2022 17:13:17 +0200
Subject: [PATCH] [ci] Set GCC version to 9

---
 nix/frama-c.nix       |  6 ++++--
 nix/main-tests.nix    |  4 ++--
 nix/plugins-tests.nix | 14 +++++++-------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/nix/frama-c.nix b/nix/frama-c.nix
index f871052ebf2..347ca1f1225 100644
--- a/nix/frama-c.nix
+++ b/nix/frama-c.nix
@@ -1,6 +1,6 @@
 # Nix
 { lib
-, stdenv
+, stdenvNoCC # for E-ACSL
 , fetchurl
 , gitignoreSource
 , makeWrapper
@@ -15,6 +15,7 @@
 , camlzip
 , dune_3
 , dune-site-3
+, gcc9
 , graphviz
 , lablgtk3
 , lablgtk3-sourceview3
@@ -38,7 +39,7 @@
 
 # We do not use buildDunePackage because Frama-C still uses a Makefile to build
 # some files and prepare some information before starting dune.
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "frama-c";
   version = lib.strings.removeSuffix "\n" (builtins.readFile ../VERSION);
   slang = lib.strings.removeSuffix "\n" (builtins.readFile ../VERSION_CODENAME);
@@ -57,6 +58,7 @@ stdenv.mkDerivation rec {
     dune_3
     dune-site-3
     findlib
+    gcc9
     graphviz
     lablgtk3
     lablgtk3-sourceview3
diff --git a/nix/main-tests.nix b/nix/main-tests.nix
index 69550b46835..1c4c3d60e2f 100644
--- a/nix/main-tests.nix
+++ b/nix/main-tests.nix
@@ -1,12 +1,12 @@
 { lib
-, stdenv
+, stdenvNoCC # for E-ACSL
 , frama-c
 , perl
 , time
 , which
 }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "main-tests";
   version = frama-c.version;
   slang = frama-c.slang;
diff --git a/nix/plugins-tests.nix b/nix/plugins-tests.nix
index a2e3d52d390..2efa68eca20 100644
--- a/nix/plugins-tests.nix
+++ b/nix/plugins-tests.nix
@@ -1,5 +1,5 @@
 { lib
-, stdenv
+, stdenvNoCC
 , frama-c
 , alt-ergo
 , perl
@@ -9,21 +9,21 @@
 }:
 
 # TODO: SPLIT THIS
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "plugins-tests";
   version = frama-c.version;
   slang = frama-c.slang;
 
   build_dir = frama-c.build_dir;
   src = build_dir + "/dir.tar";
-  wp_cache = fetchGit "git@git.frama-c.com:frama-c/wp-cache.git"; # only for WP qualif
+  wp_cache = fetchGit "git@git.frama-c.com:frama-c/wp-cache.git"; # only for WP qualif / Aorai
   sourceRoot = ".";
 
   buildInputs = frama-c.buildInputs ++ [
-    alt-ergo # only for WP qualif
+    alt-ergo # only for WP qualif / Aorai
     frama-c
     perl
-    pkgs.getopt
+    pkgs.getopt # only for E-ACSL
     time
     which
   ];
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   '' ;
 
   # Keep main configuration
-  # Only for WP qualif -> replace with true after split
+  # Only for WP qualif / Aorai -> replace with true after split
   configurePhase = ''
     mkdir home
     HOME=$(pwd)/home
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildPhase = ''
-    export FRAMAC_WP_CACHEDIR=$wp_cache
+    export FRAMAC_WP_CACHEDIR=$wp_cache # only for WP qualif / Aorai
     dune exec -- frama-c-ptests src/plugins/*/tests
     dune build -j1 --display short @src/plugins/ptests
   '';
-- 
GitLab