@@ -253,6 +253,11 @@ intended for tool usage. It may break when used on multiple packages at once.
253
253
Pass the flag to skip building the targets. The flag ` --dependencies-only ` has
254
254
the same effect.
255
255
256
+ ### The ` stack build --only-locals ` flag
257
+
258
+ Pass the flag to build only packages in the local database. Fails if the build
259
+ plan includes packages in the snapshot database.
260
+
256
261
### The ` stack build --only-snapshot ` flag
257
262
258
263
Pass the flag to build only snapshot dependencies, which are cached and shared
@@ -357,12 +362,21 @@ symbols.
357
362
Pass the flag to enable profiling in libraries, executables, etc. for all
358
363
expressions, and generate a backtrace on exception.
359
364
360
- ## Other flags and options
365
+ ## Flags relating to build outputs
361
366
362
- There are a number of other flags accepted by ` stack build ` . Instead of listing
363
- all of them, please use ` stack build --help ` . Some particularly convenient ones
364
- worth mentioning here since they compose well with the rest of the build system
365
- as described:
367
+ ### The ` stack build --[no]-cabal-verbose ` flag
368
+
369
+ Default: Disabled
370
+
371
+ Set the flag to enable verbose output from Cabal (the library). This flag is an
372
+ alternative to the ` --cabal-verbosity ` option.
373
+
374
+ ### The ` stack build --[no]-cabal-verbosity ` option
375
+
376
+ ` stack build --cabal-verbosity <verbosity_level> ` sets the specified verbosity
377
+ level for output from Cabal (the library). It accepts Cabal's numerical and
378
+ extended syntax. This option is an alternative to setting the ` --cabal-verbose `
379
+ flag.
366
380
367
381
### The ` stack build --[no-]copy-bins ` flag
368
382
@@ -383,16 +397,22 @@ binary directory (see `stack path --compiler-tools-bin`).
383
397
Pass the flag to generate a code coverage report. For further information, see
384
398
the [ code coverage] ( hpc_command.md ) documentation.
385
399
386
- ### The ` stack build --exec ` option
400
+ ### The ` stack build --ddump-dir ` option
387
401
388
- ` stack build --exec "<command> [<arguments>]" ` will run a command after a
389
- successful build.
402
+ GHC has a number of ` ddump-* ` flags and options to allow dumping out of
403
+ intermediate structures produced by the compiler. They include the
404
+ ` -ddump-to-file ` flag that causes the output from other flags to be dumped to a
405
+ file or files.
390
406
391
- ### The ` stack build --file-watch ` flag
407
+ ` stack build --ddump_dir <relative_directory> ` causes Stack to copy ` *.dump-* `
408
+ files to subdirectories of the specified directory, which is relative to Stack's
409
+ working directory for the project.
392
410
393
- Pass the flag to rebuild your project every time a file changes. By default it
394
- will take into account all files belonging to the targets you specify. See also
395
- the ` --watch-all ` flag.
411
+ For example:
412
+
413
+ ~~~ text
414
+ stack build --ghc-options "-ddump-to-file -ddump-timings" --ddump-dir my-ddump-dir
415
+ ~~~
396
416
397
417
### The ` stack build --[no-]interleaved-output ` flag
398
418
@@ -454,6 +474,29 @@ Default: Disabled
454
474
455
475
Set the flag to enable opening the local Haddock documentation in the browser.
456
476
477
+ ## Other flags and options
478
+
479
+ There are a number of other flags accepted by ` stack build ` . Instead of listing
480
+ all of them, please use ` stack build --help ` . Some particularly convenient ones
481
+ worth mentioning here since they compose well with the rest of the build system
482
+ as described:
483
+
484
+ ### The ` stack build --exec ` option
485
+
486
+ ` stack build --exec "<command> [<arguments>]" ` will run a command after a
487
+ successful build.
488
+
489
+ ### The ` stack build --file-watch ` flag
490
+
491
+ Pass the flag to rebuild your project every time a file changes. By default it
492
+ will take into account all files belonging to the targets you specify. See also
493
+ the ` --watch-all ` flag.
494
+
495
+ ### The ` stack build --file-watch-poll ` flag
496
+
497
+ Like the ` --file-watch ` flag, but based on polling the file system instead of
498
+ using events to determine if a file has changed.
499
+
457
500
### The ` stack build --[no]-prefetch ` flag
458
501
459
502
Default: Disabled
0 commit comments