about summary refs log tree commit diff
path: root/pkgs/development/julia-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/julia-modules')
-rw-r--r--pkgs/development/julia-modules/default.nix1
-rw-r--r--pkgs/development/julia-modules/depot.nix10
-rw-r--r--pkgs/development/julia-modules/tests/julia-top-n/app/Main.hs6
-rw-r--r--pkgs/development/julia-modules/tests/julia-top-n/default.nix11
-rw-r--r--pkgs/development/julia-modules/tests/julia-top-n/julia-top-n.cabal1
-rw-r--r--pkgs/development/julia-modules/tests/julia-top-n/package.yaml1
6 files changed, 26 insertions, 4 deletions
diff --git a/pkgs/development/julia-modules/default.nix b/pkgs/development/julia-modules/default.nix
index f2c90752f098f..10db447178644 100644
--- a/pkgs/development/julia-modules/default.nix
+++ b/pkgs/development/julia-modules/default.nix
@@ -1,7 +1,6 @@
 { lib
 , callPackage
 , runCommand
-, fetchFromGitHub
 , fetchgit
 , fontconfig
 , git
diff --git a/pkgs/development/julia-modules/depot.nix b/pkgs/development/julia-modules/depot.nix
index 18bac9cb46a61..c2189ebaf94c0 100644
--- a/pkgs/development/julia-modules/depot.nix
+++ b/pkgs/development/julia-modules/depot.nix
@@ -52,9 +52,17 @@ runCommand "julia-depot" {
   # for finding the extra packages we need to add
   python ${./python}/find_package_implications.py "${closureYaml}" '${lib.generators.toJSON {} packageImplications}' extra_package_names.txt
 
-  # git config --global --add safe.directory '/nix'
+  # Work around new git security features added in git 2.44.1
+  # See https://github.com/NixOS/nixpkgs/issues/315890
+  git config --global --add safe.directory '*'
+
   export JULIA_PKG_USE_CLI_GIT="true"
 
+  # At time of writing, this appears to be the only way to turn precompiling's
+  # terminal output into standard logging, so opportunistically do that.
+  # (Note this is different from JULIA_CI).
+  export CI=true
+
   julia -e ' \
     import Pkg
     import Pkg.Types: PRESERVE_NONE
diff --git a/pkgs/development/julia-modules/tests/julia-top-n/app/Main.hs b/pkgs/development/julia-modules/tests/julia-top-n/app/Main.hs
index ed9f8d405b12c..55f5fd3cfeef8 100644
--- a/pkgs/development/julia-modules/tests/julia-top-n/app/Main.hs
+++ b/pkgs/development/julia-modules/tests/julia-top-n/app/Main.hs
@@ -4,6 +4,7 @@
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE LambdaCase #-}
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE QuasiQuotes #-}
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE ViewPatterns #-}
@@ -17,6 +18,7 @@ import qualified Data.Aeson.Key             as A
 import qualified Data.Aeson.KeyMap          as HM
 import qualified Data.ByteString.Lazy.Char8 as BL8
 import qualified Data.List as L
+import Data.String.Interpolate
 import Data.Text as T
 import qualified Data.Vector as V
 import qualified Data.Yaml as Yaml
@@ -33,6 +35,7 @@ data Args = Args {
   countFilePath :: FilePath
   , topN :: Int
   , parallelism :: Int
+  , juliaAttr :: Text
   }
 
 argsParser :: Parser Args
@@ -40,6 +43,7 @@ argsParser = Args
   <$> strOption (long "count-file" <> short 'c' <> help "YAML file containing package names and counts")
   <*> option auto (long "top-n" <> short 'n' <> help "How many of the top packages to build" <> showDefault <> value 100 <> metavar "INT")
   <*> option auto (long "parallelism" <> short 'p' <> help "How many builds to run at once" <> showDefault <> value 10 <> metavar "INT")
+  <*> strOption (long "julia-attr" <> short 'a' <> help "Which Julia attr to build with" <> showDefault <> value "julia" <> metavar "STRING")
 
 data NameAndCount = NameAndCount {
   name :: Text
@@ -69,7 +73,7 @@ main = do
           introduce' (defaultNodeOptions { nodeOptionsVisibilityThreshold = 0 }) (T.unpack name) julia (newMVar Nothing) (const $ return ()) $ do
             it "Builds" $ do
               let cp = proc "nix" ["build", "--impure", "--no-link", "--json", "--expr"
-                                  , "with import ../../../../. {}; julia.withPackages [\"" <> T.unpack name <> "\"]"
+                                  , [i|with import ../../../../. {}; #{juliaAttr}.withPackages ["#{name}"]|]
                                   ]
               output <- readCreateProcessWithLogging cp ""
               juliaPath <- case A.eitherDecode (BL8.pack output) of
diff --git a/pkgs/development/julia-modules/tests/julia-top-n/default.nix b/pkgs/development/julia-modules/tests/julia-top-n/default.nix
index ab8ed948e1ea9..9e42e19dd309b 100644
--- a/pkgs/development/julia-modules/tests/julia-top-n/default.nix
+++ b/pkgs/development/julia-modules/tests/julia-top-n/default.nix
@@ -4,7 +4,16 @@
 mkDerivation {
   pname = "julia-top-n";
   version = "0.1.0.0";
-  src = ./.;
+  src = lib.fileset.toSource {
+    root = ./.;
+    fileset = lib.fileset.unions [
+      ./app
+      ./julia-top-n.cabal
+      ./package.yaml
+      ./stack.yaml
+      ./stack.yaml.lock
+    ];
+  };
   isLibrary = false;
   isExecutable = true;
   executableHaskellDepends = [
diff --git a/pkgs/development/julia-modules/tests/julia-top-n/julia-top-n.cabal b/pkgs/development/julia-modules/tests/julia-top-n/julia-top-n.cabal
index 834adac33f16a..e3a319702f7a7 100644
--- a/pkgs/development/julia-modules/tests/julia-top-n/julia-top-n.cabal
+++ b/pkgs/development/julia-modules/tests/julia-top-n/julia-top-n.cabal
@@ -27,6 +27,7 @@ executable julia-top-n-exe
     , filepath
     , optparse-applicative
     , sandwich
+    , string-interpolate
     , text
     , unliftio
     , vector
diff --git a/pkgs/development/julia-modules/tests/julia-top-n/package.yaml b/pkgs/development/julia-modules/tests/julia-top-n/package.yaml
index ffb9ab1d12ea4..404ebc72dd674 100644
--- a/pkgs/development/julia-modules/tests/julia-top-n/package.yaml
+++ b/pkgs/development/julia-modules/tests/julia-top-n/package.yaml
@@ -11,6 +11,7 @@ dependencies:
 - filepath
 - optparse-applicative
 - sandwich
+- string-interpolate
 - text
 - unliftio
 - vector