Commit Graph

59 Commits

Author SHA1 Message Date
Richard Marko
76a8632d9c remote: thread ProtoVersion into logger 2023-11-30 06:59:59 +01:00
Richard Marko
241fa58737 remote: add Trace, BasicError, ErrorInfo 2023-11-30 06:59:59 +01:00
John Ericson
aba9b4531e remote: add serializers for ProtoVersion
Co-Authored-By: Richard Marko <srk@48.io>
2023-11-30 06:59:59 +01:00
Richard Marko
d414386f52 remote: add Serializer Derivation 2023-11-30 06:59:59 +01:00
Richard Marko
5c9f7ad70e remote: switch controlParser to Serializer Logger 2023-11-30 06:59:59 +01:00
Richard Marko
fb02185c29 remote: add LoggerOpCode 2023-11-30 06:59:59 +01:00
Richard Marko
2462c9ee90 remote: Serializer - add maybeActivity 2023-11-30 06:59:59 +01:00
Richard Marko
f48c7327b7 remote: add Activity and ActivityResult enums 2023-11-30 06:59:59 +01:00
Richard Marko
79310d5b7b remote: add NixSerializerSpec 2023-11-30 06:59:59 +01:00
Richard Marko
edaa343522 remote: (get|put)Int, use Integral 2023-11-30 06:59:59 +01:00
John Ericson
2b3afbffb5 remote: init Serializer
Co-Authored-By: Richard Marko <srk@48.io>
2023-11-30 06:59:59 +01:00
Richard Marko
25bd0f104c remote: parallel tests 2023-11-30 06:59:59 +01:00
Richard Marko
0a0e4a6793 remote: Arbitrary and Serialize for ActivityID, Field, props 2023-11-30 06:59:59 +01:00
Richard Marko
5ea5b82b59 prefix BuildMode and BuildResult constructors 2023-11-30 06:59:59 +01:00
Richard Marko
a3e3840d9b remote: add Arbitrary, Verbosity prop and enum tests 2023-11-30 06:59:59 +01:00
Richard Marko
ee40d47a67 tests: add Test.Hspec.Nix.roundtrip 2023-11-20 09:22:05 +01:00
Richard Marko
42f56f504f hnix-store-tests: init
Split from `-core` so it doesn't depend on quickcheck,
generic-arbitrary and quickcheck-instances that could propagate downstrem.
Also allows users to defined their own.

With all roundtrip property tests.

Later this should also absorb test nix-store/daemon harness from
`-remote` so it can be reused by others.
2023-11-20 09:22:05 +01:00
Richard Marko
c15a127e00 core: re-export Derivation, DerivationOutput 2023-11-19 20:03:11 +01:00
Richard Marko
0b2f3d3cbc remote: drop global OverloadedStrings 2023-11-18 09:22:34 +01:00
Richard Marko
3608451559 add Serialize for Derivation, add getPathOrFail 2023-11-15 18:36:28 +01:00
Richard Marko
c53c10721b add Serialize for BuildResult 2023-11-15 18:36:28 +01:00
Richard Marko
7f4aeae935 add BuildStatus ResolvesToAlreadyValid and NoSubstituters 2023-11-15 18:36:28 +01:00
Richard Marko
ddc914bcb4 remote: add Serialize instances for BuildMode, BuildStatus, Text + tests 2023-11-15 18:36:28 +01:00
Richard Marko
445f59df6d remote: start transitioning from binary to cereal
Strict by default, with round trip props.

