Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
argotest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Reis
argotest
Commits
b53d2de0
Commit
b53d2de0
authored
Feb 08, 2019
by
Valentin Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor.
parent
0ce27a0f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
41 deletions
+81
-41
argotest/.envrc
argotest/.envrc
+1
-0
argotest/argotest.cabal
argotest/argotest.cabal
+37
-0
argotest/argotest.hs
argotest/argotest.hs
+19
-24
argotest/shell.nix
argotest/shell.nix
+1
-0
default.nix
default.nix
+23
-17
No files found.
argotest/.envrc
0 → 100644
View file @
b53d2de0
use_nix
argotest/argotest.cabal
0 → 100644
View file @
b53d2de0
name: argotest
version: 0.1.0.0
license: MIT
license-file: LICENSE
author: Valentin Reis
maintainer: fre@freux.fr
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
executable argotest
main-is: argotest.hs
build-depends:
base,
turtle,
data-default,
optparse-applicative,
unix,
text,
system-filepath
default-language: Haskell2010
ghc-options:
-threaded
-Wall
-Wincomplete-uni-patterns
-Wincomplete-record-updates
-Wmissing-home-modules
-Widentities
-Wredundant-constraints
-Wcpp-undef
-fwarn-tabs
-fwarn-unused-imports
-fwarn-missing-signatures
-fwarn-name-shadowing
-fprint-potential-instances
-Wmissing-export-list
-fwarn-incomplete-patterns
argotest.hs
→
argotest
/argotest
.hs
View file @
b53d2de0
#!
/
usr
/
bin
/
env
nix
-
shell
#!
nix
-
shell
default
.
nix
-
i
runhaskell
-
A
argotest
{-# language RecordWildCards #-}
{-# language ApplicativeDo #-}
{-# language OverloadedStrings #-}
module
Argotest
where
module
Main
where
import
Data.Default
import
Turtle
hiding
(
header
)
import
Turtle
hiding
(
header
,
arguments
)
import
Options.Applicative
import
Data.Maybe
import
Prelude
hiding
(
FilePath
)
import
System.IO
(
withFile
)
import
Debug.Trace
import
Data.Text
(
unpack
,
pack
)
import
Filesystem.Path
(
(
</>
)
)
import
Control.Concurrent.Async
import
System.Console.ANSI
import
System.Console.ANSI.Types
(
Color
)
import
System.Posix.Signals
import
Data.Text
(
pack
)
import
System.Posix.Process
data
StackArgs
=
StackArgs
...
...
@@ -72,14 +62,16 @@ executorParser = do
,
"stream"
]
optSrc
::
String
->
Parser
(
Maybe
(
String
,
FilePath
))
optSrc
l
=
do
optSrc
l
ongform
=
do
parsed
<-
optional
$
strOption
(
long
l
<>
metavar
"PATH"
<>
help
(
l
<>
" source folder override."
))
pure
$
mapT
l
parsed
(
long
longform
<>
metavar
"PATH"
<>
help
(
longform
<>
" source folder override."
)
)
pure
$
mapT
longform
parsed
mapT
::
String
->
Maybe
FilePath
->
Maybe
(
String
,
FilePath
)
mapT
l
thePath
=
case
thePath
of
mapT
l
ongform
thePath
=
case
thePath
of
Nothing
->
Nothing
Just
p
->
Just
(
l
,
p
)
Just
p
->
Just
(
l
ongform
,
p
)
main
::
IO
()
main
=
sh
$
do
...
...
@@ -111,12 +103,15 @@ main = sh $ do
Nothing
where
argumentsBuilder
::
StackArgs
->
[
String
]
argumentsBuilder
a
@
StackArgs
{
..
}
=
argumentsBuilder
StackArgs
{
..
}
=
[
"-A"
,
"test"
]
++
concat
[
[
"--arg"
,
l
<>
"-src"
,
encodeString
p
]
|
(
l
,
p
)
<-
overrides
]
++
concat
[
[
"--arg"
,
longform
<>
"-src"
,
encodeString
p
]
|
(
longform
,
p
)
<-
overrides
]
++
(
case
run
of
Just
c
ommand
->
[
"--run"
,
comman
d
]
Nothing
->
[]
Just
c
md
->
[
"--run"
,
cm
d
]
Nothing
->
[]
)
opts
=
info
(
executorParser
<**>
helper
)
...
...
argotest/shell.nix
0 → 100644
View file @
b53d2de0
(
import
../default.nix
{})
.
argotest
.
hack
default.nix
View file @
b53d2de0
...
...
@@ -14,17 +14,25 @@ in
dgemm_randomwalk-src
?
argopkgs
.
applications
.
nrm
.
dgemm_randomwalk
.
src
,
}:
let
filterHdevTools
=
builtins
.
filterSource
(
path
:
type
:
(
baseNameOf
path
!=
".hdevtools.sock"
)
&&
(
baseNameOf
path
!=
".ghc.environment.x86_64-linux-8.4.4"
)
&&
(
baseNameOf
path
!=
"dist"
));
addHackEnv
=
package
:
package
.
overrideAttrs
(
old
:
{
hack
=
argopkgs
.
haskellPackages
.
shellFor
{
packages
=
p
:
[
package
];
withHoogle
=
true
;
buildInputs
=
devInputs
++
devHPackages
;
};
});
cabalDevLoader
=
self
:
path
:
set
:
addHackEnv
(
self
.
callCabal2nix
(
baseNameOf
path
)
(
filterHdevTools
path
)
set
);
devInputs
=
with
argopkgs
.
haskellPackages
;
with
argopkgs
;
[
sysstat
jq
sysstat
jq
cabal-install
];
devHPackages
=
with
argopkgs
.
haskellPackages
;
[
hdevtools
hlint
brittany
ghcid
hdevtools
hlint
brittany
ghcid
Cabal
];
addHackEnv
=
package
:
package
.
overrideAttrs
(
old
:
{
buildInputs
=
old
.
buildInputs
++
devInputs
++
devHPackages
;
});
in
rec
{
argotk
=
argopkgs
.
argotk
.
overrideAttrs
(
old
:
{
src
=
argotk-src
;}
);
nrm
=
argopkgs
.
nodelevel
.
nrm
.
overrideAttrs
(
old
:
{
src
=
nrm-src
;}
);
...
...
@@ -76,15 +84,13 @@ in
];
});
argotest
=
argopkgs
.
mkShell
{
name
=
"shake"
;
buildInputs
=
[
(
argopkgs
.
haskellPackages
.
ghcWithPackages
(
p
:
with
p
;
[
argotk
turtle
data-default
optparse-generic
unix
]))
];
hpkgs
=
argopkgs
.
haskellPackages
.
override
{
overrides
=
self
:
super
:
let
loader
=
cabalDevLoader
self
;
in
rec
{
argotest
=
loader
./argotest
{};
};
};
argotest-hack
=
addHackEnv
argotest
;
argotest
=
hpkgs
.
argotest
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment