Skip to content

Commit 778e6f3

Browse files
Merge request #733 from README restructuring 02
Moving the current "Building" section into "Developing with Cabal".
2 parents 8a85734 + 53ef61e commit 778e6f3

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ ghcid --command="cabal v2-repl --repl-options=-fno-code --repl-options=-fno-brea
8080
```
8181
(optional) To use projects reproducible environment, wrap `ghcid ...` command into a `nix-shell --command ' '`.
8282

83-
For simplicity alias it for your shell.
83+
For simplicity alias it in your shell.
8484

8585
3. Testing:
8686

@@ -99,57 +99,57 @@ env ALL_TESTS=yes cabal v2-test
9999
env NIXPKGS_TESTS=yes PRETTY_TESTS=1 cabal v2-test
100100
```
101101

102-
Run built binary with Cabal:
103-
```
104-
cabal v2-run hnix -- --help
105-
```
106-
(`--` is for separation between `cabal` & `hnix` args)
102+
### Building the project
107103

104+
#### With benchmarks
108105

109-
## Entering the HNix REPL
106+
To run benchmarks:
110107

111-
Enter REPL:
112108
```
113-
hnix --repl
109+
cabal v2-bench
114110
```
115111

116-
To evaluate an expression and make it available in the REPL as the `input` variable use:
112+
#### With profiling
113+
114+
To build `hnix` with profiling enabled:
115+
117116
```
118-
hnix --eval -E '(import <nixpkgs> {}).pkgs.hello' --repl
117+
cabal v2-configure --enable-tests --enable-profiling --flags=profiling
118+
cabal v2-run hnix -- <args> +RTS -p
119119
```
120120

121-
Use the `:help` command for a list of all available REPL commands.
121+
#### With full debug info
122122

123+
To build `hnix` for debugging, with full tracing output and stack traces:
123124

124-
## Building
125+
```
126+
cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
127+
cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
128+
```
125129

126-
### With benchmarks
130+
Note that this going to run quite slowly, but would give the most information as to what happens during parsing & evaluation.
127131

128-
To run benchmarks:
129132

133+
### Run HNix:
130134
```
131-
cabal v2-bench
135+
cabal v2-run hnix -- --help
132136
```
137+
(`--` is for separation between `cabal` & `hnix` args)
133138

134-
### With profiling
135139

136-
To build `hnix` with profiling enabled:
140+
## Entering the HNix REPL
137141

142+
Enter the REPL:
138143
```
139-
cabal v2-configure --enable-tests --enable-profiling --flags=profiling
140-
cabal v2-run hnix -- <args> +RTS -p
144+
hnix --repl
141145
```
142146

143-
### With full debug info
144-
145-
To build `hnix` for debugging, with full tracing output and stack traces:
146-
147+
To evaluate an expression and make it available in the REPL as the `input` variable use:
147148
```
148-
cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
149-
cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
149+
hnix --eval -E '(import <nixpkgs> {}).pkgs.hello' --repl
150150
```
151151

152-
Note that this will run quite slowly, but will give the most information as to what might potentially be going wrong during parsing or evaluation.
152+
Use the `:help` command for a list of all available REPL commands.
153153

154154

155155
## Contributing
@@ -167,7 +167,7 @@ nix-shell --run "LANGUAGE_TESTS=yes cabal v2-test"
167167

168168
Please, check that all tests that were passing prior (most probably all tests mentioned in the command) are still passing for the PR, it is faster to check that locally than through CI. It's OK if no new tests are passing.
169169

170-
### Evaluating Nixpkgs with HNix
170+
## Evaluating Nixpkgs with HNix
171171

172172
Currently, the main high-level goal is to be able to evaluate all of Nixpkgs. To run this yourself, first build `hnix` with `nix-build`, then run the following command:
173173

0 commit comments

Comments
 (0)