Nix-like serialization primitives for now
via System.Nix.Store.Remote.Serialize.Prim
2023-11-15 09:46:48 +01:00
Richard Marko
b98fb44d7f remote: rename testsuite to remote-io, move to tests-io 2023-11-15 08:29:49 +01:00
Richard Marko
6f21bb30ef remote: add Recursive newtype for addToStore 2023-11-15 08:29:49 +01:00
Richard Marko
3b3752d758 core: don't (re)export StorePathHashPart constructor 2023-11-15 08:29:49 +01:00
Richard Marko
c095d12427 remote: move flags to Types, wrap in newtype 2023-11-15 08:29:49 +01:00
Richard Marko
ffc254c105 remote: fix Wincomplete-uni-patterns warnings 2023-11-12 14:45:33 +01:00
John Ericson
5727827dcb Store dir like nix 2023-06-16 11:27:39 -04:00
soulomoon
3e0ee222ba replace the filepath argument in addToStore with a more common type NarSource (The remote part) 2022-06-06 11:32:50 +02:00
Richard Marko
082cad8756 remote: drop derivation test
This was a hack to test serialization/protocol
but the fake derivation won't pass validation
with Nix 2.6. This needs to be tested in combination
with hnix with valid derivation.

Closes #178
2022-03-07 12:42:05 +01:00
Richard Marko
dfa55dc8ba remote: set HOME for tests 2022-03-07 12:12:23 +01:00
Anton-Latukha
a432ee295d remote: test: NixDaemon: fx Text use 2022-02-21 14:31:01 +01:00
Anton-Latukha
04333808af
Remote: tests: NixDaemon: mockedEnv: refactor 2021-08-06 19:29:03 +03:00
Anton-Latukha
bc000b4c6b
Remote: clean-up imports 2021-08-06 19:29:03 +03:00
Anton-Latukha
75c810423a
treewide: hlint refactor 2021-08-06 19:29:02 +03:00
Anton-Latukha
2b58d3e510
treewide: use lift 2021-08-06 19:29:02 +03:00
Anton-Latukha
5d22b9450a
treewide: use pass 2021-08-06 19:29:01 +03:00
Anton-Latukha
c00dedcd3a
treewide: use toText 2021-08-06 19:29:01 +03:00
Anton-Latukha
c4183d22d2
treewide: (LANGUAGE -> language) 2021-08-06 19:29:01 +03:00
Anton-Latukha
f555947627
Remote: use relude as Prelude 2021-08-06 19:28:56 +03:00
Anton-Latukha
3abca41eed
Remote: cabal: declare default-extensions 2021-08-06 17:55:36 +03:00
Anton-Latukha
ef6343be35
Core: use relude as Prelude 2021-08-06 17:55:32 +03:00
Anton-Latukha
eb550bd615
Remote: tests: NixDaemon: refactor 2021-08-06 17:43:23 +03:00
Anton Latukha
3b948d112a
Remote: port to Core (0.5) migration to cryptonite (#161)
Core migrated from `cryptohash` to `cryptonite`, interfaces changed, therefore
the update.
2021-06-10 21:09:11 +03:00
Anton Latukha
b8c378ee77
Remote: Tasty removed Hspec reexports (#154) 2021-05-30 20:57:29 +03:00
Anton-Latukha
b4203b2e4d
treewide: "@ '" -> "@'"
Should fix builds for GHC 9.0.
2021-03-15 22:06:58 +02:00
Anton-Latukha
e2378e0eea
Core, Remote: map -> fmap
Allow not only lists.
This for example should allow NonEmpty lists at least.

Also do not think I do this things on a whim.
I did some research on: is there a reason to use map over fmap, and are the
performance reasons?
In short - there is 0 infornamation on why some people use `map` over `fmap`, there
are no reports of performance reasons.

Well, I know that there is a possibility of a minor type class interface
compilation & runtime use cost. But I think GHC is good enough to infer zero
cost for the concrete list type for which `map` gets used.

And overall we not did thorough profiling/perfommans walkthrough so far. I am
sure that use of standard fmap for code flexibility is not a bottleneck in the
design, I've seen some performance problems design has.

And we not even did the profiling to do inlining and specialize work yet. It is
more effective to keep using `fmap`, and supply specialization, which allows to
keep the code polymorhic, portable to write for and effective in performance.
2021-02-03 13:47:00 +02:00
Anton-Latukha
c49eb9b6d7
Core, Remote: return -> pure
I wonder why type system needs to infer Monad constraint where Applicative would
suffice.
2021-02-03 12:52:48 +02:00