diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000..b4af64a --- /dev/null +++ b/.bazelrc @@ -0,0 +1,2 @@ +# ooz compression code has undefined behavior that manifests under -O2 with Clang. +build --host_compilation_mode=dbg diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..acd405b --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +8.6.0 diff --git a/.dockerignore b/.dockerignore index 6ba0470..334c93f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,16 +1,19 @@ * +!.bazelrc +!.bazelversion +!BUILD.bazel +!MODULE.bazel +!MODULE.bazel.lock +!third_party +!patcher !web/main.py !web/pobgen.py +!web/pobgen_en.py !web/nebuloch/*.py !web/nebuloch/data/* !web/templates/* -!patcher +patcher/Content.ggpk.d +patcher/out patcher/bin patcher/scripts/__pycache__ -patcher/scripts/ninja_syntax.py patcher/schema.min.json -patcher/build.ninja -patcher/.ninja_log -patcher/Content.ggpk.d -patcher/venv -patcher/out diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c8174c2..8ad1c8a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,40 +4,38 @@ on: pull_request: name: test -defaults: - run: - working-directory: patcher - jobs: patcher-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: bazel-contrib/setup-bazel@0.14.0 with: - go-version: 1.x - - run: go test -v ./... + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + - run: bazel test //patcher/... web-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - run: sudo apt-get install -y ninja-build cmake libsodium-dev libunistring-dev - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: bazel-contrib/setup-bazel@0.14.0 with: - go-version: 1.x - - uses: actions/setup-python@v2 - with: - python-version: 3.x + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true - - run: python -m pip install virtualenv meson - - - run: ./install.sh - - run: ./main.sh - - run: ./release.sh + - run: bash fetch.sh + working-directory: patcher + - run: bash main.sh + working-directory: patcher + - run: bash release.sh + working-directory: patcher + - uses: actions/setup-python@v5 + with: + python-version: 3.x - run: python -m pip install -r requirements.txt -r test-requirements.txt working-directory: web - run: python -m pytest tests diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a6ef824 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bazel-* diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e3f94f8..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "patcher/extract/ooz"] - path = patcher/extract/ooz - url = https://github.com/zao/ooz.git -[submodule "patcher/extract/subprojects/--recusrive"] - path = patcher/extract/subprojects/--recusrive - url = https://github.com/zao/ooz.git -[submodule "patcher/extract/subprojects/ooz"] - path = patcher/extract/subprojects/ooz - url = https://github.com/zao/ooz.git diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000..514c078 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1 @@ +# Root BUILD file diff --git a/Dockerfile b/Dockerfile index 8582909..c7ab267 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,9 @@ -FROM docker.io/alpine:latest AS patcher +FROM gcr.io/bazel-public/bazel:8.6.0 AS patcher -WORKDIR /patcher -COPY patcher /patcher -RUN apk add --no-cache python3 py3-virtualenv go build-base git curl bash samurai \ - meson cmake pkgconfig libsodium-dev libunistring-dev -RUN ./install.sh -RUN ./main.sh +WORKDIR /build +COPY --chown=ubuntu . /build +RUN cd patcher && bash fetch.sh +RUN cd patcher && bash main.sh FROM docker.io/alpine:latest as web @@ -16,6 +14,6 @@ ENV PYTHONUNBUFFERED True WORKDIR /web COPY web /web -COPY --from=patcher /patcher/out/release /web/nebuloch/data +COPY --from=patcher /build/patcher/out/release /web/nebuloch/data CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 main:app diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..f3eab0e --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,76 @@ +module( + name = "void-battery", + version = "0.0.0", +) + +bazel_dep(name = "toolchains_chromium", version = "0.0.1") +bazel_dep(name = "rules_cc", version = "0.2.14") +bazel_dep(name = "libsodium", version = "1.0.19") +bazel_dep(name = "simde", version = "0.8.2") +bazel_dep(name = "rules_go", version = "0.60.0") +bazel_dep(name = "gazelle", version = "0.47.0") +bazel_dep(name = "ooz", version = "0") +bazel_dep(name = "libunistring", version = "1.3") +bazel_dep(name = "rules_python", version = "1.9.0") +bazel_dep(name = "rules_pkg", version = "1.2.0") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "gamedata", version = "0") + +git_override( + module_name = "toolchains_chromium", + remote = "https://github.com/afq984/toolchains_chromium.git", + commit = "1a93deae0f654933afe585749d35b7ef82d89bd8", +) + +git_override( + module_name = "ooz", + remote = "https://github.com/zao/ooz.git", + commit = "6307b387e45c6b2283d622d82d2713a38e25e503", + build_file = "//third_party:ooz.BUILD", + init_submodules = False, + patches = ["//third_party/patches:ooz_add_module.patch"], + patch_strip = 0, +) + +archive_override( + module_name = "libunistring", + urls = ["https://mirrors.kernel.org/gnu/libunistring/libunistring-1.3.tar.gz"], + sha256 = "8ea8ccf86c09dd801c8cac19878e804e54f707cf69884371130d20bde68386b7", + strip_prefix = "libunistring-1.3", + build_file = "//third_party:libunistring.BUILD", + patches = ["//third_party/patches:libunistring_bazel.patch"], + patch_strip = 1, + patch_cmds = [ + # Generate public headers from .in.h templates. + # All @...@ substitutions are DLL_VARIABLE markers, empty on Linux. + "for f in lib/unistr.in.h lib/unicase.in.h lib/unitypes.in.h lib/uninorm.in.h lib/unictype.in.h lib/unistring/woe32dll.in.h; do sed -e 's/@HAVE_UNISTRING_WOE32DLL_H@/0/g' -e 's/@[A-Za-z0-9_]*@//g' \"$f\" > \"${f%.in.h}.h\"; done", + # Generate unistring/stdint.h (just wraps system ). + "echo '#include ' > lib/unistring/stdint.h", + # special-casing.in.h is identical to special-casing.h for our purposes. + "cp lib/unicase/special-casing.in.h lib/unicase/special-casing.h", + ], +) + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//patcher:go.mod") +use_repo( + go_deps, + "com_github_google_go_cmp", + "com_github_pierrec_lz4_v4", + "com_github_spf13_pflag", + "org_golang_x_text", +) + +local_path_override( + module_name = "gamedata", + path = "third_party/empty_gamedata", +) + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain(python_version = "3.12") + +chromium = use_extension("@toolchains_chromium//:extensions.bzl", "chromium") +chromium.toolchain() +use_repo(chromium, "chromium_toolchain") + +register_toolchains("@chromium_toolchain//:all") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 0000000..0c2c3f4 --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,567 @@ +{ + "lockFileVersion": 24, + "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.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.3/MODULE.bazel": "253d739ba126f62a5767d832765b12b59e9f8d2bc88cc1572f4a73e46eb298ca", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.3/source.json": "ffab9254c65ba945f8369297ad97ca0dec213d3adc6e07877e23a48624a8b456", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "812d2dd42f65dca362152101fbec418029cc8fd34cbad1a2fde905383d705838", + "https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "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.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", + "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", + "https://bcr.bazel.build/modules/bazel_features/1.34.0/MODULE.bazel": "e8475ad7c8965542e0c7aac8af68eb48c4af904be3d614b6aa6274c092c2ea1e", + "https://bcr.bazel.build/modules/bazel_features/1.36.0/MODULE.bazel": "596cb62090b039caf1cad1d52a8bc35cf188ca9a4e279a828005e7ee49a1bec3", + "https://bcr.bazel.build/modules/bazel_features/1.38.0/MODULE.bazel": "f9b8a9c890ebd216b4049fd12a31d3c2602e3403c7af636b04fbbd7453edc9c9", + "https://bcr.bazel.build/modules/bazel_features/1.38.0/source.json": "31ba776c122b54a2885e23651642e32f087a87bf025465f8040751894b571277", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", + "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.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/source.json": "34a3c8bcf233b835eb74be9d628899bb32999d3e0eadef1947a0a562a2b16ffb", + "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", + "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", + "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "cdf8cbe5ee750db04b78878c9633cc76e80dcf4416cbe982ac3a9222f80713c8", + "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/source.json": "fa7b512dfcb5eafd90ce3959cf42a2a6fe96144ebbb4b3b3928054895f2afac2", + "https://bcr.bazel.build/modules/gazelle/0.32.0/MODULE.bazel": "b499f58a5d0d3537f3cf5b76d8ada18242f64ec474d8391247438bf04f58c7b8", + "https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350", + "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a", + "https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0", + "https://bcr.bazel.build/modules/gazelle/0.47.0/MODULE.bazel": "b61bb007c4efad134aa30ee7f4a8e2a39b22aa5685f005edaa022fbd1de43ebc", + "https://bcr.bazel.build/modules/gazelle/0.47.0/source.json": "aeb2e5df14b7fb298625d75d08b9c65bdb0b56014c5eb89da9e5dd0572280ae6", + "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.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/helly25_bzl/0.3.1/MODULE.bazel": "3a4be20f6fc13be32ad44643b8252ef5af09eee936f1d943cd4fd7867fa92826", + "https://bcr.bazel.build/modules/helly25_bzl/0.3.1/source.json": "b129ab1828492de2c163785bbeb4065c166de52d932524b4317beb5b7f917994", + "https://bcr.bazel.build/modules/jq.bzl/0.1.0/MODULE.bazel": "2ce69b1af49952cd4121a9c3055faa679e748ce774c7f1fda9657f936cae902f", + "https://bcr.bazel.build/modules/jq.bzl/0.1.0/source.json": "746bf13cac0860f091df5e4911d0c593971cd8796b5ad4e809b2f8e133eee3d5", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/libsodium/1.0.19/MODULE.bazel": "b1ed029b3bd83aabe9cb1d5f4c19b1380ca673ff1b5344dac7705fdde20d2f84", + "https://bcr.bazel.build/modules/libsodium/1.0.19/source.json": "2bdfb4f85a2fce136efe686f9dec4ba0dd2d2a2353603cea0beed2ca06f77967", + "https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92", + "https://bcr.bazel.build/modules/package_metadata/0.0.5/MODULE.bazel": "ef4f9439e3270fdd6b9fd4dbc3d2f29d13888e44c529a1b243f7a31dfbc2e8e4", + "https://bcr.bazel.build/modules/package_metadata/0.0.5/source.json": "2326db2f6592578177751c3e1f74786b79382cd6008834c9d01ec865b9126a85", + "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/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/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "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.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573", + "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4", + "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_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513", + "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", + "https://bcr.bazel.build/modules/rules_cc/0.2.14/MODULE.bazel": "353c99ed148887ee89c54a17d4100ae7e7e436593d104b668476019023b58df8", + "https://bcr.bazel.build/modules/rules_cc/0.2.14/source.json": "55d0a4587c5592fad350f6e698530f4faf0e7dd15e69d43f8d87e220c78bea54", + "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_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", + "https://bcr.bazel.build/modules/rules_go/0.41.0/MODULE.bazel": "55861d8e8bb0e62cbd2896f60ff303f62ffcb0eddb74ecb0e5c0cbe36fc292c8", + "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", + "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", + "https://bcr.bazel.build/modules/rules_go/0.53.0/MODULE.bazel": "a4ed760d3ac0dbc0d7b967631a9a3fd9100d28f7d9fcf214b4df87d4bfff5f9a", + "https://bcr.bazel.build/modules/rules_go/0.60.0/MODULE.bazel": "4a57ff2ffc2a3570e3c5646575c5a4b07287e91bcdac5d1f72383d51502b48cb", + "https://bcr.bazel.build/modules/rules_go/0.60.0/source.json": "1e21368c5e0c3013a110bd79a8fcff8ca46b5bcb2b561713a7273cbfcff7c464", + "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.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963", + "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "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/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.14.0/MODULE.bazel": "717717ed40cc69994596a45aec6ea78135ea434b8402fb91b009b9151dd65615", + "https://bcr.bazel.build/modules/rules_java/8.14.0/source.json": "8a88c4ca9e8759da53cddc88123880565c520503321e2566b4e33d0287a3d4bc", + "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_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/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", + "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", + "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.2.0/MODULE.bazel": "c7db3c2b407e673c7a39e3625dc05dc9f12d6682cbd82a3a5924a13b491eda7e", + "https://bcr.bazel.build/modules/rules_pkg/1.2.0/source.json": "9062e00845bf91a4247465d371baa837adf9b6ff44c542f73ba084f07667e1dc", + "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/MODULE.bazel": "b531d7f09f58dce456cd61b4579ce8c86b38544da75184eadaf0a7cb7966453f", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", + "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.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", + "https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43", + "https://bcr.bazel.build/modules/rules_python/1.9.0/MODULE.bazel": "afc3a05f29f09f2d3ee95ad99a145250dab41a2b2d8d6f82cc91936b3213282c", + "https://bcr.bazel.build/modules/rules_python/1.9.0/source.json": "3921ea0b65298d51aead5b9e4a82203d7be9b5918619b58b53f1c259f4e63169", + "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.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592", + "https://bcr.bazel.build/modules/rules_shell/0.4.1/source.json": "4757bd277fe1567763991c4425b483477bb82e35e777a56fd846eb5cceda324a", + "https://bcr.bazel.build/modules/simde/0.8.2/MODULE.bazel": "a2bd30a435aea5de07ef3c1db64439249d1cda0a7a6b38fa74df00a45f77ce21", + "https://bcr.bazel.build/modules/simde/0.8.2/source.json": "4bf8d591bae4697ab0e8fda4174fcfdab95a3bdee1823db7f3b59f0398c96c01", + "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.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", + "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/tar.bzl/0.2.1/MODULE.bazel": "52d1c00a80a8cc67acbd01649e83d8dd6a9dc426a6c0b754a04fe8c219c76468", + "https://bcr.bazel.build/modules/tar.bzl/0.6.0/MODULE.bazel": "a3584b4edcfafcabd9b0ef9819808f05b372957bbdff41601429d5fd0aac2e7c", + "https://bcr.bazel.build/modules/tar.bzl/0.6.0/source.json": "4a620381df075a16cb3a7ed57bd1d05f7480222394c64a20fa51bdb636fda658", + "https://bcr.bazel.build/modules/toolchains_llvm/1.6.0/MODULE.bazel": "39603859cafb1c6830160fcd6370552e836790e6abb2bfb8d13bff53c0c10a64", + "https://bcr.bazel.build/modules/toolchains_llvm/1.6.0/source.json": "6bd3ef95a288dd2bb1582eca332af850c9a5428a23bb92cb1c57c2dfe6cb7369", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/yq.bzl/0.1.1/MODULE.bazel": "9039681f9bcb8958ee2c87ffc74bdafba9f4369096a2b5634b88abc0eaefa072", + "https://bcr.bazel.build/modules/yq.bzl/0.1.1/source.json": "2d2bad780a9f2b9195a4a370314d2c17ae95eaa745cefc2e12fbc49759b15aa3", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "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": "nvW/NrBXlAmiQw99EMGKkLaD2KbNp2mQDlxdfpr+0Ls=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "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" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_kotlin+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_python+//python/uv:uv.bzl%uv": { + "general": { + "bzlTransitiveDigest": "yG9F6L2IZXKRbD/aIUa6sU7uITLUTBKOMWPbIvl1VdM=", + "usagesDigest": "6MjoD3H+netDdhklgMWks3NARpHVXxy8kfsMe9XXPa8=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "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": {} + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_python+", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python+", + "platforms", + "platforms" + ] + ] + } + }, + "@@toolchains_chromium+//:extensions.bzl%chromium": { + "general": { + "bzlTransitiveDigest": "qwStzyDFpjZSiYdXcQOAFqH5rCIlKsL8UfHPB1TbRyI=", + "usagesDigest": "RitSHER5EN5d5QfaS29C8gnokuWZLPrgFC/mGQcmtyE=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "chromium_toolchain_clang": { + "repoRuleId": "@@toolchains_chromium+//:chromium_clang.bzl%chromium_clang", + "attributes": { + "urls": [ + "https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-llvmorg-23-init-5669-g8a0be0bc-1.tar.xz" + ], + "sha256": "750b331006635281d7d90696629f67db748ba62004c46675eccb8af144141847" + } + }, + "chromium_toolchain_sysroot_linux_x86_64": { + "repoRuleId": "@@toolchains_llvm+//toolchain:sysroot.bzl%sysroot", + "attributes": { + "urls": [ + "https://commondatastorage.googleapis.com/chrome-linux-sysroot/52d61d4446ffebfaa3dda2cd02da4ab4876ff237853f46d273e7f9b666652e1d" + ], + "sha256": "52d61d4446ffebfaa3dda2cd02da4ab4876ff237853f46d273e7f9b666652e1d" + } + }, + "chromium_toolchain": { + "repoRuleId": "@@toolchains_llvm+//toolchain:rules.bzl%toolchain", + "attributes": { + "llvm_versions": { + "": "23.0.0" + }, + "toolchain_roots": { + "": "'@@toolchains_chromium++chromium+chromium_toolchain_clang//'" + }, + "sysroot": { + "linux-x86_64": "'@@toolchains_chromium++chromium+chromium_toolchain_sysroot_linux_x86_64//sysroot'" + }, + "stdlib": { + "": "dynamic-stdc++" + }, + "cxx_builtin_include_directories": { + "linux-x86_64": [ + "%workspace%/lib/clang/23/include" + ] + } + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_features+", + "bazel_features_globals", + "bazel_features++version_extension+bazel_features_globals" + ], + [ + "bazel_features+", + "bazel_features_version", + "bazel_features++version_extension+bazel_features_version" + ], + [ + "toolchains_chromium+", + "toolchains_llvm", + "toolchains_llvm+" + ], + [ + "toolchains_llvm+", + "aspect_bazel_lib", + "aspect_bazel_lib+" + ], + [ + "toolchains_llvm+", + "bazel_features", + "bazel_features+" + ], + [ + "toolchains_llvm+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "toolchains_llvm+", + "bazel_tools", + "bazel_tools" + ], + [ + "toolchains_llvm+", + "helly25_bzl", + "helly25_bzl+" + ] + ] + } + } + }, + "facts": { + "@@rules_go+//go:extensions.bzl%go_sdk": { + "1.25.0": { + "aix_ppc64": [ + "go1.25.0.aix-ppc64.tar.gz", + "e5234a7dac67bc86c528fe9752fc9d63557918627707a733ab4cac1a6faed2d4" + ], + "darwin_amd64": [ + "go1.25.0.darwin-amd64.tar.gz", + "5bd60e823037062c2307c71e8111809865116714d6f6b410597cf5075dfd80ef" + ], + "darwin_arm64": [ + "go1.25.0.darwin-arm64.tar.gz", + "544932844156d8172f7a28f77f2ac9c15a23046698b6243f633b0a0b00c0749c" + ], + "dragonfly_amd64": [ + "go1.25.0.dragonfly-amd64.tar.gz", + "5ed3cf9a810a1483822538674f1336c06b51aa1b94d6d545a1a0319a48177120" + ], + "freebsd_386": [ + "go1.25.0.freebsd-386.tar.gz", + "abea5d5c6697e6b5c224731f2158fe87c602996a2a233ac0c4730cd57bf8374e" + ], + "freebsd_amd64": [ + "go1.25.0.freebsd-amd64.tar.gz", + "86e6fe0a29698d7601c4442052dac48bd58d532c51cccb8f1917df648138730b" + ], + "freebsd_arm": [ + "go1.25.0.freebsd-arm.tar.gz", + "d90b78e41921f72f30e8bbc81d9dec2cff7ff384a33d8d8debb24053e4336bfe" + ], + "freebsd_arm64": [ + "go1.25.0.freebsd-arm64.tar.gz", + "451d0da1affd886bfb291b7c63a6018527b269505db21ce6e14724f22ab0662e" + ], + "freebsd_riscv64": [ + "go1.25.0.freebsd-riscv64.tar.gz", + "7b565f76bd8bda46549eeaaefe0e53b251e644c230577290c0f66b1ecdb3cdbe" + ], + "illumos_amd64": [ + "go1.25.0.illumos-amd64.tar.gz", + "b1e1fdaab1ad25aa1c08d7a36c97d45d74b98b89c3f78c6d2145f77face54a2c" + ], + "linux_386": [ + "go1.25.0.linux-386.tar.gz", + "8c602dd9d99bc9453b3995d20ce4baf382cc50855900a0ece5de9929df4a993a" + ], + "linux_amd64": [ + "go1.25.0.linux-amd64.tar.gz", + "2852af0cb20a13139b3448992e69b868e50ed0f8a1e5940ee1de9e19a123b613" + ], + "linux_arm64": [ + "go1.25.0.linux-arm64.tar.gz", + "05de75d6994a2783699815ee553bd5a9327d8b79991de36e38b66862782f54ae" + ], + "linux_armv6l": [ + "go1.25.0.linux-armv6l.tar.gz", + "a5a8f8198fcf00e1e485b8ecef9ee020778bf32a408a4e8873371bfce458cd09" + ], + "linux_loong64": [ + "go1.25.0.linux-loong64.tar.gz", + "cab86b1cf761b1cb3bac86a8877cfc92e7b036fc0d3084123d77013d61432afc" + ], + "linux_mips": [ + "go1.25.0.linux-mips.tar.gz", + "d66b6fb74c3d91b9829dc95ec10ca1f047ef5e89332152f92e136cf0e2da5be1" + ], + "linux_mips64": [ + "go1.25.0.linux-mips64.tar.gz", + "4082e4381a8661bc2a839ff94ba3daf4f6cde20f8fb771b5b3d4762dc84198a2" + ], + "linux_mips64le": [ + "go1.25.0.linux-mips64le.tar.gz", + "70002c299ec7f7175ac2ef673b1b347eecfa54ae11f34416a6053c17f855afcc" + ], + "linux_mipsle": [ + "go1.25.0.linux-mipsle.tar.gz", + "b00a3a39eff099f6df9f1c7355bf28e4589d0586f42d7d4a394efb763d145a73" + ], + "linux_ppc64": [ + "go1.25.0.linux-ppc64.tar.gz", + "df166f33bd98160662560a72ff0b4ba731f969a80f088922bddcf566a88c1ec1" + ], + "linux_ppc64le": [ + "go1.25.0.linux-ppc64le.tar.gz", + "0f18a89e7576cf2c5fa0b487a1635d9bcbf843df5f110e9982c64df52a983ad0" + ], + "linux_riscv64": [ + "go1.25.0.linux-riscv64.tar.gz", + "c018ff74a2c48d55c8ca9b07c8e24163558ffec8bea08b326d6336905d956b67" + ], + "linux_s390x": [ + "go1.25.0.linux-s390x.tar.gz", + "34e5a2e19f2292fbaf8783e3a241e6e49689276aef6510a8060ea5ef54eee408" + ], + "netbsd_386": [ + "go1.25.0.netbsd-386.tar.gz", + "f8586cdb7aa855657609a5c5f6dbf523efa00c2bbd7c76d3936bec80aa6c0aba" + ], + "netbsd_amd64": [ + "go1.25.0.netbsd-amd64.tar.gz", + "ae8dc1469385b86a157a423bb56304ba45730de8a897615874f57dd096db2c2a" + ], + "netbsd_arm": [ + "go1.25.0.netbsd-arm.tar.gz", + "1ff7e4cc764425fc9dd6825eaee79d02b3c7cafffbb3691687c8d672ade76cb7" + ], + "netbsd_arm64": [ + "go1.25.0.netbsd-arm64.tar.gz", + "e1b310739f26724216aa6d7d7208c4031f9ff54c9b5b9a796ddc8bebcb4a5f16" + ], + "openbsd_386": [ + "go1.25.0.openbsd-386.tar.gz", + "4802a9b20e533da91adb84aab42e94aa56cfe3e5475d0550bed3385b182e69d8" + ], + "openbsd_amd64": [ + "go1.25.0.openbsd-amd64.tar.gz", + "c016cd984bebe317b19a4f297c4f50def120dc9788490540c89f28e42f1dabe1" + ], + "openbsd_arm": [ + "go1.25.0.openbsd-arm.tar.gz", + "a1e31d0bf22172ddde42edf5ec811ef81be43433df0948ece52fecb247ccfd8d" + ], + "openbsd_arm64": [ + "go1.25.0.openbsd-arm64.tar.gz", + "343ea8edd8c218196e15a859c6072d0dd3246fbbb168481ab665eb4c4140458d" + ], + "openbsd_ppc64": [ + "go1.25.0.openbsd-ppc64.tar.gz", + "694c14da1bcaeb5e3332d49bdc2b6d155067648f8fe1540c5de8f3cf8e157154" + ], + "openbsd_riscv64": [ + "go1.25.0.openbsd-riscv64.tar.gz", + "aa510ad25cf54c06cd9c70b6d80ded69cb20188ac6e1735655eef29ff7e7885f" + ], + "plan9_386": [ + "go1.25.0.plan9-386.tar.gz", + "46f8cef02086cf04bf186c5912776b56535178d4cb319cd19c9fdbdd29231986" + ], + "plan9_amd64": [ + "go1.25.0.plan9-amd64.tar.gz", + "29b34391d84095e44608a228f63f2f88113a37b74a79781353ec043dfbcb427b" + ], + "plan9_arm": [ + "go1.25.0.plan9-arm.tar.gz", + "0a047107d13ebe7943aaa6d54b1d7bbd2e45e68ce449b52915a818da715799c2" + ], + "solaris_amd64": [ + "go1.25.0.solaris-amd64.tar.gz", + "9977f9e4351984364a3b2b78f8b88bfd1d339812356d5237678514594b7d3611" + ], + "windows_386": [ + "go1.25.0.windows-386.zip", + "df9f39db82a803af0db639e3613a36681ab7a42866b1384b3f3a1045663961a7" + ], + "windows_amd64": [ + "go1.25.0.windows-amd64.zip", + "89efb4f9b30812eee083cc1770fdd2913c14d301064f6454851428f9707d190b" + ], + "windows_arm64": [ + "go1.25.0.windows-arm64.zip", + "27bab004c72b3d7bd05a69b6ec0fc54a309b4b78cc569dd963d8b3ec28bfdb8c" + ] + } + } + } +} diff --git a/patcher/.gitignore b/patcher/.gitignore index 8055e88..617f46d 100644 --- a/patcher/.gitignore +++ b/patcher/.gitignore @@ -1,10 +1,5 @@ __pycache__/ /bin/ schema.min.json -build.ninja -.ninja_log -/scripts/ninja_syntax.py /Content.ggpk.d -/venv/ /out/ -.wraplock diff --git a/patcher/BUILD.bazel b/patcher/BUILD.bazel new file mode 100644 index 0000000..23f5d84 --- /dev/null +++ b/patcher/BUILD.bazel @@ -0,0 +1,23 @@ +load("@gazelle//:def.bzl", "gazelle") + +# gazelle:prefix github.com/afq984/void-battery/patcher + +gazelle(name = "gazelle") + +py_binary( + name = "fetch", + srcs = ["fetch.py"], + args = [ + "$(location //patcher/extract)", + "$(location //patcher/cmd/poepatcher)", + ], + data = [ + "//patcher/cmd/poepatcher", + "//patcher/extract", + ], +) + +exports_files([ + "go.mod", + "schema.min.json", +]) diff --git a/patcher/README.md b/patcher/README.md index 786302a..c7ef2e8 100644 --- a/patcher/README.md +++ b/patcher/README.md @@ -1,38 +1,44 @@ # Patcher -This directory contains tools to update the game data. +Tools for downloading and extracting game data from the PoE TW patch server. -### Build tools +## Prerequisites -First have these dependencies installed: +* [Bazelisk](https://github.com/bazelbuild/bazelisk) installed as `bazel` +* `curl` -* bash -* python3 -* go -* curl -* gcc -* ninja +## Usage -Then run: +### Fetch game data + +Downloads the schema and game files from the patch server: + +``` +bash fetch.sh +``` + +### Build release files + +Runs the Bazel pipeline (extract → dat2jsonl → release JSON): ``` -./install.sh +bash main.sh ``` -### Download the game files and extract them +### Compare with current web data ``` -./main.sh +bash diff.sh ``` -### Compare the current extracted data with the ones in `../web`: +### Copy release files to the web app ``` -./diff.sh +bash release.sh ``` -### Copy the extracted data to `../web`: +## Running tests ``` -./release.sh +bazel test //patcher/... ``` diff --git a/patcher/cmd/BUILD.bazel b/patcher/cmd/BUILD.bazel new file mode 100644 index 0000000..a8ca58e --- /dev/null +++ b/patcher/cmd/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "cmd", + srcs = ["init.go"], + importpath = "github.com/afq984/void-battery/patcher/cmd", + visibility = ["//visibility:public"], +) diff --git a/patcher/cmd/dat2jsonl/BUILD.bazel b/patcher/cmd/dat2jsonl/BUILD.bazel new file mode 100644 index 0000000..68fea1e --- /dev/null +++ b/patcher/cmd/dat2jsonl/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "dat2jsonl_lib", + srcs = ["main.go"], + importpath = "github.com/afq984/void-battery/patcher/cmd/dat2jsonl", + visibility = ["//visibility:private"], + deps = [ + "//patcher/cmd", + "//patcher/dat", + "//patcher/dat/schema", + "//patcher/dat/types", + "@com_github_spf13_pflag//:pflag", + ], +) + +go_binary( + name = "dat2jsonl", + embed = [":dat2jsonl_lib"], + visibility = ["//visibility:public"], +) diff --git a/patcher/cmd/poepatcher/BUILD.bazel b/patcher/cmd/poepatcher/BUILD.bazel new file mode 100644 index 0000000..4066c62 --- /dev/null +++ b/patcher/cmd/poepatcher/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "poepatcher_lib", + srcs = ["main.go"], + importpath = "github.com/afq984/void-battery/patcher/cmd/poepatcher", + visibility = ["//visibility:private"], + deps = [ + "//patcher/cmd", + "//patcher/poepatcher", + ], +) + +go_binary( + name = "poepatcher", + embed = [":poepatcher_lib"], + visibility = ["//visibility:public"], +) diff --git a/patcher/dat/BUILD.bazel b/patcher/dat/BUILD.bazel new file mode 100644 index 0000000..0b141c7 --- /dev/null +++ b/patcher/dat/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "dat", + srcs = ["dat.go"], + importpath = "github.com/afq984/void-battery/patcher/dat", + visibility = ["//visibility:public"], + deps = ["//patcher/dat/types"], +) diff --git a/patcher/dat/schema/BUILD.bazel b/patcher/dat/schema/BUILD.bazel new file mode 100644 index 0000000..91136fa --- /dev/null +++ b/patcher/dat/schema/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "schema", + srcs = ["schema.go"], + importpath = "github.com/afq984/void-battery/patcher/dat/schema", + visibility = ["//visibility:public"], + deps = ["//patcher/dat/types"], +) diff --git a/patcher/dat/types/BUILD.bazel b/patcher/dat/types/BUILD.bazel new file mode 100644 index 0000000..aed8718 --- /dev/null +++ b/patcher/dat/types/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "types", + srcs = [ + "array.go", + "bool.go", + "int.go", + "layout.go", + "null.go", + "pointer.go", + "string.go", + "struct.go", + "type.go", + "value.go", + ], + importpath = "github.com/afq984/void-battery/patcher/dat/types", + visibility = ["//visibility:public"], + deps = ["@org_golang_x_text//encoding/unicode"], +) + +go_test( + name = "types_test", + srcs = ["types_test.go"], + embed = [":types"], + deps = ["@com_github_google_go_cmp//cmp"], +) diff --git a/patcher/extract/BUILD.bazel b/patcher/extract/BUILD.bazel new file mode 100644 index 0000000..8c9679b --- /dev/null +++ b/patcher/extract/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + +cc_binary( + name = "extract", + srcs = ["extract.cpp"], + copts = ["-std=c++17"], + data = ["@ooz//:libooz_so"], + visibility = ["//patcher:__subpackages__"], + deps = [ + "@ooz//:libbun", + "@rules_cc//cc/runfiles", + ], +) diff --git a/patcher/extract/extract.cpp b/patcher/extract/extract.cpp index 92b2562..2c87e1a 100644 --- a/patcher/extract/extract.cpp +++ b/patcher/extract/extract.cpp @@ -1,17 +1,20 @@ -#ifdef NDEBUG -#error broken config -#endif - -#include +#include #include #include +#include #include #include #include +#include "rules_cc/cc/runfiles/runfiles.h" + +using rules_cc::cc::runfiles::Runfiles; int main(int argc, char **argv) { - assert(argc == 3 || argc == 4); + if (argc != 3 && argc != 4) { + fprintf(stderr, "usage: %s [output]\n", argv[0]); + return 1; + } std::string ggpkd(argv[1]); std::string path(argv[2]); std::optional out; @@ -19,31 +22,49 @@ int main(int argc, char **argv) { out = argv[3]; } - Bun *bun = - BunNew("extract/build/subprojects/ooz/liblibooz.so", "Ooz_Decompress"); - assert(bun); + std::string error; + auto runfiles = std::unique_ptr( + Runfiles::Create(argv[0], BAZEL_CURRENT_REPOSITORY, &error)); + if (!runfiles) { + fprintf(stderr, "Failed to create runfiles: %s\n", error.c_str()); + return 1; + } + auto ooz_path = runfiles->Rlocation("ooz/liblibooz.so"); + Bun *bun = BunNew(ooz_path.c_str(), "Ooz_Decompress"); + if (!bun) { + fprintf(stderr, "Failed to load liblibooz.so\n"); + return 1; + } BunIndex *idx = BunIndexOpen(bun, nullptr, ggpkd.c_str()); - assert(idx); + if (!idx) { + fprintf(stderr, "Failed to open bundle index at %s\n", ggpkd.c_str()); + return 1; + } int32_t file_id = BunIndexLookupFileByPath(idx, path.c_str()); - assert(file_id >= 0); + if (file_id < 0) { + fprintf(stderr, "File not found: %s\n", path.c_str()); + return 1; + } uint64_t path_hash; uint32_t bundle_id; uint32_t offset; uint32_t size; - assert(BunIndexFileInfo(idx, file_id, &path_hash, &bundle_id, &offset, - &size) == 0); + BunIndexFileInfo(idx, file_id, &path_hash, &bundle_id, &offset, &size); if (!out) { const char* name; uint32_t uncompressed_size; - assert(BunIndexBundleInfo(idx, bundle_id, &name, &uncompressed_size) == 0); + BunIndexBundleInfo(idx, bundle_id, &name, &uncompressed_size); printf("%s\n", name); } else { BunMem p = BunIndexExtractBundle(idx, bundle_id); - assert(p); + if (!p) { + fprintf(stderr, "Failed to extract bundle %u\n", bundle_id); + return 1; + } std::filesystem::create_directories(out->parent_path()); diff --git a/patcher/extract/meson.build b/patcher/extract/meson.build deleted file mode 100644 index 380ecf3..0000000 --- a/patcher/extract/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -project( - 'extract', - 'cpp', - default_options: ['warning_level=0', 'cpp_std=c++17'], -) - -cmake = import('cmake') - -ooz = cmake.subproject('ooz') - -exe = executable( - 'extract', - 'extract.cpp', - install: true, - dependencies: [ - ooz.dependency('libbun'), - ooz.dependency('libooz'), - ], -) diff --git a/patcher/extract/subprojects/ooz b/patcher/extract/subprojects/ooz deleted file mode 160000 index 6307b38..0000000 --- a/patcher/extract/subprojects/ooz +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6307b387e45c6b2283d622d82d2713a38e25e503 diff --git a/patcher/fetch.py b/patcher/fetch.py new file mode 100644 index 0000000..c688fd9 --- /dev/null +++ b/patcher/fetch.py @@ -0,0 +1,74 @@ +"""Populate Content.ggpk.d/ with game data needed by the patcher pipeline. + +This is the non-hermetic fetch step: it downloads game files from the +patch server and resolves bundle paths via the extract binary. + +Intended to be run via: bazel run //patcher:fetch +""" + +import os +import subprocess +import sys + +# Files to extract (must match genbuild.py) +EXTRACT_DEPS = [ + "data/activeskills.datc64", + "data/baseitemtypes.datc64", + "data/passiveskills.datc64", + "data/skillgems.datc64", + "data/words.datc64", + "data/traditional chinese/activeskills.datc64", + "data/traditional chinese/baseitemtypes.datc64", + "data/traditional chinese/passiveskills.datc64", + "data/traditional chinese/skillgems.datc64", + "data/traditional chinese/words.datc64", + "metadata/statdescriptions/stat_descriptions.txt", + "metadata/statdescriptions/tincture_stat_descriptions.txt", +] + + +def main(): + extract = os.path.abspath(sys.argv[1]) + poepatcher = os.path.abspath(sys.argv[2]) + + patcher_dir = os.path.join(os.environ["BUILD_WORKSPACE_DIRECTORY"], "patcher") + os.chdir(patcher_dir) + + # Seed targets: game binary + bundle index + targets = { + "PathOfExile.exe", + "Bundles2/_.index.bin", + } + subprocess.check_call([poepatcher, *targets]) + + # Discover which bundles contain the files we need + for dep in EXTRACT_DEPS: + result = subprocess.run( + [extract, "Content.ggpk.d/latest", dep], + text=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + if result.returncode: + print(result.stderr, file=sys.stderr) + result.check_returncode() + bundle_path = f"Bundles2/{result.stdout.strip()}.bundle.bin" + print(f"{dep} => {bundle_path}", file=sys.stderr) + targets.add(bundle_path) + + # Fetch all discovered bundles + subprocess.check_call([poepatcher, *targets]) + + # Write Bazel files so --override_repository can point here + latest = os.path.join(patcher_dir, "Content.ggpk.d", "latest") + with open(os.path.join(latest, "MODULE.bazel"), "w") as f: + f.write('module(name = "gamedata", version = "0")\n') + with open(os.path.join(latest, "BUILD.bazel"), "w") as f: + f.write( + 'filegroup(name = "all", srcs = glob(["**"], exclude = ["BUILD.bazel", "MODULE.bazel"]), visibility = ["//visibility:public"])\n' + 'exports_files(glob(["**"], exclude = ["BUILD.bazel", "MODULE.bazel"]), visibility = ["//visibility:public"])\n' + ) + + +if __name__ == "__main__": + main() diff --git a/patcher/fetch.sh b/patcher/fetch.sh new file mode 100755 index 0000000..9c04c6a --- /dev/null +++ b/patcher/fetch.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Download schema and fetch game data. Run main.sh afterwards to process. + +set -eux + +cd "$(dirname "$0")" + +curl -o schema.min.json -fL https://github.com/poe-tool-dev/dat-schema/releases/download/latest/schema.min.json + +bazel run //patcher:fetch diff --git a/patcher/install.sh b/patcher/install.sh deleted file mode 100755 index 40e5fb2..0000000 --- a/patcher/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -ex - -curl -o schema.min.json -fL https://github.com/poe-tool-dev/dat-schema/releases/download/latest/schema.min.json -curl -o scripts/ninja_syntax.py -fL https://github.com/ninja-build/ninja/raw/master/misc/ninja_syntax.py - -virtualenv venv -venv/bin/python -m pip install tqdm - -go build -o bin/ ./cmd/... - -meson setup --wipe --optimization=2 extract/build extract -ninja -C extract/build diff --git a/patcher/main.sh b/patcher/main.sh index 81499e1..1af7efe 100755 --- a/patcher/main.sh +++ b/patcher/main.sh @@ -2,8 +2,10 @@ set -eux -mkdir -p out/release -mkdir -p out/extracted +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" + +bazel build //patcher/pipeline:release \ + --override_repository=gamedata+="$REPO_ROOT/patcher/Content.ggpk.d/latest" -venv/bin/python scripts/genbuild.py -ninja +mkdir -p out/release +tar xf "$REPO_ROOT/bazel-bin/patcher/pipeline/release.tar" -C out/release/ diff --git a/patcher/pipeline/BUILD.bazel b/patcher/pipeline/BUILD.bazel new file mode 100644 index 0000000..b7b02ba --- /dev/null +++ b/patcher/pipeline/BUILD.bazel @@ -0,0 +1,104 @@ +load("@rules_pkg//pkg:tar.bzl", "pkg_tar") +load(":defs.bzl", "patcher_dat2jsonl", "patcher_extract") + +# Data processing pipeline: extract game data → JSON release files. +# +# Requires game data to be fetched first via: bazel run //patcher:fetch +# +# Build with: +# bazel build //patcher/pipeline:release \ +# --override_repository=gamedata+=$PWD/patcher/Content.ggpk.d/latest + +# --- Extract + dat2jsonl for each table × language --- + +_TABLES = ["BaseItemTypes", "ActiveSkills", "PassiveSkills", "SkillGems", "Words"] + +[ + patcher_dat2jsonl( + name = "%s_%s" % (table, lang), + table_name = table, + lang = lang, + ) + for table in _TABLES + for lang in ["en", "tc"] +] + +# --- Extract stat description files --- + +patcher_extract( + name = "extract_stat_descriptions", + path = "metadata/statdescriptions/stat_descriptions.txt", + out = "extracted/stat_descriptions.txt", +) + +patcher_extract( + name = "extract_tincture_stat_descriptions", + path = "metadata/statdescriptions/tincture_stat_descriptions.txt", + out = "extracted/tincture_stat_descriptions.txt", +) + +# --- Python processing: .jsonl/.txt → release JSON --- + +_JSONL_SRCS = [":dat2jsonl_%s_%s" % (table, lang) for table in _TABLES for lang in ["en", "tc"]] + +genrule( + name = "datrelease", + srcs = _JSONL_SRCS, + outs = [ + "release/bases.json", + "release/passives.json", + "release/words.json", + ], + cmd = "$(location //patcher/scripts:datrelease) --input-dir=$$(dirname $(location :dat2jsonl_BaseItemTypes_en)) --output-dir=$$(dirname $(location release/bases.json))", + tools = ["//patcher/scripts:datrelease"], +) + +genrule( + name = "statparse", + srcs = [ + ":extract_stat_descriptions", + ":extract_tincture_stat_descriptions", + ], + outs = ["release/stat_descriptions.json"], + cmd = "$(location //patcher/scripts:statparse) $(location :extract_stat_descriptions) $(location :extract_tincture_stat_descriptions) > $@", + tools = ["//patcher/scripts:statparse"], +) + +genrule( + name = "charversion", + srcs = ["@gamedata//:PathOfExile.exe"], + outs = ["release/version.txt"], + cmd = "$(location //patcher/scripts:charversion) $(location @gamedata//:PathOfExile.exe) > $@", + tools = ["//patcher/scripts:charversion"], +) + +genrule( + name = "fingerprint", + srcs = [ + "release/bases.json", + "release/stat_descriptions.json", + "release/words.json", + "release/passives.json", + "release/version.txt", + ], + outs = ["release/fingerprint.txt"], + cmd = "$(location //patcher/scripts:fingerprint) $(location release/bases.json) $(location release/stat_descriptions.json) $(location release/words.json) $(location release/passives.json) $(location release/version.txt) > $@", + tools = ["//patcher/scripts:fingerprint"], +) + +# --- Release tarball --- + +pkg_tar( + name = "release", + srcs = [ + "release/bases.json", + "release/fingerprint.txt", + "release/passives.json", + "release/stat_descriptions.json", + "release/version.txt", + "release/words.json", + ], + mode = "0644", + strip_prefix = "release", + visibility = ["//visibility:public"], +) diff --git a/patcher/pipeline/defs.bzl b/patcher/pipeline/defs.bzl new file mode 100644 index 0000000..9618e59 --- /dev/null +++ b/patcher/pipeline/defs.bzl @@ -0,0 +1,50 @@ +"""Macros for the patcher data processing pipeline.""" + +_GAMEDATA = "@gamedata//:all" +_INDEX_BIN = "@gamedata//:Bundles2/_.index.bin" +_EXTRACT = "//patcher/extract" +_DAT2JSONL = "//patcher/cmd/dat2jsonl" +_SCHEMA = "//patcher:schema.min.json" +_GGPKD = "$$(dirname $$(dirname $(location @gamedata//:Bundles2/_.index.bin)))" + +def patcher_extract(name, path, out): + """Extract a file from game bundles.""" + native.genrule( + name = name, + srcs = [_GAMEDATA, _INDEX_BIN], + outs = [out], + cmd = "$(location {extract}) {ggpkd} '{path}' $@".format( + extract = _EXTRACT, + ggpkd = _GGPKD, + path = path, + ), + tools = [_EXTRACT], + ) + +def patcher_dat2jsonl(name, table_name, lang): + """Extract a .datc64 file and convert it to .jsonl. + + Creates two targets: extract_{name} and dat2jsonl_{name}. + """ + datfiles = {"en": "", "tc": "traditional chinese/"} + extract_name = "extract_%s" % name + datfile = "%sdata/%s%s.datc64" % ("", datfiles[lang], table_name.lower()) + + patcher_extract( + name = extract_name, + path = datfile, + out = "extracted/%s.%s.datc64" % (table_name, lang), + ) + + native.genrule( + name = "dat2jsonl_%s" % name, + srcs = [":%s" % extract_name, _SCHEMA], + outs = ["extracted/%s.%s.jsonl" % (table_name, lang)], + cmd = "$(location {dat2jsonl}) --dat=$(location :{extract}) --table-name={table} --schema=$(location {schema}) > $@".format( + dat2jsonl = _DAT2JSONL, + extract = extract_name, + table = table_name, + schema = _SCHEMA, + ), + tools = [_DAT2JSONL], + ) diff --git a/patcher/poepatcher/BUILD.bazel b/patcher/poepatcher/BUILD.bazel new file mode 100644 index 0000000..af86dbc --- /dev/null +++ b/patcher/poepatcher/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "poepatcher", + srcs = ["patcher.go"], + importpath = "github.com/afq984/void-battery/patcher/poepatcher", + visibility = ["//visibility:public"], + deps = [ + "@com_github_pierrec_lz4_v4//:lz4", + "@org_golang_x_text//encoding/unicode", + ], +) diff --git a/patcher/scripts/BUILD.bazel b/patcher/scripts/BUILD.bazel new file mode 100644 index 0000000..d8fd2d0 --- /dev/null +++ b/patcher/scripts/BUILD.bazel @@ -0,0 +1,35 @@ +py_binary( + name = "datrelease", + srcs = ["datrelease.py"], + visibility = ["//patcher:__subpackages__"], +) + +py_binary( + name = "statparse", + srcs = ["statparse.py"], + visibility = ["//patcher:__subpackages__"], + deps = [":pjson", ":tqdm_stub"], +) + +py_binary( + name = "charversion", + srcs = ["charversion.py"], + visibility = ["//patcher:__subpackages__"], +) + +py_binary( + name = "fingerprint", + srcs = ["fingerprint.py"], + visibility = ["//patcher:__subpackages__"], +) + +py_library( + name = "pjson", + srcs = ["pjson.py"], +) + +py_library( + name = "tqdm_stub", + srcs = ["tqdm/__init__.py"], + imports = ["."], +) diff --git a/patcher/scripts/datrelease.py b/patcher/scripts/datrelease.py index 26a3d05..cf2e3c7 100644 --- a/patcher/scripts/datrelease.py +++ b/patcher/scripts/datrelease.py @@ -1,37 +1,39 @@ import json import collections import sys +import argparse +import os -def getjson(name, lang): +def getjson(input_dir, name, lang): out = [] - with open(f'out/extracted/{name}.{lang}.jsonl', encoding='utf8') as file: + with open(os.path.join(input_dir, f'{name}.{lang}.jsonl'), encoding='utf8') as file: for line in file: out.append(json.loads(line)) return out -def generate_words(): - data = getjson('Words', 'tc') +def generate_words(input_dir, output_dir): + data = getjson(input_dir, 'Words', 'tc') words = {} for m in data: words[m['Text2'].strip()] = m['Text'].strip() - write_to_file(words, 'out/release/words.json') + write_to_file(words, os.path.join(output_dir, 'words.json')) -def getnames(fn, lang, fieldname): - data = getjson(fn, lang) +def getnames(input_dir, fn, lang, fieldname): + data = getjson(input_dir, fn, lang) return [m[fieldname].strip() for m in data] -def generate_bases(): - z = getnames('BaseItemTypes', 'tc', 'Name') - e = getnames('BaseItemTypes', 'en', 'Name') - z.extend(getnames('ActiveSkills', 'tc', 'DisplayedName')) - e.extend(getnames('ActiveSkills', 'en', 'DisplayedName')) +def generate_bases(input_dir, output_dir): + z = getnames(input_dir, 'BaseItemTypes', 'tc', 'Name') + e = getnames(input_dir, 'BaseItemTypes', 'en', 'Name') + z.extend(getnames(input_dir, 'ActiveSkills', 'tc', 'DisplayedName')) + e.extend(getnames(input_dir, 'ActiveSkills', 'en', 'DisplayedName')) ze = build_mapping(z, e) @@ -40,7 +42,7 @@ def generate_bases(): ze['鏽劍'] = 'Rusted Sword' ze['奉獻'] = 'The Offering' - write_to_file(ze, 'out/release/bases.json') + write_to_file(ze, os.path.join(output_dir, 'bases.json')) def build_mapping(z, e): @@ -61,13 +63,25 @@ def write_to_file(ze, filename): json.dump(ze, file, ensure_ascii=False, indent=0, sort_keys=True) -def generate_passives(): - z = getnames('PassiveSkills', 'tc', 'Name') - e = getnames('PassiveSkills', 'en', 'Name') +def generate_passives(input_dir, output_dir): + z = getnames(input_dir, 'PassiveSkills', 'tc', 'Name') + e = getnames(input_dir, 'PassiveSkills', 'en', 'Name') ze = build_mapping(z, e) - write_to_file(ze, 'out/release/passives.json') + write_to_file(ze, os.path.join(output_dir, 'passives.json')) -generate_words() -generate_bases() -generate_passives() +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--input-dir', default='out/extracted') + parser.add_argument('--output-dir', default='out/release') + args = parser.parse_args() + + os.makedirs(args.output_dir, exist_ok=True) + + generate_words(args.input_dir, args.output_dir) + generate_bases(args.input_dir, args.output_dir) + generate_passives(args.input_dir, args.output_dir) + + +if __name__ == '__main__': + main() diff --git a/patcher/scripts/genbuild.py b/patcher/scripts/genbuild.py deleted file mode 100644 index db871bb..0000000 --- a/patcher/scripts/genbuild.py +++ /dev/null @@ -1,168 +0,0 @@ -import os -import shlex -import subprocess -import sys - -import ninja_syntax - - -stampfile = "out/extracted/ggpk.stamp" - - -def write_build(writer): - write_download(writer) - - -def write_dat2json(writer, table_name, path, out): - write_extract( - writer, - f"{out}.datc64", - path, - ) - writer.build( - f"{out}.jsonl", - "dat2jsonl", - inputs=f"{out}.datc64", - implicit=["bin/dat2jsonl", "schema.min.json"], - variables={"table_name": table_name}, - ) - - -extract_deps = set() - - -def write_extract(writer, out, path): - writer.build( - out, - "extract", - implicit=["extract/build/extract", stampfile], - variables={"path": shlex.quote(path)}, - ) - extract_deps.add(path) - - -with open("build.ninja", "w", encoding="utf8") as file: - writer = ninja_syntax.Writer(file) - - writer.rule( - "extract", - [ - "extract/build/extract", - "Content.ggpk.d/latest", - "$path", - "$out", - ], - ) - writer.rule( - "dat2jsonl", - "bin/dat2jsonl --dat=$in --table-name=$table_name --schema=schema.min.json > $out", - ) - - write_extract( - writer, - "out/extracted/stat_descriptions.txt", - "metadata/statdescriptions/stat_descriptions.txt", - ) - - write_extract( - writer, - "out/extracted/tincture_stat_descriptions.txt", - "metadata/statdescriptions/tincture_stat_descriptions.txt", - ) - - json_files = [] - for (table_name, datfile) in [ - ("BaseItemTypes", "baseitemtypes"), - ("ActiveSkills", "activeskills"), - ("PassiveSkills", "passiveskills"), - ("SkillGems", "skillgems"), - ("Words", "words"), - ]: - for l, lang in [ - ["en", ""], - ["tc", "traditional chinese/"], - ]: - write_dat2json( - writer, - table_name, - f"data/{lang}{datfile}.datc64", - f"out/extracted/{table_name}.{l}", - ) - json_files.append(f"out/extracted/{table_name}.{l}.jsonl") - - writer.rule("datrelease", "venv/bin/python scripts/datrelease.py") - writer.build( - [ - os.path.join("out", "release", p) - for p in ["bases.json", "passives.json", "words.json"] - ], - "datrelease", - implicit=[ - "scripts/datrelease.py", - *json_files, - ], - ) - - writer.rule( - "statparse", - "venv/bin/python scripts/statparse.py $in > $out", - pool="console", - ) - writer.build( - "out/release/stat_descriptions.json", - "statparse", - [ - "out/extracted/stat_descriptions.txt", - "out/extracted/tincture_stat_descriptions.txt", - ], - implicit="scripts/statparse.py", - ) - - writer.rule("charversion", "venv/bin/python scripts/charversion.py $in | tee $out") - writer.build( - "out/release/version.txt", - "charversion", - "Content.ggpk.d/latest/PathOfExile.exe", - implicit="scripts/charversion.py", - ) - - writer.rule("fingerprint", "venv/bin/python scripts/fingerprint.py $in | tee $out") - writer.build( - "out/release/fingerprint.txt", - "fingerprint", - [ - "out/release/bases.json", - "out/release/stat_descriptions.json", - "out/release/words.json", - "out/release/passives.json", - "out/release/version.txt", - ], - implicit="scripts/fingerprint.py", - ) - - targets = { - "PathOfExile.exe", - "Bundles2/_.index.bin", - } - subprocess.check_call(["bin/poepatcher", *targets]) - - for extract_dep in extract_deps: - result = subprocess.run( - ["extract/build/extract", "Content.ggpk.d/latest", extract_dep], - text=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - if result.returncode: - print(result.stderr, file=sys.stderr) - result.check_returncode() - bundle_path = f"Bundles2/{result.stdout.strip()}.bundle.bin" - print(f"{extract_dep} => {bundle_path}", file=sys.stderr) - targets.add(bundle_path) - - subprocess.check_call(["bin/poepatcher", *targets]) - - objects = [os.path.join("Content.ggpk.d", "latest", target) for target in targets] - - writer.rule("stamp", "touch $out") - writer.build("out/extracted/ggpk.stamp", "stamp", implicit=objects) diff --git a/patcher/scripts/tqdm/__init__.py b/patcher/scripts/tqdm/__init__.py new file mode 100644 index 0000000..c70fe99 --- /dev/null +++ b/patcher/scripts/tqdm/__init__.py @@ -0,0 +1,12 @@ +"""Stub tqdm module for Bazel builds (no progress bar).""" + + +class tqdm: + def __init__(self, **kwargs): + pass + + def update(self, n=1): + pass + + def close(self): + pass diff --git a/patcher/shell.nix b/patcher/shell.nix deleted file mode 100644 index 89c6c6d..0000000 --- a/patcher/shell.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs ? import {} }: - -(pkgs.buildFHSUserEnv { - name = "bazel-userenv-example"; - targetPkgs = pkgs: [ - pkgs.bash - pkgs.virtualenv - pkgs.go - pkgs.meson - pkgs.cmake - pkgs.ninja - pkgs.pkg-config - pkgs.libsodium - pkgs.simde - pkgs.libunistring - pkgs.gcc - pkgs.black - ]; - extraOutputsToInstall = [ "dev" ]; -}).env diff --git a/third_party/BUILD.bazel b/third_party/BUILD.bazel new file mode 100644 index 0000000..2847e1c --- /dev/null +++ b/third_party/BUILD.bazel @@ -0,0 +1,4 @@ +exports_files([ + "libunistring.BUILD", + "ooz.BUILD", +]) diff --git a/third_party/empty_gamedata/BUILD.bazel b/third_party/empty_gamedata/BUILD.bazel new file mode 100644 index 0000000..9a33bd5 --- /dev/null +++ b/third_party/empty_gamedata/BUILD.bazel @@ -0,0 +1,26 @@ +# Stub gamedata repository. Override with --override_repository to provide real data. +# All targets are marked incompatible so `bazel build //...` skips pipeline targets +# that depend on @gamedata rather than failing. + +_INCOMPATIBLE = ["@platforms//:incompatible"] + +filegroup( + name = "all", + srcs = glob(["**"], exclude = ["BUILD.bazel", "MODULE.bazel"]), + target_compatible_with = _INCOMPATIBLE, + visibility = ["//visibility:public"], +) + +filegroup( + name = "Bundles2/_.index.bin", + srcs = ["Bundles2/_.index.bin"], + target_compatible_with = _INCOMPATIBLE, + visibility = ["//visibility:public"], +) + +filegroup( + name = "PathOfExile.exe", + srcs = ["PathOfExile.exe"], + target_compatible_with = _INCOMPATIBLE, + visibility = ["//visibility:public"], +) diff --git a/third_party/empty_gamedata/Bundles2/_.index.bin b/third_party/empty_gamedata/Bundles2/_.index.bin new file mode 100644 index 0000000..e69de29 diff --git a/third_party/empty_gamedata/MODULE.bazel b/third_party/empty_gamedata/MODULE.bazel new file mode 100644 index 0000000..61586d5 --- /dev/null +++ b/third_party/empty_gamedata/MODULE.bazel @@ -0,0 +1,6 @@ +module( + name = "gamedata", + version = "0", +) + +bazel_dep(name = "platforms", version = "1.0.0") diff --git a/third_party/empty_gamedata/PathOfExile.exe b/third_party/empty_gamedata/PathOfExile.exe new file mode 100644 index 0000000..e69de29 diff --git a/third_party/libunistring.BUILD b/third_party/libunistring.BUILD new file mode 100644 index 0000000..33d84c5 --- /dev/null +++ b/third_party/libunistring.BUILD @@ -0,0 +1,80 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +cc_library( + name = "libunistring", + srcs = [ + # u16_to_u8 and dependencies + "lib/unistr/u16-to-u8.c", + "lib/unistr/u16-mbtoucr.c", + "lib/unistr/u8-uctomb.c", + "lib/unistr/u8-uctomb-aux.c", + + # u8_to_u16 and dependencies + "lib/unistr/u8-to-u16.c", + "lib/unistr/u8-mbtoucr.c", + "lib/unistr/u16-uctomb.c", + "lib/unistr/u16-uctomb-aux.c", + + # u16_tolower and dependencies + "lib/unicase/u16-tolower.c", + "lib/unicase/u16-casemap.c", + "lib/unicase/tolower.c", + "lib/unicase/special-casing.c", + "lib/unicase/empty-prefix-context.c", + "lib/unicase/empty-suffix-context.c", + "lib/unicase/cased.c", + "lib/unicase/ignorable.c", + "lib/unictype/pr_soft_dotted.c", + "lib/unictype/combiningclass.c", + "lib/unistr/u16-mbtouc-unsafe.c", + "lib/unistr/u16-mbtouc-unsafe-aux.c", + "lib/unistr/u16-cpy.c", + + # Stub: u16_normalize is referenced by u16_casemap but never + # called when nf==NULL (which is how u16_tolower invokes it). + "lib/u16_normalize_stub.c", + + # Internal headers used by the .c files + "lib/unicase/caseprop.h", + "lib/unicase/cased.h", + "lib/unicase/context.h", + "lib/unicase/ignorable.h", + "lib/unicase/simple-mapping.h", + "lib/unicase/special-casing-table.h", + "lib/unicase/tolower.h", + "lib/unicase/u-casemap.h", + "lib/unicase/unicasemap.h", + "lib/unictype/bitmap.h", + "lib/unictype/combiningclass.h", + "lib/unictype/pr_soft_dotted.h", + "lib/unistr/u-cpy.h", + "lib/unistring-notinline.h", + "lib/attribute.h", + ], + hdrs = [ + "lib/unicase.h", + "lib/unistr.h", + "lib/unitypes.h", + "lib/uninorm.h", + "lib/unictype.h", + "lib/unistring/cdefs.h", + "lib/unistring/inline.h", + "lib/unistring/stdint.h", + "lib/unistring/woe32dll.h", + ], + copts = [ + "-DHAVE_CONFIG_H", + "-DIN_LIBUNISTRING", + "-Wno-unused-parameter", + ], + includes = [ + ".", + "lib", + ], + textual_hdrs = [ + "lib/unicase/special-casing.h", + "lib/unicase/special-casing.in.h", + "config.h", + ], + visibility = ["//visibility:public"], +) diff --git a/third_party/ooz.BUILD b/third_party/ooz.BUILD new file mode 100644 index 0000000..f0522ac --- /dev/null +++ b/third_party/ooz.BUILD @@ -0,0 +1,130 @@ +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_shared_library") + +cc_library( + name = "libooz", + srcs = [ + "bitknit.cpp", + "compr_entropy.cpp", + "compr_kraken.cpp", + "compr_leviathan.cpp", + "compr_match_finder.cpp", + "compr_mermaid.cpp", + "compr_multiarray.cpp", + "compr_tans.cpp", + "compress.cpp", + "kraken.cpp", + "lzna.cpp", + "stdafx.cpp", + ], + hdrs = [ + "bits_rev_table.h", + "compr_entropy.h", + "compr_kraken.h", + "compr_leviathan.h", + "compr_match_finder.h", + "compr_mermaid.h", + "compr_util.h", + "compress.h", + "log_lookup.h", + "match_hasher.h", + "qsort.h", + "stdafx.h", + "targetver.h", + ], + copts = [ + "-std=c++17", + "-Wno-unused-variable", + "-Wno-missing-braces", + "-Wno-unknown-pragmas", + ], + defines = ["OOZ_DYNAMIC"], + local_defines = [ + "OOZ_BUILD_DLL", + # Chromium Clang's x86gprintrin.h doesn't define _rotl. + # Force the fallback path in stdafx.h. + "_rotl(x,n)=(((x)<<(n))|((x)>>(32-(n))))", + ], + visibility = ["//visibility:public"], + deps = ["@simde"], +) + +cc_shared_library( + name = "libooz_so", + shared_lib_name = "liblibooz.so", + visibility = ["//visibility:public"], + deps = [":libooz"], +) + +cc_library( + name = "bunutil", + srcs = [ + "fnv.cpp", + "murmur.cpp", + "path_rep.cpp", + "utf.cpp", + "util.cpp", + ], + hdrs = [ + "fnv.h", + "murmur.h", + "path_rep.h", + "utf.h", + "util.h", + ], + copts = ["-std=c++17"], + visibility = ["//visibility:public"], + deps = [ + "@libsodium", + "@libunistring", + ], +) + +cc_library( + name = "mio", + hdrs = ["libpoe/mio/single_include/mio/mio.hpp"], + strip_include_prefix = "libpoe/mio/single_include", +) + +cc_library( + name = "libpoe", + srcs = [ + "libpoe/poe/format/ggpk.cpp", + "libpoe/poe/util/install_location.cpp", + "libpoe/poe/util/murmur2.cpp", + "libpoe/poe/util/random_access_file.cpp", + "libpoe/poe/util/sha256.cpp", + "libpoe/poe/util/utf.cpp", + ], + hdrs = [ + "libpoe/poe/format/ggpk.hpp", + "libpoe/poe/util/install_location.hpp", + "libpoe/poe/util/murmur2.hpp", + "libpoe/poe/util/random_access_file.hpp", + "libpoe/poe/util/sha256.hpp", + "libpoe/poe/util/utf.hpp", + ], + copts = ["-std=c++17"], + strip_include_prefix = "libpoe", + visibility = ["//visibility:public"], + deps = [ + ":mio", + "@libsodium", + "@libunistring", + ], +) + +cc_library( + name = "libbun", + srcs = ["bun.cpp"], + hdrs = ["bun.h"], + copts = ["-std=c++17"], + defines = ["BUN_DYNAMIC"], + includes = ["."], + linkopts = ["-ldl"], + local_defines = ["BUN_BUILD_DLL"], + visibility = ["//visibility:public"], + deps = [ + ":bunutil", + ":libpoe", + ], +) diff --git a/third_party/patches/BUILD.bazel b/third_party/patches/BUILD.bazel new file mode 100644 index 0000000..3246f65 --- /dev/null +++ b/third_party/patches/BUILD.bazel @@ -0,0 +1,4 @@ +exports_files([ + "libunistring_bazel.patch", + "ooz_add_module.patch", +]) diff --git a/third_party/patches/libunistring_bazel.patch b/third_party/patches/libunistring_bazel.patch new file mode 100644 index 0000000..b219b30 --- /dev/null +++ b/third_party/patches/libunistring_bazel.patch @@ -0,0 +1,56 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +new file mode 100644 +--- /dev/null ++++ b/MODULE.bazel +@@ -0,0 +1,6 @@ ++module( ++ name = "libunistring", ++ version = "1.3", ++) ++ ++bazel_dep(name = "rules_cc", version = "0.2.14") +diff --git a/config.h b/config.h +new file mode 100644 +--- /dev/null ++++ b/config.h +@@ -0,0 +1,21 @@ ++/* Minimal config.h for Bazel build of libunistring subset. */ ++#ifndef _LIBUNISTRING_CONFIG_H ++#define _LIBUNISTRING_CONFIG_H ++ ++#define _GL_CONFIG_H_INCLUDED 1 ++ ++#include ++ ++#if __has_attribute(__nonstring__) ++# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) ++#else ++# define _GL_ATTRIBUTE_NONSTRING ++#endif ++ ++#if __has_attribute(__fallthrough__) ++# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) ++#else ++# define _GL_ATTRIBUTE_FALLTHROUGH ++#endif ++ ++#endif /* _LIBUNISTRING_CONFIG_H */ +diff --git a/lib/u16_normalize_stub.c b/lib/u16_normalize_stub.c +new file mode 100644 +--- /dev/null ++++ b/lib/u16_normalize_stub.c +@@ -0,0 +1,14 @@ ++/* Stub: u16_normalize is referenced by u16_casemap but never called ++ when nf==NULL (which is how u16_tolower uses it). */ ++#include ++#include ++#include ++ ++uint16_t * ++u16_normalize(const void *nf, const uint16_t *s, size_t n, ++ uint16_t *resultbuf, size_t *lengthp) ++{ ++ (void)nf; (void)s; (void)n; (void)resultbuf; (void)lengthp; ++ abort(); ++ return ((void*)0); ++} diff --git a/third_party/patches/ooz_add_module.patch b/third_party/patches/ooz_add_module.patch new file mode 100644 index 0000000..55b00cd --- /dev/null +++ b/third_party/patches/ooz_add_module.patch @@ -0,0 +1,12 @@ +--- /dev/null ++++ MODULE.bazel +@@ -0,0 +1,9 @@ ++module( ++ name = "ooz", ++ version = "0", ++) ++ ++bazel_dep(name = "rules_cc", version = "0.2.14") ++bazel_dep(name = "libsodium", version = "1.0.19") ++bazel_dep(name = "simde", version = "0.8.2") ++bazel_dep(name = "libunistring", version = "1.3")