[nix] fix stdenv to be gcc 14, not 13

parent 1d4ceb07
Pipeline #7737 failed with stages
in 42 minutes and 37 seconds
......@@ -7,6 +7,16 @@
rec {
inherit pkgs;
# Create a custom stdenv with GCC 14 on Linux. This is because
# pkgs.stdenv is GCC version 13 and when using 'nix' inside the
# shell, one gets strange 'CXX_ABI' errors.
customStdenv =
if pkgs.stdenv.isLinux then
pkgs.gcc14Stdenv
else
pkgs.stdenv; # Keep default on other platforms (clang on macOS)
ghc966 = pkgs.haskell.compiler.ghc966;
cabal_install = pkgs.haskell.lib.compose.justStaticExecutables pkgs.haskell.packages.ghc966.cabal-install;
......@@ -53,11 +63,10 @@ rec {
pcre
pkg-config
postgresql
stdenv.cc.cc
customStdenv.cc.cc
xz
zlib
zeromq
curl
] ++ (lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Accelerate
]);
......@@ -65,11 +74,10 @@ rec {
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.gfortran.cc.lib}:${libPaths}:$LD_LIBRARY_PATH"
export LIBRARY_PATH="${pkgs.gfortran.cc.lib}:${libPaths}"
export PATH="${pkgs.gccStdenv}/bin:$PATH"
export NIX_CC="${pkgs.gccStdenv}"
export CC="${pkgs.gccStdenv}/bin/gcc"
export CXX_PATH="${customStdenv.cc.cc.lib}"
export LIB_PATHS="${libPaths}"
'';
shell = pkgs.mkShell.override { stdenv = pkgs.gccStdenv; } {
shell = pkgs.mkShell.override { stdenv = customStdenv; } {
name = "gargantext-shell";
buildInputs = hsBuildInputs ++ nonhsBuildInputs;
inherit shellHook;
......
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module Main where
import Control.Monad
import Data.Text (isInfixOf)
import Data.Text qualified as T
import Gargantext.Prelude hiding (isInfixOf)
import System.IO
......@@ -34,9 +34,9 @@ startCoreNLPServer = do
, create_group = True
, std_out = UseHandle devNull
, std_err = UseHandle devNull
}) `catch` \e ->
}) `catch` \(e :: SomeException) ->
case e of
_ | True <- "does not exist" `isInfixOf` (T.pack . show @SomeException $ e)
_ | True <- "does not exist" `T.isInfixOf` (T.pack . show @SomeException $ e)
-> fail $ "Cannot execute the 'corenlp' via nix flakes. Make sure you are in a nix environment."
| otherwise -> throwIO e
pure hdl
......@@ -57,10 +57,6 @@ killProcessTree ph = do
-- Unfortunately it's not possibly to use the 'tasty-hspec' adapter
-- because by the time we get a 'TestTree' out of the adapter library,
-- the information about parallelism is lost.
--
-- /IMPORTANT/: For these tests to run correctly, you have to run
-- ./devops/coreNLP/build.sh first. You have to run it only /once/,
-- and then you are good to go for the time being.
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment