From 3327a922921fe828c9613db86c7f574812c2fffd Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Sat, 2 Dec 2023 11:28:53 +0100 Subject: [PATCH 1/4] Expand the installation instructions Closes #101. --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 1c6c5882..61761c1a 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,21 @@ and build configuration features well. ## Installation +The instructions assume basic familiarity with the Bazel build system. +Take a look at [Bazel's documentation][bazel-intro] if you are unfamiliar. + +[bazel-intro]: https://bazel.build/about/intro + ### Using Bzlmod with Bazel >=6 +Bzlmod is Bazel's new dependency manager. You can read more about it in the +[Bazel documentation][bzlmod-doc]. If you use bzlmod, then you can skip the +WORKSPACE section below. Take a look at [Bazel's migration +guide][bzlmod-migration] if you are switching from WORKSPACE to bzlmod. + +[bzlmod-doc]: https://bazel.build/external/overview#bzlmod +[bzlmod-migration]: https://bazel.build/external/migration + Add the following to your MODULE.bazel file to install rules_zig: ```bzl @@ -65,8 +78,21 @@ archive_override( ) ``` +Note, `$SHA256` and `$COMMIT` are placeholders that you need to fill in. Take a +look at the [Bazel documentation][archive-override-doc] for further +information. + +[archive-override-doc]: https://bazel.build/versions/6.4.0/rules/lib/globals#archive_override + ### Using WORKSPACE +The old way of managing external dependencies with Bazel is to declare them in +your WORKSPACE file. You can read more about it in the [Bazel +documentation][workspace-doc]. If you use the WORKSPACE approach, then you can +skip the bzlmod section above. + +[workspace-doc]: https://bazel.build/external/overview#workspace-system + Add the following to your WORKSPACE file to install rules_zig: ```bzl @@ -93,6 +119,12 @@ zig_register_toolchains( ) ``` +Note, `$SHA256` and `$COMMIT` are placeholders that you need to fill in. Take a +look at the [Bazel documentation][http-archive-doc] for further +information. + +[http-archive-doc]: https://bazel.build/rules/lib/repo/http#http_archive + -## Reference Documentation - -Generated API documentation for the provided rules is available in -[`./docs/rules.md`](./docs/rules.md). - ## Usage Examples -