Browse Source

[#155] cross compilation

Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
rvl/iohk-nix-bump
Alexander Diemand 3 years ago
parent
commit
eb8b505df8
No known key found for this signature in database
GPG Key ID: 99283F5327C5D38F
  1. 8
      iohk-monitoring.cabal
  2. 10
      nix/.stack.nix/iohk-monitoring.nix
  3. 1
      shell.nix
  4. 5
      src/Cardano/BM/Rotator.lhs

8
iohk-monitoring.cabal

@ -81,8 +81,6 @@ library
containers,
contravariant,
directory,
ekg,
ekg-core,
filepath,
katip < 0.8,
lens,
@ -95,11 +93,15 @@ library
text,
time,
time-units,
threepenny-gui,
transformers,
unordered-containers,
vector,
yaml, libyaml < 0.1.1
if !flag(disable-ekg)
build-depends: ekg,
ekg-core
if !flag(disable-gui)
build-depends: threepenny-gui
if os(windows)
build-depends: Win32
else

10
nix/.stack.nix/iohk-monitoring.nix generated

@ -20,7 +20,7 @@
};
components = {
"library" = {
depends = [
depends = (([
(hsPkgs.base)
(hsPkgs.aeson)
(hsPkgs.array)
@ -33,8 +33,6 @@
(hsPkgs.containers)
(hsPkgs.contravariant)
(hsPkgs.directory)
(hsPkgs.ekg)
(hsPkgs.ekg-core)
(hsPkgs.filepath)
(hsPkgs.katip)
(hsPkgs.lens)
@ -47,13 +45,15 @@
(hsPkgs.text)
(hsPkgs.time)
(hsPkgs.time-units)
(hsPkgs.threepenny-gui)
(hsPkgs.transformers)
(hsPkgs.unordered-containers)
(hsPkgs.vector)
(hsPkgs.yaml)
(hsPkgs.libyaml)
] ++ (if system.isWindows
] ++ (pkgs.lib).optionals (!flags.disable-ekg) [
(hsPkgs.ekg)
(hsPkgs.ekg-core)
]) ++ (pkgs.lib).optional (!flags.disable-gui) (hsPkgs.threepenny-gui)) ++ (if system.isWindows
then [ (hsPkgs.Win32) ]
else [ (hsPkgs.unix) ]);
};

1
shell.nix

@ -7,6 +7,7 @@ stdenv.mkDerivation {
ghc
cabal2nix
stack
numactl
];
buildInputs = [
];

5
src/Cardano/BM/Rotator.lhs

@ -34,14 +34,13 @@ import Data.Time (UTCTime, addUTCTime, diffUTCTime, getCurrentTime,
parseTimeM)
import Data.Time.Format (defaultTimeLocale, formatTime)
import System.Directory (listDirectory, removeFile)
import System.FilePath ((</>), takeDirectory)
import System.FilePath ((</>), takeDirectory, takeFileName)
import System.IO (BufferMode (LineBuffering), Handle,
IOMode (AppendMode, WriteMode), hFileSize, hSetBuffering,
openFile, stdout)
#ifdef POSIX
import System.Directory (createFileLink)
import System.FilePath (takeFileName)
#endif
import Cardano.BM.Data.Rotation (RotationParameters (..))
@ -84,7 +83,7 @@ evalRotator rotation filename = do
-- restrict symbolic links only for unix-like OS
let symLinkPath = filename
let logfilePath = takeFileName fpath
-- delete a symlink if already exists and create a new
-- delete a symlink if it already exists and create a new
-- one that points to the correct file.
(removeFile symLinkPath)
`catchIO` (prtoutException ("cannot remove symlink: " ++ symLinkPath))

Loading…
Cancel
Save