Skip to content

Commit 9e41447

Browse files
smelcmergify-bot
authored andcommitted
tutorial: remove local_repository snippet in tutorial, add http_archive snippet in use cases; and reference the latter in the former
1 parent 831e5d4 commit 9e41447

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

docs/haskell-use-cases.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ is known to be compatible with rules_haskell and creates a new Bazel
1515
workspace in the current working directory with a few dummy build
1616
targets. See the following sections about customizing the workspace.
1717

18+
Making rules_haskell available
19+
----------------------------------
20+
21+
First of all, the ``WORKSPACE`` file must specify how to obtain
22+
rules_haskell. To use a released version, do the following::
23+
24+
load(
25+
"@bazel_tools//tools/build_defs/repo:http.bzl",
26+
"http_archive"
27+
)
28+
29+
http_archive(
30+
name = "rules_haskell",
31+
strip_prefix = "rules_haskell-0.12",
32+
urls = ["https://github.com/tweag/rules_haskell/archive/v0.12.tar.gz"],
33+
sha256 = "56a8e6337df8802f1e0e7d2b3d12d12d5d96c929c8daecccc5738a0f41d9c1e4",
34+
)
35+
1836
Picking a compiler
1937
------------------
2038

docs/haskell.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,12 @@ this tutorial.
101101
Understand the WORKSPACE file
102102
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103103

104-
File ``tutorial/WORKSPACE`` defines how to obtain ``rules_haskell``
105-
and a compiler toolchain. Because this tutorial lives in ``rules_haskell``'s
106-
repository, ``rules_haskell`` is made available as follows::
104+
File ``tutorial/WORKSPACE`` defines how to obtain ``rules_haskell``.
105+
This file works within the ``rules_haskell``
106+
repository: for your own project, run the start_ script
107+
to create a ``WORKSPACE`` file that makes ``rules_haskell`` available
108+
by `downloading it`_.
107109

108-
local_repository(
109-
name = "rules_haskell",
110-
path = "..",
111-
)
112-
113-
We refer to the template created by the start_ script
114-
to make ``rules_haskell`` available outside a local clone.
115110
The ``WORKSPACE`` file also defines how to obtain the compiler toolchain,
116111
as detailed in section `picking a compiler`_.
117112

@@ -398,6 +393,7 @@ Happy building!
398393
.. _haskell_library: http://api.haskell.build/haskell/haskell.html#haskell_library
399394
.. _graphviz: https://www.graphviz.org/
400395
.. _start: https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html#starting-a-new-project
396+
.. _downloading it: https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html#making-rules-haskell-available
401397
.. _picking a compiler: https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html#picking-a-compiler
402398
.. _external dependencies: https://docs.bazel.build/versions/master/external.html
403399
.. _build encyclopedia: https://docs.bazel.build/versions/master/be/overview.html

0 commit comments

Comments
 (0)