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