You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
highlight that the way to obtain rules_haskell in tutorial/WORKSPACE is limited to the tutorial's case, otherwise better refer to the template created by start
also link to Common Haskell Build Use Cases to highlight the other mandatory thing in WORKSPACE file: obtaining GHC
I tried to make a minimal addition, so as to avoid polluting the tutorial; yet giving the sufficient pointers to make users able to set up a toolchain
Copy file name to clipboardExpand all lines: docs/haskell.rst
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ On a Unix system you will need the following tools installed.
32
32
* ``libgmp``
33
33
* ``libtinfo5``
34
34
* ``make``
35
-
* ``python3`` (``python`` also needs to be available in ``$PATH``. Depending on your distro, this might require installing the ``python`` meta-package, which might use Python 2 or 3, ``rules_haskell`` works with both.)
35
+
* ``python3`` (``python`` also needs to be available in ``$PATH``. Depending on your distribution, this might require installing the ``python`` meta-package, which might use Python 2 or 3, ``rules_haskell`` works with both.)
36
36
37
37
On Ubuntu you can obtain them by installing the following packages. ::
38
38
@@ -89,14 +89,32 @@ special:
89
89
contains a ``BUILD.bazel`` file is a *package*. You will learn about
90
90
packages later in this tutorial.)
91
91
92
-
To designate a directory as a Bazel workspace, create an empty file
92
+
To designate a directory as a Bazel workspace, create a file
93
93
named ``WORKSPACE`` in that directory.
94
+
This file defines `external dependencies`_.
94
95
95
96
When Bazel builds the project, all inputs and dependencies must be in
96
97
the same workspace. Files residing in different workspaces are
97
98
independent of one another unless linked, which is beyond the scope of
98
99
this tutorial.
99
100
101
+
Understand the WORKSPACE file
102
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
+
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::
107
+
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.
115
+
The ``WORKSPACE`` file also defines how to obtain the compiler toolchain,
0 commit comments