Commit Graph

26 Commits

Author SHA1 Message Date
Chris Penner
2e71dff47d Kill Configurator and Unison Config 2024-08-25 15:21:27 -07:00
Greg Pfeil
b1cf12330a
Split TranscriptParser into three modules
- `Transcript` – the data model
- `Transcript.Parser` – the parser and printer
- `Transcript.Runner` – the runner

There is unfortunately still some printing tightly coupled to the
runner, but this makes it more obvious. Also, the runner is the only
component tied to the CLI.
2024-07-16 19:35:02 -06:00
Greg Pfeil
00f6c8c954
Refactoring TranscriptParser
A bunch of small changes in TranscriptParser

- remove dead code
- don’t use `Show` for formatted output
- put processed blocks in a separate sum type from unprocessed blocks
- remove `Transcript` from identifiers (changed importers to use
 `qualified as Transcript`)
- deduplicated some error reporting

And one happy fix, IMO – got rid of the `Text.init` that plagued me in
2024-07-16 19:31:01 -06:00
Chris Penner
c156ba75c8 Add isTranscriptTest to Cli.Env 2024-07-09 14:45:11 -07:00
aryairani
f88d652383 [create-pull-request] automated change 2024-03-12 18:35:54 +00:00
Arya Irani
a2c8cc45ba fix imports 2024-03-09 13:25:11 -05:00
Arya Irani
066c288713 dir($0)/runtime/unison-runtime, not $0/runtime/unison-runtime 2024-03-09 13:17:07 -05:00
Arya Irani
5034bf4cb8 change default ucr location to $0/runtime/unison-runtime[.exe] 2024-03-08 15:46:59 -05:00
Dan Doel
719933b5ca Make --runtime-path expect full executable path 2024-02-15 18:28:52 -05:00
Dan Doel
7b53c51a39 Modify transcript runner to allow runtime path
Fixes problems with it building, since it hadn't been updated to call
other modified functions in the right way.
2024-02-12 10:53:34 -05:00
Mitchell Rosen
76b70758b1 add isTranscript to cli monad environment 2023-11-07 17:34:02 -05:00
Chris Penner
84a87659c5 Aggregate all failures at the end of output 2023-07-05 10:35:01 -06:00
Chris Penner
e683c914b7 Silence stdout from actual transcript test runs 2023-07-05 10:08:27 -06:00
Chris Penner
a188ccc569 Remove all transcript output noise 2023-07-05 09:46:30 -06:00
Mitchell Rosen
b5702b9f88 ormolu the world 2023-05-25 15:02:20 -04:00
Chris Penner
4b19b3c63b Add Bifunctor and methods to Unison.Prelude 2023-05-18 11:27:52 -06:00
Travis Staton
fafc3280c9 Prevent opening two ucm processes against the same codebase
optionally obtain file lock on sqlite when opening a codebase
2022-11-18 16:32:06 -05:00
Chris Penner
aa69d40f60 Assert that transcripts in /errors/ should fail. 2022-03-30 16:29:13 -06:00
Chris Penner
4a0c5367a7 Correctly print errors which occur during transcripts
Also set exit code 1 when transcripts fail.
2022-03-30 16:17:57 -06:00
Chris Penner
0ceddd5000 Use Haskell API to run transcripts
Trunk currently runs all of the transcripts by shelling out to the unison cli, this causes two problems:

* It's slow to boot up a fresh ucm for every transcript
* On Windows, we're likely to encounter [this bug](https://github.com/commercialhaskell/stack/issues/5038) which comes up when using `readProcess`, I'm noticing when I run transcripts on windows it inserts a ton of `++stty: 'standard input': Inappropriate ioctl for device` into output files.

As far as speedup goes, a quick benchmark on non-optimized builds shaves off ~90 seconds!

```
New version
/usr/bin/time stack exec transcripts
      103.79 real       153.25 user        89.79 sys

/usr/bin/time stack exec transcripts
      193.79 real       183.08 user         6.97 sys
```

Implementation notes

* Define `withTranscriptRunner`, which does a single initialization and then provides a transcript runner to the provided action. The caller can run any number of transcripts without re-initializing the runtime.
* Rather than crash the with an `exit 1` on failure and then detect that exit code, we return an Either which can be handled as a test failure.
2022-02-24 14:51:57 -06:00
Arya Irani
2657b05884
Merge pull request #2936 from unisonweb/topic/no-stack-exec 2022-02-22 15:36:12 -07:00
Arya Irani
4d514e81f1 codepage 65001 for anything with emojis / unicode 2022-02-18 23:18:22 -07:00
Arya Irani
36b2414bc6 remove stack exec 2022-02-18 21:41:37 -07:00
Chris Penner
0f18bf4ca1 Don't filter out prelude files by our prefix selection. 2021-12-07 10:02:54 -06:00
Chris Penner
54d6fbf1bd Add ORMOLU_DISABLE to every file.
This allows all developers to add ormolu autoformat on save in their
editors without worrying about creating huge diffs on files that haven't
been formatted yet.

If you format a file, remove the DISABLE comment to ensure it stays
formatted in the future.
2021-11-23 12:10:58 -06:00
iamevn
28d1840899 move package cli -> unison-cli
the haskell language server was giving me some errors about not being able to find a local cli package, renaming it to unison-cli fixed that and seems to be consistent with other naming conventions.
2021-10-22 23:17:40 -07:00