[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 @@ ...@@ -7,6 +7,16 @@
rec { rec {
inherit pkgs; 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; ghc966 = pkgs.haskell.compiler.ghc966;
cabal_install = pkgs.haskell.lib.compose.justStaticExecutables pkgs.haskell.packages.ghc966.cabal-install; cabal_install = pkgs.haskell.lib.compose.justStaticExecutables pkgs.haskell.packages.ghc966.cabal-install;
...@@ -53,11 +63,10 @@ rec { ...@@ -53,11 +63,10 @@ rec {
pcre pcre
pkg-config pkg-config
postgresql postgresql
stdenv.cc.cc customStdenv.cc.cc
xz xz
zlib zlib
zeromq zeromq
curl
] ++ (lib.optionals stdenv.isDarwin [ ] ++ (lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Accelerate darwin.apple_sdk.frameworks.Accelerate
]); ]);
...@@ -65,11 +74,10 @@ rec { ...@@ -65,11 +74,10 @@ rec {
shellHook = '' shellHook = ''
export LD_LIBRARY_PATH="${pkgs.gfortran.cc.lib}:${libPaths}:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="${pkgs.gfortran.cc.lib}:${libPaths}:$LD_LIBRARY_PATH"
export LIBRARY_PATH="${pkgs.gfortran.cc.lib}:${libPaths}" export LIBRARY_PATH="${pkgs.gfortran.cc.lib}:${libPaths}"
export PATH="${pkgs.gccStdenv}/bin:$PATH" export CXX_PATH="${customStdenv.cc.cc.lib}"
export NIX_CC="${pkgs.gccStdenv}" export LIB_PATHS="${libPaths}"
export CC="${pkgs.gccStdenv}/bin/gcc"
''; '';
shell = pkgs.mkShell.override { stdenv = pkgs.gccStdenv; } { shell = pkgs.mkShell.override { stdenv = customStdenv; } {
name = "gargantext-shell"; name = "gargantext-shell";
buildInputs = hsBuildInputs ++ nonhsBuildInputs; buildInputs = hsBuildInputs ++ nonhsBuildInputs;
inherit shellHook; inherit shellHook;
......
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeApplications #-}
module Main where module Main where
import Control.Monad import Control.Monad
import Data.Text (isInfixOf)
import Data.Text qualified as T import Data.Text qualified as T
import Gargantext.Prelude hiding (isInfixOf) import Gargantext.Prelude hiding (isInfixOf)
import System.IO import System.IO
...@@ -34,9 +34,9 @@ startCoreNLPServer = do ...@@ -34,9 +34,9 @@ startCoreNLPServer = do
, create_group = True , create_group = True
, std_out = UseHandle devNull , std_out = UseHandle devNull
, std_err = UseHandle devNull , std_err = UseHandle devNull
}) `catch` \e -> }) `catch` \(e :: SomeException) ->
case e of 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." -> fail $ "Cannot execute the 'corenlp' via nix flakes. Make sure you are in a nix environment."
| otherwise -> throwIO e | otherwise -> throwIO e
pure hdl pure hdl
...@@ -57,10 +57,6 @@ killProcessTree ph = do ...@@ -57,10 +57,6 @@ killProcessTree ph = do
-- Unfortunately it's not possibly to use the 'tasty-hspec' adapter -- Unfortunately it's not possibly to use the 'tasty-hspec' adapter
-- because by the time we get a 'TestTree' out of the adapter library, -- because by the time we get a 'TestTree' out of the adapter library,
-- the information about parallelism is lost. -- 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 :: IO ()
main = do main = do
hSetBuffering stdout NoBuffering 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