tazelish
Installs Tazel and chooses which version of it runs.
Clonegit clone https://git.progmasoft.com/tazelish
Start Tazelish with its command line and version files
- Commit
52490ff852f3d72ce9c9eb76898080223e9e17fd- Author
- Leitwolf11 ·
Changes
.bazelrc | 43 +++ .bazelversion | 1 + .clang-format | 123 ++++++ .gitattributes | 4 + .github/workflows/ci.yml | 48 +++ .github/workflows/zizmor.yml | 38 ++ .gitignore | 6 + BUILD.bazel | 24 ++ Build/BUILD.bazel | 4 + Build/rules_cc_clangcl_dumpbin.patch | 9 + Headers/Progmasoft/Tazelish/CommandLine.hpp | 91 +++++ Headers/Progmasoft/Tazelish/Help.hpp | 21 ++ Headers/Progmasoft/Tazelish/Version.hpp | 83 +++++ Headers/Progmasoft/Tazelish/VersionFiles.hpp | 82 ++++ LICENSE.txt | 373 +++++++++++++++++++ LICENSES/AdditionRef-Progmasoft-Exception-2.0.txt | 118 ++++++ MODULE.bazel | 27 ++ MODULE.bazel.lock | 433 ++++++++++++++++++++++ README.md | 51 +++ Sources/CommandLine.cpp | 218 +++++++++++ Sources/Help.cpp | 105 ++++++ Sources/Main.cpp | 140 +++++++ Sources/Version.cpp | 196 ++++++++++ Sources/VersionFiles.cpp | 195 ++++++++++ Tests/BUILD.bazel | 17 + Tests/CommandLineTest.cpp | 91 +++++ Tests/VersionFilesTest.cpp | 125 +++++++ Tests/VersionTest.cpp | 68 ++++ 28 files changed, 2734 insertions(+) diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000..7714124 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +common --enable_bzlmod +common --enable_platform_specific_config + +build --incompatible_strict_action_env +build --verbose_failures + +# The code of Tazelish throws no exceptions and is held to the warnings below; +# the dependencies keep their own settings. The tests leave out -Wconversion, +# which the headers of Catch3 do not pass. +# rules_cc finds clang-cl through BAZEL_LLVM, which each machine sets; no +# path of a machine is written here. +build:windows --repo_env=BAZEL_LLVM +build:windows --repo_env=USE_CLANG_CL=1 +build:windows --compiler=clang-cl +build:windows --cxxopt=/std:c++17 +build:windows --host_cxxopt=/std:c++17 +build:windows --cxxopt=/utf-8 +build:windows --cxxopt=/Zc:__cplusplus +build:windows --features=static_link_msvcrt +build:windows --per_file_copt=^Sources/.*@/clang:-Wall,/clang:-Wextra,/clang:-Wpedantic,/clang:-Werror,/clang:-Wshadow,/clang:-Wconversion,/clang:-Wnon-virtual-dtor,/clang:-Wimplicit-fallthrough +build:windows --per_file_copt=^Tests/.*@/clang:-Wall,/clang:-Wextra,/clang:-Wpedantic,/clang:-Werror,/clang:-Wshadow,/clang:-Wnon-virtual-dtor,/clang:-Wimplicit-fallthrough +build:windows --per_file_copt=^Sources/.*@/EHs-c-,/clang:-fno-exceptions + +build:linux --compiler=clang +build:linux --repo_env=CC=clang +build:linux --repo_env=BAZEL_COMPILER=clang +build:linux --cxxopt=-std=c++17 +build:linux --host_cxxopt=-std=c++17 +build:linux --per_file_copt=^Sources/.*@-Wall,-Wextra,-Wpedantic,-Werror,-Wshadow,-Wconversion,-Wnon-virtual-dtor,-Wimplicit-fallthrough +build:linux --per_file_copt=^Tests/.*@-Wall,-Wextra,-Wpedantic,-Werror,-Wshadow,-Wnon-virtual-dtor,-Wimplicit-fallthrough +build:linux --per_file_copt=^Sources/.*@-fno-exceptions + +build:macos --compiler=clang +build:macos --cxxopt=-std=c++17 +build:macos --host_cxxopt=-std=c++17 +build:macos --per_file_copt=^Sources/.*@-Wall,-Wextra,-Wpedantic,-Werror,-Wshadow,-Wconversion,-Wnon-virtual-dtor,-Wimplicit-fallthrough +build:macos --per_file_copt=^Tests/.*@-Wall,-Wextra,-Wpedantic,-Werror,-Wshadow,-Wnon-virtual-dtor,-Wimplicit-fallthrough +build:macos --per_file_copt=^Sources/.*@-fno-exceptions + +test --test_output=errors diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..deeb3d6 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +9.2.0 diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..5efabd4 --- /dev/null +++ b/.clang-format @@ -0,0 +1,123 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +--- +# Progmasoft C++ Style format profile, pinned to LLVM/Clang 23.1.0. +# Naming is intentionally outside clang-format and remains governed by the +# PascalCase/camelCase conventions of Progmasoft C++ Style. +Language: Cpp +BasedOnStyle: LLVM +Standard: c++17 + +UseTab: Never +IndentWidth: 4 +ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 4 +AccessModifierOffset: -4 +IndentAccessModifiers: false + +# Keep formatted C++ source within the agreed 80-column width. +ColumnLimit: 80 + +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterExternBlock: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false + +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: None +AllowShortLoopsOnASingleLine: false +AllowShortNamespacesOnASingleLine: false +AllowShortRecordOnASingleLine: Never + +# Function declarations and definitions keep the return type on its own line. +BreakAfterReturnType: All + +PackArguments: + BinPack: OnePerLine +PackParameters: + BinPack: OnePerLine +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false + +BreakBeforeBinaryOperators: All +BreakBeforeTernaryOperators: true +AlignOperands: Align + +BreakConstructorInitializers: BeforeComma +PackConstructorInitializers: Never +BreakInheritanceList: BeforeComma + +PointerAlignment: Right +DerivePointerAlignment: false +QualifierAlignment: Leave + +SpaceBeforeParens: ControlStatements +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCtorInitializerColon: false +SpaceBeforeInheritanceColon: false +SpaceBeforeCpp11BracedList: false +SpacesInAngles: Never +SpacesInSquareBrackets: false +SpacesInParens: Never +SpaceInEmptyBraces: Never + +Cpp11BracedListStyle: Block + +SpaceAfterTemplateKeyword: false +BreakTemplateDeclarations: Yes + +IndentCaseLabels: true +IndentCaseBlocks: false + +NamespaceIndentation: All +FixNamespaceComments: true +ShortNamespaceLines: 0 +CompactNamespaces: false + +IndentPPDirectives: AfterHash +PPIndentWidth: 4 + +# System headers precede project headers, with alphabetical ordering per group. +IncludeBlocks: Regroup +SortIncludes: CaseSensitive +IncludeIsMainRegex: '$^' +IncludeCategories: + - Regex: '^<.*>$' + Priority: 1 + SortPriority: 1 + - Regex: '^".*"$' + Priority: 2 + SortPriority: 2 + +MaxEmptyLinesToKeep: 1 +KeepEmptyLines: + AtStartOfBlock: false + +ReflowComments: true +SortUsingDeclarations: Lexicographic + +# Match the dominant line-ending convention of each input file. +LineEnding: DeriveLF +InsertNewlineAtEOF: true +... diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..75cf851 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7d357e0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: tazelish-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Test (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, macos-15, windows-2025] + runs-on: ${{ matrix.os }} + timeout-minutes: 45 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + # The hosted Windows image carries LLVM, whose clang-cl the Bazel + # configuration uses. + - if: runner.os == 'Windows' + shell: pwsh + run: '"BAZEL_LLVM=C:\Program Files\LLVM" | Out-File -FilePath $env:GITHUB_ENV -Append' + - run: bazelisk test //... + - run: bazelisk build //:tazelish + + required: + name: CI Required + if: always() + needs: [test] + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - env: + RESULT: ${{ needs.test.result }} + run: test "$RESULT" = success diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..b81dac0 --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +name: Workflow Security + +# zizmor reads the workflows of this repository for what makes a workflow +# unsafe: a token that is wider than its job needs, text from a pull request +# that reaches a shell, an action that is not pinned. Its findings are +# uploaded to code scanning. + +on: + pull_request: + push: + branches: + - main + +permissions: {} + +concurrency: + group: zizmor-${{ github.ref }} + cancel-in-progress: true + +jobs: + zizmor: + name: zizmor + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + actions: read + contents: read + security-events: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Audit the workflows + uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fcb785f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +/bazel-* +/.cache/ +/compile_commands.json diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000..badab6b --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + +cc_library( + name = "tazelish_library", + srcs = [ + "Sources/CommandLine.cpp", + "Sources/Help.cpp", + "Sources/Version.cpp", + "Sources/VersionFiles.cpp", + ], + hdrs = glob(["Headers/Progmasoft/Tazelish/*.hpp"]), + includes = ["Headers"], + visibility = ["//Tests:__pkg__"], + deps = ["@fmt"], +) + +cc_binary( + name = "tazelish", + srcs = ["Sources/Main.cpp"], + deps = [":tazelish_library"], +) diff --git a/Build/BUILD.bazel b/Build/BUILD.bazel new file mode 100644 index 0000000..894380b --- /dev/null +++ b/Build/BUILD.bazel @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +exports_files(["rules_cc_clangcl_dumpbin.patch"]) diff --git a/Build/rules_cc_clangcl_dumpbin.patch b/Build/rules_cc_clangcl_dumpbin.patch new file mode 100644 index 0000000..66c138f --- /dev/null +++ b/Build/rules_cc_clangcl_dumpbin.patch @@ -0,0 +1,9 @@ +--- cc/private/toolchain/windows_cc_configure.bzl ++++ cc/private/toolchain/windows_cc_configure.bzl +@@ -722,5 +722,6 @@ + if not build_tools["LIB"]: + build_tools["LIB"] = find_msvc_tool(repository_ctx, vc_path, "lib.exe", "x64") ++ build_tools["DUMPBIN"] = find_msvc_tool(repository_ctx, vc_path, "dumpbin.exe", "x64") + else: + build_tools = _find_msvc_tools(repository_ctx, vc_path, target_arch) + diff --git a/Headers/Progmasoft/Tazelish/CommandLine.hpp b/Headers/Progmasoft/Tazelish/CommandLine.hpp new file mode 100644 index 0000000..783dfde --- /dev/null +++ b/Headers/Progmasoft/Tazelish/CommandLine.hpp @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +/// \file +/// The command line of Tazelish, read into a typed command. Nothing after the +/// parser looks at the text of an argument again. + +#pragma once + +#include <optional> +#include <string> +#include <string_view> +#include <variant> +#include <vector> + +#include "Progmasoft/Tazelish/Version.hpp" + +namespace Progmasoft::Tazelish +{ + + /// `tazelish install <version>`. + struct Install + { + Version version; + }; + + /// `tazelish use [--force] <version>`: writes `./tazelish.txt`. + struct Use + { + Version version; + bool force = false; + }; + + /// `tazelish default [--force] <version>`: writes the `config.txt` of the + /// user. + struct Default + { + Version version; + bool force = false; + }; + + /// What `tazelish self` does to Tazelish itself. + enum class SelfAction + { + kUpdate, + kRemove, + kPurge, + }; + + /// `tazelish self update|remove|purge`. + struct Self + { + SelfAction action = SelfAction::kUpdate; + }; + + /// The commands `tazelish help <command>` explains. + enum class Topic + { + kInstall, + kUse, + kDefault, + kSelf, + kHelp, + }; + + /// `tazelish help [command]`; without a topic, the general help. + struct Help + { + std::optional<Topic> topic; + }; + + using Command = std::variant<Install, Use, Default, Self, Help>; + + /// A command line that is wrong, and what is wrong with it. + struct Rejection + { + std::string message; + }; + + using ParseResult = std::variant<Command, Rejection>; + + /// The command [arguments] ask for; [arguments] leave out the name of the + /// program. No arguments ask for the general help. + [[nodiscard]] ParseResult + ParseCommandLine(const std::vector<std::string_view> &arguments); + + /// The name of a topic, as `tazelish help` takes it. + [[nodiscard]] std::string_view + TopicName(Topic topic); + +} // namespace Progmasoft::Tazelish diff --git a/Headers/Progmasoft/Tazelish/Help.hpp b/Headers/Progmasoft/Tazelish/Help.hpp new file mode 100644 index 0000000..d7254c7 --- /dev/null +++ b/Headers/Progmasoft/Tazelish/Help.hpp @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +/// \file +/// The text `tazelish help` prints. + +#pragma once + +#include <optional> +#include <string_view> + +#include "Progmasoft/Tazelish/CommandLine.hpp" + +namespace Progmasoft::Tazelish +{ + + /// The general help without a topic, or the help of one command. + [[nodiscard]] std::string_view + HelpText(std::optional<Topic> topic); + +} // namespace Progmasoft::Tazelish diff --git a/Headers/Progmasoft/Tazelish/Version.hpp b/Headers/Progmasoft/Tazelish/Version.hpp new file mode 100644 index 0000000..01c0392 --- /dev/null +++ b/Headers/Progmasoft/Tazelish/Version.hpp @@ -0,0 +1,83 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +/// \file +/// The versions of Tazel a command line or a version file can name. + +#pragma once + +#include <cstdint> +#include <optional> +#include <string> +#include <string_view> +#include <variant> + +namespace Progmasoft::Tazelish +{ + + /// A release of Tazel: `MAJOR.SEMIMAJOR.MINOR.PATCH`. + struct Release + { + std::uint32_t majorNumber = 0; + std::uint32_t semimajorNumber = 0; + std::uint32_t minorNumber = 0; + std::uint32_t patchNumber = 0; + }; + + /// The two kinds of build that are not releases. + enum class Channel + { + kUnstable, + kNightly, + }; + + /// The newest build of a channel: `unstable` or `nightly`. + struct Newest + { + Channel channel = Channel::kUnstable; + }; + + /// The build of a channel from one day: `YYYY-MM-DD-unstable`. + struct Dated + { + std::uint16_t year = 0; + std::uint8_t month = 0; + std::uint8_t day = 0; + Channel channel = Channel::kUnstable; + }; + + [[nodiscard]] inline bool + operator==(const Release &left, const Release &right) + { + return left.majorNumber == right.majorNumber + && left.semimajorNumber == right.semimajorNumber + && left.minorNumber == right.minorNumber + && left.patchNumber == right.patchNumber; + } + + [[nodiscard]] inline bool + operator==(const Newest &left, const Newest &right) + { + return left.channel == right.channel; + } + + [[nodiscard]] inline bool + operator==(const Dated &left, const Dated &right) + { + return left.year == right.year && left.month == right.month + && left.day == right.day && left.channel == right.channel; + } + + /// A version as it is written after `tazelish install`. + using Version = std::variant<Release, Newest, Dated>; + + /// The version [text] names, or nothing when it names none. Numbers have no + /// leading zeros, and a date has to exist in the calendar. + [[nodiscard]] std::optional<Version> + ParseVersion(std::string_view text); + + /// The text of [version], the way ParseVersion reads it. + [[nodiscard]] std::string + FormatVersion(const Version &version); + +} // namespace Progmasoft::Tazelish diff --git a/Headers/Progmasoft/Tazelish/VersionFiles.hpp b/Headers/Progmasoft/Tazelish/VersionFiles.hpp new file mode 100644 index 0000000..5df9326 --- /dev/null +++ b/Headers/Progmasoft/Tazelish/VersionFiles.hpp @@ -0,0 +1,82 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +/// \file +/// The files that name the version of Tazel to run: `tazelish.txt` of a +/// project, written by `tazelish use`, and `config.txt` of the user, written +/// by `tazelish default`. Both hold one version; `tazelish.txt` comes first. + +#pragma once + +#include <filesystem> +#include <optional> +#include <string> +#include <string_view> +#include <variant> + +#include "Progmasoft/Tazelish/Version.hpp" + +namespace Progmasoft::Tazelish +{ + + constexpr std::string_view kProjectFileName = "tazelish.txt"; + constexpr std::string_view kStateDirectoryName = ".tazelish"; + constexpr std::string_view kConfigFileName = "config.txt"; + + /// A version file that could not be read or written, and why. + struct FileError + { + std::filesystem::path file; + std::string message; + }; + + /// Which file named the version. + enum class VersionSource + { + kProject, + kUser, + }; + + /// The version to run and the file that named it. + struct Selection + { + Version version; + std::filesystem::path file; + VersionSource source = VersionSource::kProject; + }; + + /// No file names a version. + struct NoSelection + {}; + + /// The home folder of the user: `%USERPROFILE%` on Windows, `$HOME` + /// elsewhere; nothing when the variable is unset or empty. + [[nodiscard]] std::optional<std::filesystem::path> + HomeDirectory(); + + /// `<home>/.tazelish`, where Tazelish keeps what it owns. + [[nodiscard]] std::filesystem::path + StateDirectory(const std::filesystem::path &home); + + /// `<home>/.tazelish/config.txt`. + [[nodiscard]] std::filesystem::path + ConfigFile(const std::filesystem::path &home); + + /// The version [file] names; NoSelection when it does not exist. + [[nodiscard]] std::variant<NoSelection, Version, FileError> + ReadVersionFile(const std::filesystem::path &file); + + /// The version to run in [directory]: the nearest `tazelish.txt` in it or a + /// folder above it, else the `config.txt` of [home]. + [[nodiscard]] std::variant<NoSelection, Selection, FileError> + SelectVersion(const std::filesystem::path &directory, + const std::optional<std::filesystem::path> &home); + + /// Writes [version] to [file], creating its folder. An existing file is an + /// error unless [force] is set. + [[nodiscard]] std::optional<FileError> + WriteVersionFile(const std::filesystem::path &file, + const Version &version, + bool force); + +} // namespace Progmasoft::Tazelish diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d0a1fa1 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/LICENSES/AdditionRef-Progmasoft-Exception-2.0.txt b/LICENSES/AdditionRef-Progmasoft-Exception-2.0.txt new file mode 100644 index 0000000..a90676f --- /dev/null +++ b/LICENSES/AdditionRef-Progmasoft-Exception-2.0.txt @@ -0,0 +1,118 @@ +Progmasoft Linking Exception, Version 2.0 + +This Exception is an additional permission granted with the Mozilla Public License, version 2.0 ("MPL-2.0"). It keeps MPL-2.0's file-level copyleft for Covered Software and removes doubt about four things: combining Covered Software with other work, what compilers do to code, what programs built with Covered Software tools owe, and the interfaces other work needs in order to use Covered Software. It does not change the text of MPL-2.0. Capitalized terms not defined here have the meanings given in MPL-2.0, and "You" has the meaning given there. + +1. Definitions + +"Independent Work" means software or other material, in any form, that is neither Covered Software nor a Modification. Sections 3 and 5 say what does not change that. + +"Tool" means Covered Software that You run to produce material: a compiler, linker, code generator, build system, package manager, formatter, or similar program. + +"Input" means the material You give a Tool to process, other than the Tool's own files. + +"Output" means the material a Tool writes when it runs, including source code, intermediate representations, object code, executable code, packages, documentation, reports, diagnostics, formatted text, and analysis results. + +"Generated Code" means the part of an Output that a Tool copies, expands, or derives from its own Covered Software in its ordinary operation, rather than from Input. Examples are templates, parser skeletons, entry points, stubs, thunks, tables, metadata, instantiated generics, and project scaffolding. + +"Runtime Material" means Covered Software that (a) the copyright holders of a Tool identify, in the documentation they publish, as that Tool's runtime library or standard library, and (b) is compiled, linked, embedded into, or placed beside an Output because the Output uses it when it runs. A license text or other file installed for documentation only is not Runtime Material. + +"Interface Material" means declarations, type and data layouts, constants, enumerations, macros, function and method signatures, attributes, wire and file formats, and the short inline definitions that an interface needs in order to be used, to the minimum extent necessary to call, implement, extend, bind to, or interoperate with Covered Software. + +2. Larger Works + +You may create, reproduce, use, modify, make available, and distribute a Larger Work that combines Covered Software with Independent Work under terms of Your choice, including proprietary terms, provided You comply with MPL-2.0 for the Covered Software as this Exception adjusts it. The combination may be made by any technical means, including static or dynamic linking, loading, embedding, plugins, language bindings, an API, ABI, or FFI boundary, a command-line interface, a protocol, inter-process communication, or a file format. It does not matter whether the works end up in one file, process, address space, archive, image, or deployment. The word "separate" in the definition of Larger Work in MPL-2.0 Section 1.7 refers to Source Code Form. + +Your terms may govern the Independent Work and the Larger Work as a whole. They must not limit or alter a recipient's rights in the Source Code Form of the Covered Software. + +Neither MPL-2.0 nor this Exception requires You, for a Larger Work, to provide the Source Code Form of Independent Work, to provide object files or anything else that allows relinking, to allow reverse engineering of Independent Work, or to provide installation information, keys, or credentials. + +3. What Compilation Does Not Change + +The following do not make Independent Work into Covered Software or a Modification, and do not subject its Source Code Form to MPL-2.0: + +(a) calling, linking to, loading, subclassing, implementing, or otherwise using Covered Software through its interfaces; +(b) including, importing, or referring to a Covered Software header, module, or package from a file of Independent Work; and +(c) macro expansion, template or generic instantiation, specialization, inlining, link-time or whole-program optimization, just-in-time compilation, or any comparable compiler transformation that places Covered Software in the compiled form of Independent Work. + +Material placed in a compiled form under (c) is the Executable Form of the Covered Software it came from. Section 4 or Section 5 releases it when it is Generated Code, Runtime Material, or Interface Material. Otherwise MPL-2.0 Section 3.2 applies to it, and Section 7 says how to meet that Section. + +If You copy Covered Software in Source Code Form into a file, other than as Section 4 or Section 5 allows, that file is a Modification. Labels, file extensions, build boundaries, or later separation of files do not change that. + +4. Generated Code and Programs Built with Tools + +4.1 Output is not Covered Software merely because a Tool produced it. Running a Tool over Input does not change the license of the Input, and material in an Output that comes from Input has the same license as that Input. + +4.2 You may use, modify, and distribute Generated Code, in any form, under terms of Your choice. MPL-2.0 Sections 3.1 through 3.4 do not apply to it. You need not offer its source, keep its notices, or attribute it. + +4.3 You may distribute Runtime Material in Executable Form as part of, or together with, an Output that uses it, under terms of Your choice. MPL-2.0 Sections 3.1 through 3.4 do not apply to that distribution. The Source Code Form of Runtime Material stays under MPL-2.0, and this Section does not permit distributing Runtime Material on its own. This Section covers Runtime Material You have not changed, and a Modification of it only when You make that Modification available under Section 7. + +4.4 Limits. This Section 4 does not apply to: + +(a) Covered Software given to a Tool as Input, unless it is Runtime Material. Compiling, formatting, or transforming Covered Software with a Tool leaves its obligations in place; +(b) material that an unmodified Tool would not write for the same Input and options, unless You make the change that causes it available under Section 7. Changing a Tool so that it copies more of its Covered Software into Output does not widen this Section; or +(c) an Output produced for the purpose of obtaining a Tool's Covered Software rather than for using the Tool. Such material remains subject to MPL-2.0. + +4.5 Intermediate representations and every other kind of Output are treated alike. An Output keeps the permissions of this Section after it leaves You. If Your rights in a Tool end, that does not affect Output You have already made or the rights of anyone who received it. + +4.6 These permissions lift conditions; they do not end the license. Generated Code and Runtime Material stay licensed to You under MPL-2.0 Section 2, and MPL-2.0 Sections 6 and 7 continue to apply to them. + +5. Interface Material and Examples + +You may copy Interface Material into Independent Work, and translate it into another language, to the extent needed to use or interoperate with Covered Software. The result is not a Modification, and MPL-2.0 Section 3 does not apply to it, in Source Code Form or in Executable Form. This covers header files, bindings, and declarations in another language. It does not cover the implementation behind an interface. + +You may use, copy, and adapt code that the documentation of Covered Software presents as an example or as a starting point for Your own project, under terms of Your choice and without any obligation of MPL-2.0 Section 3. + +6. What This Exception Keeps + +Except where Sections 4 and 5 say otherwise: + +(a) Covered Software in Source Code Form, and every Modification, stay under MPL-2.0 and cannot be relicensed through this Exception; +(b) distributing Covered Software in Executable Form stays subject to MPL-2.0 Section 3.2, as Section 7 explains; +(c) notices protected by MPL-2.0 Section 3.4 stay in place in Source Code Form; and +(d) nothing here allows You to withhold Source Code Form that MPL-2.0 requires You to make available. + +7. Telling Recipients How to Obtain Source + +For Covered Software You have not changed, You satisfy MPL-2.0 Section 3.2(a) by giving recipients of the Executable Form a notice that names the Covered Software and its version and gives an address where the corresponding Source Code Form is publicly available. You may put that notice in documentation, in an about screen, in a notice file, or in a software bill of materials. The copyright holders' own public release of that version is a sufficient source; You need not host a copy, and You are not in breach if that release later stops being available. + +For a Modification, the same notice must give an address where the Source Code Form of the exact version You distributed can be obtained by reasonable means and in a timely manner. An address that follows a branch or otherwise changes over time is not enough. + +8. Contributors and Direct Grant + +Every Contributor who distributes Covered Software that carries an identification under Section 12 grants this Exception for that Contributor's Contributions. + +This Exception is granted directly to every recipient of Covered Software, for the duration of the copyright in it. A distributor need not sublicense it. Distribution through intermediaries does not reduce it, and the end of a distributor's rights does not end rights already received by others. + +You may use Covered Software under MPL-2.0 without relying on this Exception. As an exception to MPL-2.0 Section 3.4, You may remove the identification of this Exception from a file You modify; Your version of that file is then offered by You under MPL-2.0 alone. Earlier copies keep this Exception. + +9. Termination + +This Exception has no termination condition of its own. You may rely on Sections 2, 3, and 5 only while You hold the corresponding rights under MPL-2.0. If those rights end under MPL-2.0 Section 5.1 or 5.2, those permissions end for the affected Covered Software to the same extent, and return if and to the extent those rights are reinstated. This does not reach Independent Work, nor the rights of recipients that MPL-2.0 Section 5.3 preserves, nor Section 4.5. + +10. Relationship to MPL-2.0 + +MPL-2.0 and this Exception are read together. This Exception is a permission from copyright holders and is not a modified version of MPL-2.0. Where the two cannot both be given effect, this Exception controls only as far as needed to give the permissions in Sections 2 through 5 and 7 through 9, and MPL-2.0 controls in every other respect. This Exception continues to apply if You use Covered Software under a later version of the Mozilla Public License as MPL-2.0 Section 10.2 allows. + +MPL-2.0 Sections 6, 7, 8, and 9 apply to this Exception. It is provided without warranty. + +Nothing here changes whether Covered Software is "Incompatible With Secondary Licenses" or changes the operation of MPL-2.0 Section 3.3 for a work governed by a Secondary License. When You distribute under a Secondary License as that Section allows, the Secondary License governs that distribution. + +11. Other Rights + +This Exception concerns copyright only. It grants no trademark, trade dress, service mark, publicity, or confidential-information rights, and no patent rights beyond those MPL-2.0 or a separately applicable patent grant provides. Nothing here limits rights that arise independently under exhaustion, fair use, fair dealing, implied license, estoppel, or other applicable law. + +12. Applicability and Versions + +This Exception applies to Covered Software identified with this SPDX license expression, or an expression that contains it: + +MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +The identification may be in the file itself, in a companion license file, in a machine-readable file such as REUSE.toml that assigns the expression to that file, or in a notice of the project that names the file or the directory holding it. A compiled form has the identification of the source it was compiled from and does not need to carry it. + +Progmasoft may publish later versions of this Exception. You may use Covered Software under the version that identifies it or under any later version Progmasoft publishes. + +Progmasoft also grants this version for its own Contributions in every release it has made under Version 1.0 or Version 1.1 of this Exception. For those releases You may rely on either version. + +13. Severability + +If any provision of this Exception is held unenforceable, it shall be reformed only to the minimum extent necessary to make it enforceable. If reformation is unavailable, that provision is severed and the remaining provisions continue to the maximum extent permitted by law. diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..6f41b26 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +module(name = "tazelish", version = "0.1.0") + +bazel_dep(name = "rules_cc", version = "0.2.22") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "fmt", version = "12.1.0") + +# Catch3 is not in the Bazel Central Registry; its release archive is taken +# from GitHub and checked against this digest. +bazel_dep(name = "catch3", version = "0.3.0.2", dev_dependency = True) +archive_override( + module_name = "catch3", + integrity = "sha256-FoE/f8D/iFS1aSdh6i8Xy5RxMGwOBo5ECwbK8pfeE7E=", + strip_prefix = "catch3-catch3-0.3.0.2", + urls = ["https://github.com/Progmasoft/catch3/archive/refs/tags/catch3-0.3.0.2.tar.gz"], +) + +# rules_cc 0.2.22 forgets to populate DUMPBIN in its clang-cl branch but reads +# the key unconditionally; the same one-line fix as in the Tala repository. +single_version_override( + module_name = "rules_cc", + patch_strip = 0, + patches = ["//Build:rules_cc_clangcl_dumpbin.patch"], + version = "0.2.22", +) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 0000000..a7be886 --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,433 @@ +{ + "lockFileVersion": 28, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.2/MODULE.bazel": "73939767a4686cd9a520d16af5ab440071ed75cec1a876bf2fcfaf1f71987a16", + "https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1", + "https://bcr.bazel.build/modules/abseil-cpp/20250512.1/MODULE.bazel": "d209fdb6f36ffaf61c509fcc81b19e81b411a999a934a032e10cd009a0226215", + "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2", + "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c", + "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", + "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", + "https://bcr.bazel.build/modules/apple_support/1.21.0/MODULE.bazel": "ac1824ed5edf17dee2fdd4927ada30c9f8c3b520be1b5fd02a5da15bc10bff3e", + "https://bcr.bazel.build/modules/apple_support/1.21.1/MODULE.bazel": "5809fa3efab15d1f3c3c635af6974044bac8a4919c62238cce06acee8a8c11f1", + "https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4", + "https://bcr.bazel.build/modules/apple_support/1.24.2/source.json": "2c22c9827093250406c5568da6c54e6fdf0ef06238def3d99c71b12feb057a8d", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.23.0/MODULE.bazel": "fd1ac84bc4e97a5a0816b7fd7d4d4f6d837b0047cf4cbd81652d616af3a6591a", + "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65", + "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", + "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", + "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.50.0/MODULE.bazel": "2083ef9c7a469f520890483ccf8e0189d6e71e2117e7752e15e6554433d5ae3e", + "https://bcr.bazel.build/modules/bazel_features/1.50.0/source.json": "e0ee3debde2789ff56e4452e612d126925ba9ab64d4bde79c67f099d2902df9b", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.0/MODULE.bazel": "2fb3fb53675f6adfc1ca5bfbd5cfb655ae350fba4706d924a8ec7e3ba945671c", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", + "https://bcr.bazel.build/modules/fmt/12.1.0/MODULE.bazel": "c6b460c936f408b371bf12ccee5ecbd5aed8f6abfb6e8b63fad0c622715fd458", + "https://bcr.bazel.build/modules/fmt/12.1.0/source.json": "d7b35221043d8d7c69e2a64d6a0783c97aa49c5ce198ee0a5ccd18c99f070b1a", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108", + "https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46", + "https://bcr.bazel.build/modules/googletest/1.17.0/source.json": "38e4454b25fc30f15439c0378e57909ab1fd0a443158aa35aec685da727cd713", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.6/MODULE.bazel": "2f8d20d3b7d54143213c4dfc3d98225c42de7d666011528dc8fe91591e2e17b0", + "https://bcr.bazel.build/modules/jsoncpp/1.9.6/source.json": "a04756d367a2126c3541682864ecec52f92cdee80a35735a3cb249ce015ca000", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/source.json": "f448c6e8963fdfa7eb831457df83ad63d3d6355018f6574fb017e8169deb43a9", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580", + "https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92", + "https://bcr.bazel.build/modules/protobuf/29.1/MODULE.bazel": "557c3457560ff49e122ed76c0bc3397a64af9574691cb8201b4e46d4ab2ecb95", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/32.1/MODULE.bazel": "89cd2866a9cb07fee9ff74c41ceace11554f32e0d849de4e23ac55515cfada4d", + "https://bcr.bazel.build/modules/protobuf/33.4/MODULE.bazel": "114775b816b38b6d0ca620450d6b02550c60ceedfdc8d9a229833b34a223dc42", + "https://bcr.bazel.build/modules/protobuf/33.4/source.json": "555f8686b4c7d6b5ba731fbea13bf656b4bfd9a7ff629c1d9d3f6e1d6155de79", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34", + "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/source.json": "6900fdc8a9e95866b8c0d4ad4aba4d4236317b5c1cd04c502df3f0d33afed680", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a", + "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4", + "https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a", + "https://bcr.bazel.build/modules/rules_apple/4.1.0/MODULE.bazel": "76e10fd4a48038d3fc7c5dc6e63b7063bbf5304a2e3bd42edda6ec660eebea68", + "https://bcr.bazel.build/modules/rules_apple/4.1.0/source.json": "8ee81e1708756f81b343a5eb2b2f0b953f1d25c4ab3d4a68dc02754872e80715", + "https://bcr.bazel.build/modules/rules_cc/0.2.22/MODULE.bazel": "94df4328edef9e44d38de5e73b037cd348e75e7ae55f4e21bf07878c41a31ebb", + "https://bcr.bazel.build/modules/rules_cc/0.2.22/source.json": "b2d6d6f9c332ce269ad75b89c6f3168d809a66173c9040210fb9bcc733ab42fa", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/9.1.0/MODULE.bazel": "ee63f27e36a3fada80342869361182f120a9819c74320e8e65b1e04ba0cd7a9d", + "https://bcr.bazel.build/modules/rules_java/9.1.0/source.json": "da589573c1dee2c9ac4a568b301269a2e8191110ff0345c1a959fa7ea6c4dfd6", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.7/MODULE.bazel": "e717beabc4d091ecb2c803c2d341b88590e9116b8bf7947915eeb33aab4f96dd", + "https://bcr.bazel.build/modules/rules_jvm_external/6.7/source.json": "5426f412d0a7fc6b611643376c7e4a82dec991491b9ce5cb1cfdd25fe2e92be4", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.1.0/MODULE.bazel": "002d62d9108f75bb807cd56245d45648f38275cb3a99dcd45dfb864c5d74cb96", + "https://bcr.bazel.build/modules/rules_proto/7.1.0/source.json": "39f89066c12c24097854e8f57ab8558929f9c8d474d34b2c00ac04630ad8940e", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/1.3.0/MODULE.bazel": "8361d57eafb67c09b75bf4bbe6be360e1b8f4f18118ab48037f2bd50aa2ccb13", + "https://bcr.bazel.build/modules/rules_python/1.4.1/MODULE.bazel": "8991ad45bdc25018301d6b7e1d3626afc3c8af8aaf4bc04f23d0b99c938b73a6", + "https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8", + "https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8", + "https://bcr.bazel.build/modules/rules_python/1.7.0/source.json": "028a084b65dcf8f4dc4f82f8778dbe65df133f234b316828a82e060d81bdce32", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c", + "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", + "https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046", + "https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/source.json": "e85761f3098a6faf40b8187695e3de6d97944e98abd0d8ce579cb2daf6319a66", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", + "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/MODULE.bazel": "75aab2373a4bbe2a1260b9bf2a1ebbdbf872d3bd36f80bff058dccd82e89422f", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/source.json": "5fba48bbe0ba48761f9e9f75f92876cafb5d07c0ce059cc7a8027416de94a05b", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "+Kp6j204mBZ3mxlIDDR0gBoP45BZ4jYRhRAcB8sU0qc=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedInputs": [ + "REPO_MAPPING:rules_kotlin+,bazel_tools bazel_tools" + ], + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + } + } + }, + "@@rules_python+//python/extensions:config.bzl%config": { + "general": { + "bzlTransitiveDigest": "dzD8Q2YmrP3fz8saWLHPmlwPLO91ImtTmP/c9JKTStM=", + "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", + "recordedInputs": [ + "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_python+,pypi__build rules_python++config+pypi__build", + "REPO_MAPPING:rules_python+,pypi__click rules_python++config+pypi__click", + "REPO_MAPPING:rules_python+,pypi__colorama rules_python++config+pypi__colorama", + "REPO_MAPPING:rules_python+,pypi__importlib_metadata rules_python++config+pypi__importlib_metadata", + "REPO_MAPPING:rules_python+,pypi__installer rules_python++config+pypi__installer", + "REPO_MAPPING:rules_python+,pypi__more_itertools rules_python++config+pypi__more_itertools", + "REPO_MAPPING:rules_python+,pypi__packaging rules_python++config+pypi__packaging", + "REPO_MAPPING:rules_python+,pypi__pep517 rules_python++config+pypi__pep517", + "REPO_MAPPING:rules_python+,pypi__pip rules_python++config+pypi__pip", + "REPO_MAPPING:rules_python+,pypi__pip_tools rules_python++config+pypi__pip_tools", + "REPO_MAPPING:rules_python+,pypi__pyproject_hooks rules_python++config+pypi__pyproject_hooks", + "REPO_MAPPING:rules_python+,pypi__setuptools rules_python++config+pypi__setuptools", + "REPO_MAPPING:rules_python+,pypi__tomli rules_python++config+pypi__tomli", + "REPO_MAPPING:rules_python+,pypi__wheel rules_python++config+pypi__wheel", + "REPO_MAPPING:rules_python+,pypi__zipp rules_python++config+pypi__zipp" + ], + "generatedRepoSpecs": { + "rules_python_internal": { + "repoRuleId": "@@rules_python+//python/private:internal_config_repo.bzl%internal_config_repo", + "attributes": { + "transition_setting_generators": {}, + "transition_settings": [] + } + }, + "pypi__build": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl", + "sha256": "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__click": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl", + "sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__colorama": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", + "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__importlib_metadata": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl", + "sha256": "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__installer": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl", + "sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__more_itertools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl", + "sha256": "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__packaging": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl", + "sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pep517": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl", + "sha256": "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl", + "sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip_tools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl", + "sha256": "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pyproject_hooks": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl", + "sha256": "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__setuptools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/90/99/158ad0609729111163fc1f674a5a42f2605371a4cf036d0441070e2f7455/setuptools-78.1.1-py3-none-any.whl", + "sha256": "c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__tomli": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", + "sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__wheel": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl", + "sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__zipp": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl", + "sha256": "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + } + } + } + }, + "@@rules_python+//python/uv:uv.bzl%uv": { + "general": { + "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", + "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", + "recordedInputs": [ + "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_python+,platforms platforms" + ], + "generatedRepoSpecs": { + "uv": { + "repoRuleId": "@@rules_python+//python/uv/private:uv_toolchains_repo.bzl%uv_toolchains_repo", + "attributes": { + "toolchain_type": "'@@rules_python+//python/uv:uv_toolchain_type'", + "toolchain_names": [ + "none" + ], + "toolchain_implementations": { + "none": "'@@rules_python+//python:none'" + }, + "toolchain_compatible_with": { + "none": [ + "@platforms//:incompatible" + ] + }, + "toolchain_target_settings": {} + } + } + } + } + } + }, + "facts": {}, + "factsVersions": {} +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b09e5b5 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +<!-- SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> --> +<!-- SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 --> + +# Tazelish + +Tazelish installs [Tazel](https://tazel.net/) and chooses which version of it runs. It is for those who use Tazel +alone; the toolchain manager of the whole of Tala is Talup. Tazelish runs on Linux (glibc 2.39 or newer, or musl 1.2.4 +or newer), macOS 14 or newer and Windows with PowerShell 5.1; it does not run on BSD. + +```text +tazelish install 0.4.0.3 a release: MAJOR.SEMIMAJOR.MINOR.PATCH +tazelish install unstable the newest unstable build +tazelish install nightly the newest nightly build +tazelish install 2026-11-05-nightly the nightly build of a day +tazelish use [--force] 0.4.0.3 writes the version to ./tazelish.txt +tazelish default [--force] nightly writes the version to the config.txt of the user +tazelish self update|remove|purge +tazelish help [command] +``` + +`tazelish.txt` and `config.txt` hold one version each, written as it is written after `tazelish install`. The nearest +`tazelish.txt`, in the current folder or a folder above it, comes first; `config.txt`, at `$HOME/.tazelish/config.txt` +or `%USERPROFILE%\.tazelish\config.txt`, counts where none names a version. `use` and `default` refuse to write over a +file that exists unless `--force` is given. + +This build reads the command line, the versions and both files. `install` and `self` download from +`static.tazel.net`, which this build does not do; they end with exit code 1. + +## Building + +Tazelish is C++17, built with Bazel through Bazelisk: + +```bash +bazelisk test //... +bazelisk build //:tazelish +``` + +On Windows it is compiled by clang-cl: set `BAZEL_LLVM` to the folder of an LLVM installation first, for example +`C:\Program Files\LLVM`. The code of Tazelish throws no exceptions and builds with warnings as errors. + +| Folder | Holds | +| --- | --- | +| `Headers/Progmasoft/Tazelish/` | the interfaces: versions, the command line, the version files, the help | +| `Sources/` | their implementation and `Main.cpp` | +| `Tests/` | the tests, written with [Catch3](https://github.com/Progmasoft/catch3) | +| `Build/` | a patch of rules_cc for clang-cl | + +## Licence + +MPL-2.0 with the Progmasoft Exception 2.0; see [LICENSE.txt](LICENSE.txt) and +[LICENSES/](LICENSES/AdditionRef-Progmasoft-Exception-2.0.txt). diff --git a/Sources/CommandLine.cpp b/Sources/CommandLine.cpp new file mode 100644 index 0000000..67288d9 --- /dev/null +++ b/Sources/CommandLine.cpp @@ -0,0 +1,218 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <array> +#include <fmt/format.h> +#include <utility> + +#include "Progmasoft/Tazelish/CommandLine.hpp" + +namespace Progmasoft::Tazelish +{ + namespace + { + + constexpr std::array<std::pair<std::string_view, Topic>, 5> kTopics + = { { + { "install", Topic::kInstall }, + { "use", Topic::kUse }, + { "default", Topic::kDefault }, + { "self", Topic::kSelf }, + { "help", Topic::kHelp }, + } }; + + constexpr std::string_view kVersionForms + = "MAJOR.SEMIMAJOR.MINOR.PATCH, unstable, nightly, " + "YYYY-MM-DD-unstable or " + "YYYY-MM-DD-nightly"; + + Rejection + Reject(std::string message) + { + return Rejection{ std::move(message) }; + } + + // The one version of a command, written as the argument [text]. + std::variant<Version, Rejection> + ReadVersion(std::string_view command, std::string_view text) + { + if (auto version = ParseVersion(text)) + { + return *version; + } + return Reject( + fmt::format("'{}' is not a version; tazelish {} takes {}", + text, + command, + kVersionForms)); + } + + // `install <version>`. + ParseResult + ParseInstall(const std::vector<std::string_view> &rest) + { + if (rest.size() != 1) + { + return Reject("tazelish install takes one version, such as " + "tazelish install 0.4.0.3"); + } + auto version = ReadVersion("install", rest.front()); + if (auto *rejection = std::get_if<Rejection>(&version)) + { + return std::move(*rejection); + } + return Command{ Install{ std::get<Version>(version) } }; + } + + // `use|default [--force] <version>`, the flag before or after the + // version. + template<typename Writing> + ParseResult + ParseWriting(std::string_view command, + const std::vector<std::string_view> &rest) + { + bool force = false; + std::optional<std::string_view> text; + for (const std::string_view argument : rest) + { + if (argument == "--force") + { + if (force) + { + return Reject(fmt::format( + "--force is written twice in tazelish {}", + command)); + } + force = true; + } + else if (argument.size() > 1 && argument.front() == '-') + { + return Reject(fmt::format("'{}' is not an option of " + "tazelish {}; it takes --force", + argument, + command)); + } + else if (text) + { + return Reject( + fmt::format("tazelish {} takes one version", command)); + } + else + { + text = argument; + } + } + if (!text) + { + return Reject(fmt::format( + "tazelish {} takes a version, such as tazelish {} 0.4.0.3", + command, + command)); + } + auto version = ReadVersion(command, *text); + if (auto *rejection = std::get_if<Rejection>(&version)) + { + return std::move(*rejection); + } + return Command{ Writing{ std::get<Version>(version), force } }; + } + + // `self update|remove|purge`. + ParseResult + ParseSelf(const std::vector<std::string_view> &rest) + { + if (rest.size() == 1) + { + if (rest.front() == "update") + { + return Command{ Self{ SelfAction::kUpdate } }; + } + if (rest.front() == "remove") + { + return Command{ Self{ SelfAction::kRemove } }; + } + if (rest.front() == "purge") + { + return Command{ Self{ SelfAction::kPurge } }; + } + } + return Reject("tazelish self takes one of update, remove or purge"); + } + + // `help [command]`. + ParseResult + ParseHelp(const std::vector<std::string_view> &rest) + { + if (rest.empty()) + { + return Command{ Help{} }; + } + if (rest.size() == 1) + { + for (const auto &[name, topic] : kTopics) + { + if (rest.front() == name) + { + return Command{ Help{ topic } }; + } + } + return Reject( + fmt::format("'{}' is not a command of tazelish; write " + "tazelish help for the commands", + rest.front())); + } + return Reject("tazelish help takes at most one command"); + } + + } // namespace + + ParseResult + ParseCommandLine(const std::vector<std::string_view> &arguments) + { + if (arguments.empty()) + { + return Command{ Help{} }; + } + const std::string_view command = arguments.front(); + const std::vector<std::string_view> rest(arguments.begin() + 1, + arguments.end()); + if (command == "install") + { + return ParseInstall(rest); + } + if (command == "use") + { + return ParseWriting<Use>(command, rest); + } + if (command == "default") + { + return ParseWriting<Default>(command, rest); + } + if (command == "self") + { + return ParseSelf(rest); + } + if (command == "help") + { + return ParseHelp(rest); + } + return Reject(fmt::format( + "'{}' is not a command of tazelish; write tazelish help for the " + "commands", + command)); + } + + std::string_view + TopicName(Topic topic) + { + for (const auto &[name, candidate] : kTopics) + { + if (candidate == topic) + { + return name; + } + } + return {}; + } + +} // namespace Progmasoft::Tazelish diff --git a/Sources/Help.cpp b/Sources/Help.cpp new file mode 100644 index 0000000..9febd19 --- /dev/null +++ b/Sources/Help.cpp @@ -0,0 +1,105 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include "Progmasoft/Tazelish/Help.hpp" + +namespace Progmasoft::Tazelish +{ + namespace + { + + constexpr std::string_view kGeneral + = R"(Tazelish installs Tazel and chooses which version of it runs. + +Usage: tazelish <command> [arguments] + +Commands: + install <version> installs a version of Tazel + use [--force] <version> writes the version to ./tazelish.txt + default [--force] <version> + writes the version to the config.txt of the user + self update updates Tazelish + self remove removes Tazelish and the versions it installed + self purge also removes its settings, downloads and logs + help [command] prints this help, or the help of one command + +A version is MAJOR.SEMIMAJOR.MINOR.PATCH, unstable, nightly, +YYYY-MM-DD-unstable or YYYY-MM-DD-nightly. + +Exit codes: 0 success, 1 the work failed, 2 the command line was wrong. +)"; + + constexpr std::string_view kInstall + = R"(Usage: tazelish install <version> + +Installs a version of Tazel: + tazelish install 0.4.0.3 a release + tazelish install unstable the newest unstable build + tazelish install nightly the newest nightly build + tazelish install 2026-11-05-unstable the unstable build of a day + tazelish install 2026-11-05-nightly the nightly build of a day +)"; + + constexpr std::string_view kUse + = R"(Usage: tazelish use [--force] <version> + +Writes the version to tazelish.txt in the current folder, so Tazel runs that +version there and in the folders below. The nearest tazelish.txt comes before +the config.txt of the user. + +An existing tazelish.txt is an error; --force writes over it. +)"; + + constexpr std::string_view kDefault + = R"(Usage: tazelish default [--force] <version> + +Writes the version to the config.txt of the user, the version Tazel runs where +no tazelish.txt names one: + $HOME/.tazelish/config.txt on Linux and macOS + %USERPROFILE%\.tazelish\config.txt on Windows + +An existing config.txt is an error; --force writes over it. +)"; + + constexpr std::string_view kSelf + = R"(Usage: tazelish self update|remove|purge + + update updates Tazelish + remove removes Tazelish, the versions of Tazel it installed and the PATH + entries it added + purge does what remove does and also deletes the config.txt, the + downloads and the logs of Tazelish +)"; + + constexpr std::string_view kHelp = R"(Usage: tazelish help [command] + +Prints the help of Tazelish, or the help of one command: install, use, +default, self or help. +)"; + + } // namespace + + std::string_view + HelpText(std::optional<Topic> topic) + { + if (!topic) + { + return kGeneral; + } + switch (*topic) + { + case Topic::kInstall: + return kInstall; + case Topic::kUse: + return kUse; + case Topic::kDefault: + return kDefault; + case Topic::kSelf: + return kSelf; + case Topic::kHelp: + return kHelp; + } + return kGeneral; + } + +} // namespace Progmasoft::Tazelish diff --git a/Sources/Main.cpp b/Sources/Main.cpp new file mode 100644 index 0000000..8ea8b89 --- /dev/null +++ b/Sources/Main.cpp @@ -0,0 +1,140 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <cstdio> +#include <filesystem> +#include <fmt/format.h> +#include <string_view> +#include <vector> + +#include "Progmasoft/Tazelish/CommandLine.hpp" +#include "Progmasoft/Tazelish/Help.hpp" +#include "Progmasoft/Tazelish/VersionFiles.hpp" + +namespace +{ + + namespace fs = std::filesystem; + namespace tazelish = Progmasoft::Tazelish; + + constexpr int kSuccess = 0; + constexpr int kFailure = 1; + constexpr int kUsage = 2; + + int + Report(const tazelish::FileError &error) + { + fmt::print(stderr, + "error: {} {}\n", + error.file.string(), + error.message); + return kFailure; + } + + int + Write(const fs::path &file, const tazelish::Version &version, bool force) + { + if (auto error = tazelish::WriteVersionFile(file, version, force)) + { + return Report(*error); + } + fmt::print("Wrote {} to {}\n", + tazelish::FormatVersion(version), + file.string()); + return kSuccess; + } + + int + RunUse(const tazelish::Use &use) + { + return Write(fs::path(".") / fs::path(tazelish::kProjectFileName), + use.version, + use.force); + } + + int + RunDefault(const tazelish::Default &choice) + { + const auto home = tazelish::HomeDirectory(); + if (!home) + { +#ifdef _WIN32 + fmt::print(stderr, "error: USERPROFILE is not set\n"); +#else + fmt::print(stderr, "error: HOME is not set\n"); +#endif + return kFailure; + } + return Write(tazelish::ConfigFile(*home), choice.version, choice.force); + } + + // Installing and updating download from static.tazel.net, which this build + // of Tazelish does not do. + int + RunDownloading(std::string_view command) + { + fmt::print( + stderr, + "error: tazelish {} downloads from static.tazel.net, and this " + "build of Tazelish does not download\n", + command); + return kFailure; + } + + std::string_view + SelfName(tazelish::SelfAction action) + { + switch (action) + { + case tazelish::SelfAction::kUpdate: + return "self update"; + case tazelish::SelfAction::kRemove: + return "self remove"; + case tazelish::SelfAction::kPurge: + return "self purge"; + } + return "self"; + } + + int + Run(const tazelish::Command &command) + { + if (const auto *help = std::get_if<tazelish::Help>(&command)) + { + fmt::print("{}", tazelish::HelpText(help->topic)); + return kSuccess; + } + if (const auto *use = std::get_if<tazelish::Use>(&command)) + { + return RunUse(*use); + } + if (const auto *choice = std::get_if<tazelish::Default>(&command)) + { + return RunDefault(*choice); + } + if (std::holds_alternative<tazelish::Install>(command)) + { + return RunDownloading("install"); + } + return RunDownloading( + SelfName(std::get<tazelish::Self>(command).action)); + } + +} // namespace + +int +main(int argc, char **argv) +{ + std::vector<std::string_view> arguments; + for (int index = 1; index < argc; ++index) + { + arguments.emplace_back(argv[index]); + } + const auto parsed = tazelish::ParseCommandLine(arguments); + if (const auto *rejection = std::get_if<tazelish::Rejection>(&parsed)) + { + fmt::print(stderr, "error: {}\n", rejection->message); + return kUsage; + } + return Run(std::get<tazelish::Command>(parsed)); +} diff --git a/Sources/Version.cpp b/Sources/Version.cpp new file mode 100644 index 0000000..9bede40 --- /dev/null +++ b/Sources/Version.cpp @@ -0,0 +1,196 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <array> +#include <fmt/format.h> +#include <limits> + +#include "Progmasoft/Tazelish/Version.hpp" + +namespace Progmasoft::Tazelish +{ + namespace + { + + constexpr std::string_view kUnstable = "unstable"; + constexpr std::string_view kNightly = "nightly"; + + std::optional<Channel> + ParseChannel(std::string_view text) + { + if (text == kUnstable) + { + return Channel::kUnstable; + } + if (text == kNightly) + { + return Channel::kNightly; + } + return std::nullopt; + } + + std::string_view + ChannelName(Channel channel) + { + return channel == Channel::kUnstable ? kUnstable : kNightly; + } + + bool + IsDigit(char character) + { + return character >= '0' && character <= '9'; + } + + // A number of digits only, without a leading zero unless it is zero. + std::optional<std::uint32_t> + ParseNumber(std::string_view text) + { + if (text.empty() || (text.size() > 1 && text.front() == '0')) + { + return std::nullopt; + } + std::uint64_t value = 0; + for (const char character : text) + { + if (!IsDigit(character)) + { + return std::nullopt; + } + value + = value * 10 + static_cast<std::uint64_t>(character - '0'); + if (value > std::numeric_limits<std::uint32_t>::max()) + { + return std::nullopt; + } + } + return static_cast<std::uint32_t>(value); + } + + std::optional<Release> + ParseRelease(std::string_view text) + { + std::array<std::uint32_t, 4> numbers{}; + for (std::size_t index = 0; index < numbers.size(); ++index) + { + const std::size_t dot = text.find('.'); + const bool last = index + 1 == numbers.size(); + if (last != (dot == std::string_view::npos)) + { + return std::nullopt; + } + const auto number = ParseNumber(text.substr(0, dot)); + if (!number) + { + return std::nullopt; + } + numbers[index] = *number; + text = last ? std::string_view{} : text.substr(dot + 1); + } + return Release{ numbers[0], numbers[1], numbers[2], numbers[3] }; + } + + // Exactly [width] digits; leading zeros belong to a date. + std::optional<std::uint32_t> + ParseFixed(std::string_view text, std::size_t width) + { + if (text.size() != width) + { + return std::nullopt; + } + std::uint32_t value = 0; + for (const char character : text) + { + if (!IsDigit(character)) + { + return std::nullopt; + } + value + = value * 10 + static_cast<std::uint32_t>(character - '0'); + } + return value; + } + + bool + IsLeapYear(std::uint32_t year) + { + return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0; + } + + std::uint32_t + DaysInMonth(std::uint32_t year, std::uint32_t month) + { + constexpr std::array<std::uint32_t, 12> kDays + = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + return month == 2 && IsLeapYear(year) ? 29 : kDays[month - 1]; + } + + // YYYY-MM-DD-channel, with a date the calendar has. + std::optional<Dated> + ParseDated(std::string_view text) + { + constexpr std::size_t kDateLength = 10; + if (text.size() <= kDateLength + 1 || text[4] != '-' + || text[7] != '-' || text[kDateLength] != '-') + { + return std::nullopt; + } + const auto year = ParseFixed(text.substr(0, 4), 4); + const auto month = ParseFixed(text.substr(5, 2), 2); + const auto day = ParseFixed(text.substr(8, 2), 2); + const auto channel = ParseChannel(text.substr(kDateLength + 1)); + if (!year || !month || !day || !channel || *year == 0 || *month == 0 + || *month > 12 || *day == 0 + || *day > DaysInMonth(*year, *month)) + { + return std::nullopt; + } + return Dated{ static_cast<std::uint16_t>(*year), + static_cast<std::uint8_t>(*month), + static_cast<std::uint8_t>(*day), + *channel }; + } + + } // namespace + + std::optional<Version> + ParseVersion(std::string_view text) + { + if (const auto channel = ParseChannel(text)) + { + return Newest{ *channel }; + } + if (const auto release = ParseRelease(text)) + { + return *release; + } + if (const auto dated = ParseDated(text)) + { + return *dated; + } + return std::nullopt; + } + + std::string + FormatVersion(const Version &version) + { + if (const auto *release = std::get_if<Release>(&version)) + { + return fmt::format("{}.{}.{}.{}", + release->majorNumber, + release->semimajorNumber, + release->minorNumber, + release->patchNumber); + } + if (const auto *newest = std::get_if<Newest>(&version)) + { + return std::string(ChannelName(newest->channel)); + } + const auto &dated = std::get<Dated>(version); + return fmt::format("{:04}-{:02}-{:02}-{}", + dated.year, + dated.month, + dated.day, + ChannelName(dated.channel)); + } + +} // namespace Progmasoft::Tazelish diff --git a/Sources/VersionFiles.cpp b/Sources/VersionFiles.cpp new file mode 100644 index 0000000..2b11cee --- /dev/null +++ b/Sources/VersionFiles.cpp @@ -0,0 +1,195 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <cstdlib> +#include <fmt/format.h> +#include <fstream> +#include <system_error> +#include <utility> + +#include "Progmasoft/Tazelish/VersionFiles.hpp" + +namespace Progmasoft::Tazelish +{ + namespace + { + + namespace fs = std::filesystem; + + // A version file is short; anything longer names no version. + constexpr std::size_t kLongestContent = 64; + + FileError + Fail(const fs::path &file, std::string message) + { + return FileError{ file, std::move(message) }; + } + + // The text of a file without the line break and blanks around the + // version. + std::string_view + Trim(std::string_view text) + { + constexpr std::string_view kBlanks = " \t\r\n"; + constexpr std::string_view kByteOrderMark = "\xEF\xBB\xBF"; + if (text.substr(0, kByteOrderMark.size()) == kByteOrderMark) + { + text.remove_prefix(kByteOrderMark.size()); + } + const std::size_t first = text.find_first_not_of(kBlanks); + if (first == std::string_view::npos) + { + return {}; + } + const std::size_t last = text.find_last_not_of(kBlanks); + return text.substr(first, last - first + 1); + } + + } // namespace + + std::optional<fs::path> + HomeDirectory() + { +#ifdef _WIN32 + constexpr const char *kVariable = "USERPROFILE"; +#else + constexpr const char *kVariable = "HOME"; +#endif + // The environment is read once, before any thread starts. + const char *value + = std::getenv(kVariable); // NOLINT(concurrency-mt-unsafe) + if (value == nullptr || *value == '\0') + { + return std::nullopt; + } + return fs::path(value); + } + + fs::path + StateDirectory(const fs::path &home) + { + return home / fs::path(kStateDirectoryName); + } + + fs::path + ConfigFile(const fs::path &home) + { + return StateDirectory(home) / fs::path(kConfigFileName); + } + + std::variant<NoSelection, Version, FileError> + ReadVersionFile(const fs::path &file) + { + std::error_code error; + const fs::file_status status = fs::status(file, error); + if (status.type() == fs::file_type::not_found) + { + return NoSelection{}; + } + if (error) + { + return Fail(file, error.message()); + } + if (status.type() != fs::file_type::regular) + { + return Fail(file, "is not a regular file"); + } + std::ifstream stream(file, std::ios::binary); + if (!stream) + { + return Fail(file, "cannot be read"); + } + std::string content; + content.resize(kLongestContent + 1); + stream.read(content.data(), + static_cast<std::streamsize>(content.size())); + content.resize(static_cast<std::size_t>(stream.gcount())); + if (stream.bad()) + { + return Fail(file, "cannot be read"); + } + const std::string_view text = Trim(content); + if (content.size() > kLongestContent) + { + return Fail(file, "holds more than a version"); + } + if (auto version = ParseVersion(text)) + { + return *version; + } + return Fail(file, + fmt::format("holds '{}', which is not a version", text)); + } + + std::variant<NoSelection, Selection, FileError> + SelectVersion(const fs::path &directory, + const std::optional<fs::path> &home) + { + for (fs::path folder = directory;; folder = folder.parent_path()) + { + const fs::path file = folder / fs::path(kProjectFileName); + auto read = ReadVersionFile(file); + if (auto *failure = std::get_if<FileError>(&read)) + { + return std::move(*failure); + } + if (auto *version = std::get_if<Version>(&read)) + { + return Selection{ *version, file, VersionSource::kProject }; + } + if (folder == folder.parent_path()) + { + break; + } + } + if (!home) + { + return NoSelection{}; + } + const fs::path file = ConfigFile(*home); + auto read = ReadVersionFile(file); + if (auto *failure = std::get_if<FileError>(&read)) + { + return std::move(*failure); + } + if (auto *version = std::get_if<Version>(&read)) + { + return Selection{ *version, file, VersionSource::kUser }; + } + return NoSelection{}; + } + + std::optional<FileError> + WriteVersionFile(const fs::path &file, const Version &version, bool force) + { + std::error_code error; + const bool exists = fs::exists(fs::symlink_status(file, error)); + if (error && error != std::errc::no_such_file_or_directory) + { + return Fail(file, error.message()); + } + if (exists && !force) + { + return Fail(file, "already exists; --force writes over it"); + } + if (file.has_parent_path()) + { + fs::create_directories(file.parent_path(), error); + if (error) + { + return Fail(file.parent_path(), error.message()); + } + } + std::ofstream stream(file, std::ios::binary | std::ios::trunc); + const std::string content = FormatVersion(version) + "\n"; + stream.write(content.data(), + static_cast<std::streamsize>(content.size())); + stream.close(); + if (!stream) + { + return Fail(file, "cannot be written"); + } + return std::nullopt; + } + +} // namespace Progmasoft::Tazelish diff --git a/Tests/BUILD.bazel b/Tests/BUILD.bazel new file mode 100644 index 0000000..85146ac --- /dev/null +++ b/Tests/BUILD.bazel @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +load("@rules_cc//cc:defs.bzl", "cc_test") + +cc_test( + name = "tests", + srcs = [ + "CommandLineTest.cpp", + "VersionFilesTest.cpp", + "VersionTest.cpp", + ], + deps = [ + "//:tazelish_library", + "@catch3//:catch3_main", + ], +) diff --git a/Tests/CommandLineTest.cpp b/Tests/CommandLineTest.cpp new file mode 100644 index 0000000..139522b --- /dev/null +++ b/Tests/CommandLineTest.cpp @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <Progmasoft/Catch3.hpp> +#include <string> + +#include "Progmasoft/Tazelish/CommandLine.hpp" + +namespace tazelish = Progmasoft::Tazelish; + +namespace +{ + + tazelish::Command + Parsed(const std::vector<std::string_view> &arguments) + { + auto result = tazelish::ParseCommandLine(arguments); + REQUIRE(std::holds_alternative<tazelish::Command>(result)); + return std::get<tazelish::Command>(result); + } + + std::string + Rejected(const std::vector<std::string_view> &arguments) + { + auto result = tazelish::ParseCommandLine(arguments); + REQUIRE(std::holds_alternative<tazelish::Rejection>(result)); + return std::get<tazelish::Rejection>(result).message; + } + + bool + Contains(const std::string &text, const char *part) + { + return text.find(part) != std::string::npos; + } + +} // namespace + +TEST_CASE("install takes one version", "[command-line]") +{ + const auto command = Parsed({ "install", "2026-11-05-unstable" }); + CHECK(std::get<tazelish::Install>(command).version + == tazelish::Version{ + tazelish::Dated{ 2026, 11, 5, tazelish::Channel::kUnstable } }); + CHECK(Contains(Rejected({ "install" }), "one version")); + CHECK(Contains(Rejected({ "install", "1.0" }), "is not a version")); + CHECK(Contains(Rejected({ "install", "nightly", "unstable" }), + "one version")); +} + +TEST_CASE("use and default take --force before or after the version", + "[command-line]") +{ + CHECK_FALSE(std::get<tazelish::Use>(Parsed({ "use", "0.4.0.3" })).force); + CHECK( + std::get<tazelish::Use>(Parsed({ "use", "--force", "nightly" })).force); + CHECK( + std::get<tazelish::Default>(Parsed({ "default", "nightly", "--force" })) + .force); + + CHECK(Contains(Rejected({ "use", "--force", "--force", "nightly" }), + "twice")); + CHECK(Contains(Rejected({ "default", "-f", "nightly" }), "not an option")); + CHECK(Contains(Rejected({ "default", "--force" }), "takes a version")); + CHECK(Contains(Rejected({ "use", "nightly", "unstable" }), "one version")); +} + +TEST_CASE("self takes update, remove or purge", "[command-line]") +{ + CHECK(std::get<tazelish::Self>(Parsed({ "self", "update" })).action + == tazelish::SelfAction::kUpdate); + CHECK(std::get<tazelish::Self>(Parsed({ "self", "remove" })).action + == tazelish::SelfAction::kRemove); + CHECK(std::get<tazelish::Self>(Parsed({ "self", "purge" })).action + == tazelish::SelfAction::kPurge); + CHECK(Contains(Rejected({ "self" }), "update, remove or purge")); + CHECK( + Contains(Rejected({ "self", "uninstall" }), "update, remove or purge")); + CHECK(Contains(Rejected({ "self", "update", "now" }), + "update, remove or purge")); +} + +TEST_CASE("help names a command or none", "[command-line]") +{ + CHECK_FALSE(std::get<tazelish::Help>(Parsed({})).topic.has_value()); + CHECK_FALSE(std::get<tazelish::Help>(Parsed({ "help" })).topic.has_value()); + CHECK(std::get<tazelish::Help>(Parsed({ "help", "default" })).topic + == tazelish::Topic::kDefault); + CHECK(tazelish::TopicName(tazelish::Topic::kSelf) == "self"); + CHECK(Contains(Rejected({ "help", "fly" }), "not a command")); + CHECK(Contains(Rejected({ "instal", "nightly" }), "not a command")); +} diff --git a/Tests/VersionFilesTest.cpp b/Tests/VersionFilesTest.cpp new file mode 100644 index 0000000..c7d8cfe --- /dev/null +++ b/Tests/VersionFilesTest.cpp @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <Progmasoft/Catch3.hpp> +#include <cstdlib> +#include <fstream> +#include <string> + +#include "Progmasoft/Tazelish/VersionFiles.hpp" + +namespace fs = std::filesystem; +namespace tazelish = Progmasoft::Tazelish; + +namespace +{ + + // A folder of its own below the temporary folder of the test, emptied + // first. + fs::path + Scratch(const std::string &name) + { + const char *root = std::getenv("TEST_TMPDIR"); // NOLINT + const fs::path folder + = (root != nullptr ? fs::path(root) : fs::temp_directory_path()) + / ("tazelish-" + name); + fs::remove_all(folder); + fs::create_directories(folder); + return folder; + } + + void + WriteText(const fs::path &file, const std::string &text) + { + fs::create_directories(file.parent_path()); + std::ofstream(file, std::ios::binary) << text; + } + + tazelish::Version + Nightly() + { + return tazelish::Newest{ tazelish::Channel::kNightly }; + } + + std::string + Selected(const fs::path &directory, const fs::path &home) + { + const auto selected = tazelish::SelectVersion(directory, home); + REQUIRE(std::holds_alternative<tazelish::Selection>(selected)); + return tazelish::FormatVersion( + std::get<tazelish::Selection>(selected).version); + } + +} // namespace + +TEST_CASE("The nearest tazelish.txt comes before config.txt", "[files]") +{ + const fs::path root = Scratch("nearest"); + const fs::path home = root / "home"; + const fs::path project = root / "project"; + const fs::path nested = project / "Sources" / "Deep"; + fs::create_directories(nested); + + CHECK(std::holds_alternative<tazelish::NoSelection>( + tazelish::SelectVersion(nested, home))); + + WriteText(tazelish::ConfigFile(home), "nightly\n"); + auto selected = tazelish::SelectVersion(nested, home); + REQUIRE(std::holds_alternative<tazelish::Selection>(selected)); + CHECK(std::get<tazelish::Selection>(selected).source + == tazelish::VersionSource::kUser); + + WriteText(project / "tazelish.txt", "\xEF\xBB\xBF 0.4.0.3\r\n"); + selected = tazelish::SelectVersion(nested, home); + REQUIRE(std::holds_alternative<tazelish::Selection>(selected)); + const auto &selection = std::get<tazelish::Selection>(selected); + CHECK(selection.source == tazelish::VersionSource::kProject); + CHECK(selection.file == project / "tazelish.txt"); + CHECK(Selected(nested, home) == "0.4.0.3"); + + WriteText(project / "Sources" / "tazelish.txt", "2026-11-05-unstable"); + CHECK(Selected(nested, home) == "2026-11-05-unstable"); +} + +TEST_CASE("A file that names no version is an error", "[files]") +{ + const fs::path root = Scratch("invalid"); + WriteText(root / "tazelish.txt", "latest\n"); + auto selected = tazelish::SelectVersion(root, std::nullopt); + REQUIRE(std::holds_alternative<tazelish::FileError>(selected)); + CHECK(std::get<tazelish::FileError>(selected).message.find("'latest'") + != std::string::npos); + + WriteText(root / "tazelish.txt", std::string(200, '1')); + selected = tazelish::SelectVersion(root, std::nullopt); + REQUIRE(std::holds_alternative<tazelish::FileError>(selected)); + CHECK(std::get<tazelish::FileError>(selected).message + == "holds more than a version"); + + fs::remove(root / "tazelish.txt"); + fs::create_directory(root / "tazelish.txt"); + CHECK(std::holds_alternative<tazelish::FileError>( + tazelish::ReadVersionFile(root / "tazelish.txt"))); +} + +TEST_CASE("Writing over a version file needs --force", "[files]") +{ + const fs::path root = Scratch("force"); + const fs::path config = tazelish::ConfigFile(root / "home"); + + CHECK_FALSE(tazelish::WriteVersionFile(config, Nightly(), false)); + auto read = tazelish::ReadVersionFile(config); + REQUIRE(std::holds_alternative<tazelish::Version>(read)); + CHECK(std::get<tazelish::Version>(read) == Nightly()); + + const tazelish::Version release = tazelish::Release{ 0, 4, 0, 3 }; + const auto refused = tazelish::WriteVersionFile(config, release, false); + REQUIRE(refused.has_value()); + CHECK(refused->message.find("--force") != std::string::npos); + CHECK(std::get<tazelish::Version>(tazelish::ReadVersionFile(config)) + == Nightly()); + + CHECK_FALSE(tazelish::WriteVersionFile(config, release, true)); + CHECK(std::get<tazelish::Version>(tazelish::ReadVersionFile(config)) + == release); +} diff --git a/Tests/VersionTest.cpp b/Tests/VersionTest.cpp new file mode 100644 index 0000000..3f2b4bc --- /dev/null +++ b/Tests/VersionTest.cpp @@ -0,0 +1,68 @@ +// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> +// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0 + +#include <Progmasoft/Catch3.hpp> + +#include "Progmasoft/Tazelish/Version.hpp" + +namespace tazelish = Progmasoft::Tazelish; + +TEST_CASE("A release has four numbers without leading zeros", "[version]") +{ + const auto version = tazelish::ParseVersion("0.4.0.3"); + REQUIRE(version.has_value()); + CHECK(std::get<tazelish::Release>(*version) + == tazelish::Release{ 0, 4, 0, 3 }); + CHECK(tazelish::FormatVersion(*version) == "0.4.0.3"); + CHECK(tazelish::ParseVersion("12.19.9.9").has_value()); + + for (const char *text : { "0.4.0", + "0.4.0.3.1", + "0.04.0.3", + "0.4..3", + ".0.4.0", + "0.4.0.", + "a.4.0.3", + "0.4.0.3 ", + "4294967296.0.0.0", + "" }) + { + INFO(text); + CHECK_FALSE(tazelish::ParseVersion(text).has_value()); + } +} + +TEST_CASE("A channel names its newest build", "[version]") +{ + CHECK(std::get<tazelish::Newest>(*tazelish::ParseVersion("unstable")) + == tazelish::Newest{ tazelish::Channel::kUnstable }); + CHECK(std::get<tazelish::Newest>(*tazelish::ParseVersion("nightly")) + == tazelish::Newest{ tazelish::Channel::kNightly }); + CHECK_FALSE(tazelish::ParseVersion("Nightly").has_value()); + CHECK_FALSE(tazelish::ParseVersion("stable").has_value()); +} + +TEST_CASE("A dated build needs a day the calendar has", "[version]") +{ + const auto version = tazelish::ParseVersion("2026-11-05-nightly"); + REQUIRE(version.has_value()); + CHECK(std::get<tazelish::Dated>(*version) + == tazelish::Dated{ 2026, 11, 5, tazelish::Channel::kNightly }); + CHECK(tazelish::FormatVersion(*version) == "2026-11-05-nightly"); + CHECK(tazelish::ParseVersion("2028-02-29-unstable").has_value()); + + for (const char *text : { "2026-02-29-unstable", + "1900-02-29-nightly", + "2026-13-01-nightly", + "2026-00-10-nightly", + "2026-04-31-nightly", + "2026-11-5-nightly", + "2026-11-05", + "2026-11-05-", + "2026-11-05-stable", + "2026/11/05-nightly" }) + { + INFO(text); + CHECK_FALSE(tazelish::ParseVersion(text).has_value()); + } +}