@@ -573,45 +573,6 @@ will work.
573573
574574(Note : yackage does not currently support hpack, but you can also hpack-convert should you need to generate a package.yaml).
575575
576- # ### External Dependencies
577-
578- Given that LTS Haskell and Stackage Nightly have ~1400 of the most common
579- Haskell packages, this will often be enough to build most packages. However,
580- at times, you may find that not all dependencies required may be available in
581- the Stackage snapshots.
582-
583- Let's simulate an unsatisfied dependency by adding acme-missiles to the list of dependencies
584- the build requires. This is done by including it in the `Build-depends` section in the .cabal file
585- and then re-initing :
586-
587- ` ` `
588- cueball:~/yackage-0.8.0$ stack init --force
589- # init failure output
590- ` ` `
591-
592- stack has tested six different snapshots, and in every case discovered that
593- acme-missiles is not available. In the end it suggested that you use the
594- ` --solver` command line switch if you want to use packages outside Stackage. So
595- let's give it a try :
596-
597- ` ` `
598- cueball:~/yackage-0.8.0$ stack init --force --solver
599- # solver output ...
600- ` ` `
601-
602- stack will complain that it needs a `cabal-install` installation. Let's get that :
603-
604- ` ` `
605- cueball:~/yackage-0.8.0$ stack install cabal-install
606- ` ` `
607-
608- Then run the above `stack init` command again and it will succeed.
609-
610- As you can verify by viewing `stack.yaml`, three external dependencies were added
611- by stack init under the `extra-deps` field. Of course, you could have added the
612- external dependencies by manually editing `stack.yaml` but stack init does the
613- hard work for you.
614-
615576# ### Excluded Packages
616577
617578Sometimes multiple packages in your project may have conflicting requirements.
@@ -625,10 +586,10 @@ works.
625586To simulate a conflict we will use acme-missiles-0.3 in yackage and we will
626587also copy `yackage.cabal` to another directory and change the name of the file
627588and package to yackage-test. In this new package we will use acme-missiles-0.2
628- instead. Let's see what happens when we run solver :
589+ instead. Let's see what happens when we re- run stack init :
629590
630591` ` `
631- cueball:~/yackage-0.8.0$ stack init --force --solver -- omit-packages
592+ cueball:~/yackage-0.8.0$ stack init --force --omit-packages
632593# init failure output ...
633594` ` `
634595
@@ -696,70 +657,6 @@ Warning: Some packages were found to be incompatible with the resolver and have
696657Warning: Specified resolver could not satisfy all dependencies. Some external packages have been added as dependencies.
697658You can suppress this message by removing it from stack.yaml
698659` ` `
699- # ## stack solver
700-
701- While `stack init` is used to create stack configuration file from existing
702- cabal files, `stack solver` can be used to fine tune or fix an existing stack
703- configuration file.
704-
705- ` stack solver` uses the existing file as a constraint. For example it will
706- use only those packages specified in the existing config file or use existing
707- external dependencies as constraints to figure out other dependencies.
708-
709- Let's try `stack solver` to verify the config that we generated earlier with
710- `stack init` :
711-
712- ` ` `
713- cueball:~/yackage-0.8.0$ stack solver
714- # solver output ...
715- ` ` `
716-
717- It says there are no changes needed to your configuration. Notice that it also reports
718- ` example/yackage-test.cabal` as missing from the config. It was purposely
719- omitted by `stack init` to resolve a conflict.
720-
721- Sometimes `stack init` may not be able to give you a perfect configuration. In
722- that case, you can tweak the configuration file as per your requirements and then
723- run `stack solver`, it will check the file and suggest or apply any fixes
724- needed.
725-
726- For example, if `stack init` ignored certain packages due to name conflicts or
727- dependency conflicts, the choice that `stack init` made may not be the correct
728- one. In that case you can revert the choice and use solver to fix things.
729-
730- Let's try commenting out `.` and uncommenting `examples/` in our previously
731- generated `stack.yaml` and then run `stack solver` :
732-
733- ` ` `
734- cueball:~/yackage-0.8.0$ stack solver
735- # solver failure output ...
736- ` ` `
737-
738- Due to the change that we made, solver suggested some new dependencies.
739- By default it does not make changes to the config. As it suggested you can use
740- ` --update-config` to make changes to the config.
741-
742- NOTE : You should probably back up your `stack.yaml` before doing this, such as
743- committing to Git/Mercurial/Darcs.
744-
745- Sometimes, you may want to use specific versions of certain packages for your
746- project. To do that you can fix those versions by specifying them in the
747- extra-deps section and then use `stack solver` to figure out whether it is
748- feasible to use those or what other dependencies are needed as a result.
749-
750- If you want to change the resolver for your project, you can run
751- ` stack solver --resolver <resolver name>` and it will figure out the changes needed for you.
752-
753- Let's see what happens if we change the resolver to an older resolver - lts-2.22 :
754-
755- ` ` `
756- cueball:~/yackage-0.8.0$ stack solver --resolver lts-2.22
757- # solver failure output ...
758- ` ` `
759-
760- As you can see, it automatically suggested changes in `extra-deps` due to the
761- change of resolver.
762-
763660# # Different databases
764661
765662Time to take a short break from hands-on examples and discuss a little
@@ -1741,9 +1638,7 @@ users. Here's a quick rundown:
17411638
17421639* `stack update` will download the most recent set of packages from your package
17431640 indices (e.g. Hackage). Generally, stack runs this for you automatically
1744- when necessary, but it can be useful to do this manually sometimes (e.g.,
1745- before running `stack solver`, to guarantee you have the most recent
1746- upstream packages available).
1641+ when necessary, but it can be useful to do this manually sometimes.
17471642* `stack unpack` is a command we've already used quite a bit for examples, but
17481643 most users won't use it regularly. It does what you'd expect: downloads a
17491644 tarball and unpacks it. It accept optional `--to` argument to specify
0 commit comments