Skip to content

Commit 0694892

Browse files
I fixed typos and grammatical errors in your tutorial documentation. (#436)
I corrected various spelling and grammar mistakes in the following files: - tutorial_advanced_packaging.rst - tutorial_basics.rst - tutorial_binary_cache.rst - tutorial_buildsystems.rst Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent b413a07 commit 0694892

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

tutorial_advanced_packaging.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Now, you are ready to set your preferred ``EDITOR`` and continue with the rest o
6666
Modifying a Package's Build Environment
6767
---------------------------------------
6868

69-
Spack sets up several environment variables like ``PATH`` by default to aid in building a package, but many packages make use of environment variables which convey specific information about their dependencies (e.g., ``MPICC``).
69+
Spack sets up several environment variables like ``PATH`` by default to aid in building a package, but many packages make use of environment variables that convey specific information about their dependencies (e.g., ``MPICC``).
7070
This section covers how to update your Spack packages so that package-specific environment variables are defined at build-time.
7171

7272
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -78,7 +78,7 @@ For example, when a package depends on a python extension like py-numpy, Spack's
7878

7979
To provide environment setup for a dependent, a package can implement the
8080
:py:func:`setup_dependent_build_environment
81-
<spack.package.PackageBase.setup_dependent_build_environment>` and or :py:func:`setup_dependent_run_environment <spack.package.PackageBase.setup_dependent_run_environment>` functions.
81+
<spack.package.PackageBase.setup_dependent_build_environment>` and/or :py:func:`setup_dependent_run_environment <spack.package.PackageBase.setup_dependent_run_environment>` functions.
8282
These functions take as a parameter a :py:class:`EnvironmentModifications <spack.util.environment.EnvironmentModifications>` object, which includes convenience methods to update the environment.
8383
For example, an MPI implementation can set ``MPICC`` for build-time use for packages that depend on it:
8484

@@ -379,9 +379,9 @@ Other Packaging Topics
379379
Attach attributes to other packages
380380
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
381381

382-
Build tools usually also provide a set of executables that can be used when another package is being installed.
382+
Build tools also usually provide a set of executables that can be used when another package is being installed.
383383
Spack gives you the opportunity to monkey-patch dependent modules and attach attributes to them.
384-
This helps make the packager experience as similar as possible to what would have been the manual installation of the same package.
384+
This helps make the packager's experience as similar as possible to what would have been the manual installation of the same package.
385385

386386
An example here is the ``automake`` package, which overrides
387387
:py:func:`setup_dependent_package <spack.package.PackageBase.setup_dependent_package>`:

tutorial_basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Use ``--dependents`` to remove the specified package and all of its dependents.
279279
.. literalinclude:: outputs/basics/uninstall-r-needed.out
280280
:language: console
281281

282-
Spack will not uninstall packages that are not sufficiently specified specified (i.e., if the spec is ambiguous and matches multiple installed packages).
282+
Spack will not uninstall packages that are not sufficiently specified (i.e., if the spec is ambiguous and matches multiple installed packages).
283283
The ``--all`` (or ``-a``) flag can be used to uninstall all packages matching an ambiguous spec.
284284

285285
.. literalinclude:: outputs/basics/uninstall-ambiguous.out

tutorial_binary_cache.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ which outputs
103103
...
104104
==> Pushed julia@1.9.3/dfzhutf to ghcr.io/<user>/buildcache-<user>-<host>:julia-1.9.3-dfzhutfh3s2ekaltdmujjn575eip5uhl.spack
105105
106-
The location of the pushed package, when referred to as a OCI image, will be:
106+
The location of the pushed package, when referred to as an OCI image, will be:
107107

108108
.. code-block:: text
109109
110110
ghcr.io/<github_user>/buildcache-<user>-<host>:julia-1.9.3-dfzhutfh3s2ekaltdmujjn575eip5uhl.spack
111111
112-
looks very similar to a container image --- we will get to that in a bit.
112+
look very similar to a container image --- we will get to that in a bit.
113113

114114
.. note ::
115115
@@ -207,7 +207,7 @@ We can already attempt to run the image associated with the ``julia`` package th
207207
exec /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/julia-1.9.3-dfzhutfh3s2ekaltdmujjn575eip5uhl/bin/julia: no such file or directory
208208
209209
but immediately we see it fails.
210-
The reason is that one crucial part is missing, and that is a ``glibc``, which Spack always treats as an external package.
210+
The reason is that one crucial part is missing, and that is ``glibc``, which Spack always treats as an external package.
211211

212212
To fix this, we force push to the registry again, but this time we specify a base image with a recent version of ``glibc``, for example from ``ubuntu:24.04``:
213213

@@ -231,7 +231,7 @@ This time it works!
231231
The minimal ``ubuntu:24.04`` image provides us not only with ``glibc``, but also other utilities like a shell.
232232

233233
Notice that you can use any base image of choice, like ``fedora`` or ``rockylinux``.
234-
The only constraint is that it has a ``libc`` compatible with the external in the Spack built the binaries.
234+
The only constraint is that it has a ``libc`` compatible with the external ``libc`` Spack used to build the binaries.
235235
Spack does not validate this.
236236

237237
--------------------------------------
@@ -243,7 +243,7 @@ If you've paid attention to the output of some of the commands we have run so fa
243243
Every Spack package corresponds to a single layer in each image, and the layers are shared across the different image tags.
244244

245245
Because Spack installs every package into a unique prefix, it is incredibly easy to compose multiple packages into a container image.
246-
In contrast to Docker images built from commands in a ``Dockerfile`` where each command is run in order, Spack package layers are independent, and can in principle be combined in any order.
246+
In contrast to Docker images built from commands in a ``Dockerfile`` where each command is run in sequence, Spack package layers are independent, and can in principle be combined in any order.
247247

248248
Let's add a simple text editor like ``vim`` to our previous environment next to ``julia``, so that we could both edit and run Julia code.
249249

@@ -309,7 +309,7 @@ The downside is that sharing binaries is more complicated, as binaries may conta
309309
Fortunately Spack handles this automatically upon install from a binary cache.
310310
But when you build binaries that are intended to be shared, there is one thing you have to keep in mind: Spack can relocate hard-coded paths in binaries *provided that the target prefix is shorter than the prefix used during the build*.
311311

312-
The reason is that binaries typically embed these absolute paths in string tables, which is a list of null terminated strings, to which the program stores offsets.
312+
The reason is that binaries typically embed these absolute paths in string tables, which is a list of null-terminated strings, to which the program stores offsets.
313313
That means we can only modify strings in-place, and if the new path is longer than the old one, we would overwrite the next string in the table.
314314

315315
To maximize the chances of successful relocation, you should build your binaries in a relatively long path.

tutorial_buildsystems.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Package Class Hierarchy
4141
}
4242

4343
The above diagram gives a high-level view of the class hierarchy and how each package relates.
44-
Each build system specific class inherits from the ``PackageBaseClass`` superclass.
45-
The bulk of the common work is done in this superclass which includes fetching, extracting to a staging directory and installing.
44+
Each build system specific class inherits from the ``PackageBase`` superclass.
45+
The bulk of the common work is done in this superclass which includes fetching, extracting to a staging directory and the install process.
4646
Each subclass then adds additional build-system-specific functionality.
4747
In the following sections, we will go over examples of how to utilize each subclass and see how powerful these abstractions are when packaging.
4848

@@ -80,7 +80,7 @@ The ``AutotoolsPackage`` subclass aims to simplify writing package files for Aut
8080
4. ``install()``
8181

8282

83-
Each of these phases have sensible defaults.
83+
Each of these phases has sensible defaults.
8484
Let's take a quick look at some of the internals of the ``Autotools`` class:
8585

8686
.. code-block:: console
@@ -103,7 +103,7 @@ This will open the ``AutotoolsPackage`` file in your text editor.
103103

104104
Important to note are the highlighted lines.
105105
These properties allow the packager to set what build targets and install targets they want for their package.
106-
If, for example, we wanted to add as our build target ``foo`` then we can append to our ``build_targets`` property:
106+
If, for example, we wanted to add as our build target ``foo`` then we can append to our ``build_targets`` list:
107107

108108
.. code-block:: python
109109
@@ -151,16 +151,16 @@ In fact, the only thing that needs to be overridden is ``configure_args()``.
151151
:linenos:
152152

153153
Since Spack's ``AutotoolsPackage`` takes care of setting the prefix for us, we can exclude that as an argument to ``configure``.
154-
Our package file looks simpler, and we don't not need to worry about whether we have properly included ``configure`` and ``make``.
154+
Our package file looks simpler, and we don't need to worry about whether we have properly included ``configure`` and ``make``.
155155

156156
This version of the ``mpileaks`` package installs the same as the previous, but the ``AutotoolsPackage`` class lets us do it with a cleaner looking package file.
157157

158158
-----------------
159159
Makefile
160160
-----------------
161161

162-
Packages that utilize ``Make`` or a ``Makefile`` usually require you to edit a ``Makefile`` to set up platform and compiler specific variables.
163-
These packages are handled by the ``Makefile`` subclass which provides convenience methods to help write these types of packages.
162+
Packages that utilize ``Make`` or a ``Makefile`` usually require you to edit a ``Makefile`` to set up platform and compiler-specific variables.
163+
These packages are handled by the ``MakefilePackage`` subclass which provides convenience methods to help write these types of packages.
164164

165165
A ``MakefilePackage`` build has three phases that can be overridden by the packager:
166166

@@ -217,16 +217,16 @@ Once the fetching is completed, Spack will open up your text editor in the usual
217217
:language: python
218218
:linenos:
219219

220-
Spack was successfully able to detect that ``Bowtie`` uses ``Make``.
220+
Spack was successfully able to detect that ``Bowtie`` uses ``Makefiles``.
221221
Let's add in the rest of our details for our package:
222222

223223
.. literalinclude:: tutorial/examples/Makefile/1.package.py
224224
:language: python
225225
:emphasize-lines: 10,11,13,14,18,20
226226
:linenos:
227227

228-
As we mentioned earlier, most packages using a ``Makefile`` have hard-coded variables that must be edited.
229-
These variables are fine if you happen to not care about setup or types of compilers used but Spack is designed to work with any compiler.
228+
As we mentioned earlier, most packages using a ``Makefile`` have hardcoded variables that must be edited.
229+
These variables are fine if you happen to not care about setup or types of compilers used, but Spack is designed to work with any compiler.
230230
The ``MakefilePackage`` subclass makes it easy to edit these ``Makefiles`` by having an ``edit()`` method that can be overridden.
231231

232232
Let's take a look at the default ``Makefile`` that ``Bowtie`` provides.
@@ -275,7 +275,7 @@ Let's change the build and install phases of our package:
275275

276276
Here we demonstrate another strategy that we can use to manipulate our package's build.
277277
We can provide command-line arguments to ``make()``.
278-
Since ``Bowtie`` can use ``tbb`` we can either add ``NO_TBB=1`` as a argument to prevent ``tbb`` support, or we can invoke ``make`` with no arguments if EBB is desired and found by its build system.
278+
Since ``Bowtie`` can use ``tbb`` we can either add ``NO_TBB=1`` as a argument to prevent ``tbb`` support, or we can invoke ``make`` with no arguments if TBB is desired and found by its build system.
279279

280280
``Bowtie`` requires our ``install_target`` to provide a path to the install directory.
281281
We can do this by providing ``prefix=`` as a command line argument to ``make()``.
@@ -472,7 +472,7 @@ Options include:
472472

473473
With these options you can specify whether you want your executable to have the debug version only, release version or the release with debug information.
474474
Release executables tend to be more optimized than Debug versions.
475-
In Spack, we set the default as Release unless otherwise specified through a variant (e.g., ``build_type=Debug``).
475+
In Spack, we set the default as `Release` unless otherwise specified through a variant (e.g., ``build_type=Debug``).
476476

477477
Spack then automatically sets up the ``-DCMAKE_INSTALL_PREFIX`` path, appends the build type (defaulting to ``RelWithDebInfo``), and enables a verbose ``Makefile`` output by default.
478478

@@ -527,7 +527,7 @@ Again we fill in the details:
527527
:linenos:
528528
:emphasize-lines: 9,13,14,18,19,20,21,22,23
529529

530-
As mentioned earlier, Spack's ``CMakePackage`` uses sensible defaults to reduce biolerplate and simplify writing package files for ``CMake``-based software.
530+
As mentioned earlier, Spack's ``CMakePackage`` uses sensible defaults to reduce boilerplate and simplify writing package files for ``CMake``-based software.
531531

532532
In ``callpath``, we want to control options like ``CALLPATH_WALKER`` or add specific compiler flags.
533533
We can return these options from ``cmake_args()`` like so:
@@ -621,7 +621,7 @@ And we are left with the following template:
621621
:linenos:
622622

623623
As you can see this is not any different than any package template that we have written.
624-
We have the choice of providing build options or using the sensible defaults
624+
We have the choice of providing build options or using the sensible defaults.
625625

626626
Luckily for us, there is no need to provide build args.
627627

@@ -683,7 +683,7 @@ Although we won't get in depth with any of the other build systems that Spack su
683683

684684

685685
Each of these classes have their own abstractions to help assist in writing package files.
686-
For whatever doesn't fit nicely into the other build-systems, you can use the ``Package`` class.
686+
For whatever doesn't fit nicely into the other build systems, you can use the ``Package`` class.
687687

688688
Hopefully by now you can see how we aim to make packaging simple and robust through these classes.
689689
If you want to learn more about these build systems, check out `Implementing the installation procedure <https://spack.readthedocs.io/en/latest/packaging_guide.html#installation-procedure>`_ in the Packaging Guide.

0 commit comments

Comments
 (0)