# HG changeset patch # User MrJuneJune # Date 1768868942 28800 # Node ID f3084bca7317c5f954aa9bc3d6eee522fc42b045 # Parent 589bab390fb4d3f8f9eeb55052b216f6ec4a4163 [Misc] Fixed all errors and all tests should pass now. diff -r 589bab390fb4 -r f3084bca7317 .bazelrc --- a/.bazelrc Mon Jan 19 16:28:45 2026 -0800 +++ b/.bazelrc Mon Jan 19 16:29:02 2026 -0800 @@ -4,5 +4,5 @@ # Suppress duplicate library warnings from openssl BCR module on macOS build:macos --linkopt=-Wl,-no_warn_duplicate_libraries -# Wasm support? -build:wasm --platforms=@emsdk//bazel/emscripten_toolchain:wasm_platform +# esmdk +build --incompatible_enable_cc_toolchain_resolution diff -r 589bab390fb4 -r f3084bca7317 MODULE.bazel.lock --- a/MODULE.bazel.lock Mon Jan 19 16:28:45 2026 -0800 +++ b/MODULE.bazel.lock Mon Jan 19 16:29:02 2026 -0800 @@ -1,5 +1,5 @@ { - "lockFileVersion": 18, + "lockFileVersion": 24, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", @@ -16,7 +16,8 @@ "https://bcr.bazel.build/modules/abseil-py/2.1.0/source.json": "0e8fc4f088ce07099c1cd6594c20c7ddbb48b4b3c0849b7d94ba94be88ff042b", "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.15.1/source.json": "517f2b77430084c541bc9be2db63fdcbb7102938c5f64c17ee60ffda2e5cf07b", + "https://bcr.bazel.build/modules/apple_support/1.23.1/MODULE.bazel": "53763fed456a968cf919b3240427cf3a9d5481ec5466abc9d5dc51bc70087442", + "https://bcr.bazel.build/modules/apple_support/1.23.1/source.json": "d888b44312eb0ad2c21a91d026753f330caa48a25c9b2102fae75eb2b0dcfdd2", "https://bcr.bazel.build/modules/aspect_bazel_lib/1.42.3/MODULE.bazel": "e4529e12d8cd5b828e2b5960d07d3ec032541740d419d7d5b859cabbf5b056f9", "https://bcr.bazel.build/modules/aspect_bazel_lib/1.42.3/source.json": "80cb66069ad626e0921555cd2bf278286fd7763fae2450e564e351792e8303f4", "https://bcr.bazel.build/modules/aspect_rules_js/1.42.0/MODULE.bazel": "f19e6b4a16f77f8cf3728eac1f60dbfd8e043517fd4f4dbf17a75a6c50936d62", @@ -31,6 +32,7 @@ "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.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.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", "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", @@ -237,40 +239,9 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { - "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": { - "general": { - "bzlTransitiveDigest": "p7Ghcq3+nnQxCrf+U3xnhdn7yOSTDbcFyGHK7Ja+rU4=", - "usagesDigest": "EJfdUgbJdIRboG70S9dz8HhGVkL2/s3qFQ9xht8y2Rs=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "local_config_apple_cc_toolchains": { - "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf_toolchains", - "attributes": {} - }, - "local_config_apple_cc": { - "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "apple_support+", - "bazel_tools", - "bazel_tools" - ], - [ - "bazel_tools", - "rules_cc", - "rules_cc+" - ] - ] - } - }, "@@aspect_bazel_lib+//lib:extensions.bzl%toolchains": { "general": { - "bzlTransitiveDigest": "x2ZXNHQB1YYLKrvA8u2W0AEQkJUyosb5KZyGwg7vTtA=", + "bzlTransitiveDigest": "vbydWZC3h/bzoDO1k+vavf1ObACn2dQzZr5H5R5cEQs=", "usagesDigest": "1c7PNX163TGNqWzfejRnWpH/hiT4/GRG0kYxuez0Uz0=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -596,6 +567,98 @@ ] } }, + "@@emsdk+//:emscripten_cache.bzl%emscripten_cache": { + "general": { + "bzlTransitiveDigest": "uqDvXmpTNqW4+ie/Fk+xC3TrFrKvL+9hNtoP51Kt2oo=", + "usagesDigest": "J9IWeZ410irEgOw4Z5HOR+ECEHF2vtBexJDJwlKj99w=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "emscripten_cache": { + "repoRuleId": "@@emsdk+//:emscripten_cache.bzl%_emscripten_cache_repository", + "attributes": { + "configuration": [], + "targets": [] + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@emsdk+//:emscripten_deps.bzl%emscripten_deps": { + "general": { + "bzlTransitiveDigest": "Hb4soNpGiuucvhX2FEDvrMc0H2XZXdouSKR4nzNhxyk=", + "usagesDigest": "q4d/xSWmVLzPJjYUSTdk0iZZXha0f/AG2YTnFO1+N30=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "emscripten_bin_linux": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\npackage(default_visibility = ['//visibility:public'])\n\nfilegroup(\n name = \"all\",\n srcs = glob([\"**\"]),\n)\n\nfilegroup(\n name = \"includes\",\n srcs = glob([\n \"emscripten/cache/sysroot/include/c++/v1/**\",\n \"emscripten/cache/sysroot/include/compat/**\",\n \"emscripten/cache/sysroot/include/**\",\n \"lib/clang/**/include/**\",\n ]),\n)\n\nfilegroup(\n name = \"emcc_common\",\n srcs = [\n \"emscripten/emcc.py\",\n \"emscripten/embuilder.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/cache/sysroot_install.stamp\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/third_party/**\",\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"compiler_files\",\n srcs = [\n \"bin/clang\",\n \"bin/clang++\",\n \":emcc_common\",\n \":includes\",\n ],\n)\n\nfilegroup(\n name = \"linker_files\",\n srcs = [\n \"bin/clang\",\n \"bin/llvm-ar\",\n \"bin/llvm-dwarfdump\",\n \"bin/llvm-nm\",\n \"bin/llvm-objcopy\",\n \"bin/wasm-ctor-eval\",\n \"bin/wasm-emscripten-finalize\",\n \"bin/wasm-ld\",\n \"bin/wasm-metadce\",\n \"bin/wasm-opt\",\n \"bin/wasm-split\",\n \"bin/wasm2js\",\n \":emcc_common\",\n ] + glob(\n include = [\n \"emscripten/cache/sysroot/lib/**\",\n \"emscripten/node_modules/**\",\n \"emscripten/src/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"ar_files\",\n srcs = [\n \"bin/llvm-ar\",\n \"emscripten/emar.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n", + "sha256": "5e4269ab4d4dd97da93f2833bb97780ef6ddee9a7325d345587bddf8890d89aa", + "strip_prefix": "install", + "type": "tar.xz", + "url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/41d2106c68c28e101e6252a48e22c78b07722508/wasm-binaries.tar.xz" + } + }, + "emscripten_bin_linux_arm64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\npackage(default_visibility = ['//visibility:public'])\n\nfilegroup(\n name = \"all\",\n srcs = glob([\"**\"]),\n)\n\nfilegroup(\n name = \"includes\",\n srcs = glob([\n \"emscripten/cache/sysroot/include/c++/v1/**\",\n \"emscripten/cache/sysroot/include/compat/**\",\n \"emscripten/cache/sysroot/include/**\",\n \"lib/clang/**/include/**\",\n ]),\n)\n\nfilegroup(\n name = \"emcc_common\",\n srcs = [\n \"emscripten/emcc.py\",\n \"emscripten/embuilder.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/cache/sysroot_install.stamp\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/third_party/**\",\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"compiler_files\",\n srcs = [\n \"bin/clang\",\n \"bin/clang++\",\n \":emcc_common\",\n \":includes\",\n ],\n)\n\nfilegroup(\n name = \"linker_files\",\n srcs = [\n \"bin/clang\",\n \"bin/llvm-ar\",\n \"bin/llvm-dwarfdump\",\n \"bin/llvm-nm\",\n \"bin/llvm-objcopy\",\n \"bin/wasm-ctor-eval\",\n \"bin/wasm-emscripten-finalize\",\n \"bin/wasm-ld\",\n \"bin/wasm-metadce\",\n \"bin/wasm-opt\",\n \"bin/wasm-split\",\n \"bin/wasm2js\",\n \":emcc_common\",\n ] + glob(\n include = [\n \"emscripten/cache/sysroot/lib/**\",\n \"emscripten/node_modules/**\",\n \"emscripten/src/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"ar_files\",\n srcs = [\n \"bin/llvm-ar\",\n \"emscripten/emar.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n", + "sha256": "2ca54b47a73f1f6687e33b3494748f52d753e2e21b9db505e358d362da4794bb", + "strip_prefix": "install", + "type": "tar.xz", + "url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/41d2106c68c28e101e6252a48e22c78b07722508/wasm-binaries-arm64.tar.xz" + } + }, + "emscripten_bin_mac": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\npackage(default_visibility = ['//visibility:public'])\n\nfilegroup(\n name = \"all\",\n srcs = glob([\"**\"]),\n)\n\nfilegroup(\n name = \"includes\",\n srcs = glob([\n \"emscripten/cache/sysroot/include/c++/v1/**\",\n \"emscripten/cache/sysroot/include/compat/**\",\n \"emscripten/cache/sysroot/include/**\",\n \"lib/clang/**/include/**\",\n ]),\n)\n\nfilegroup(\n name = \"emcc_common\",\n srcs = [\n \"emscripten/emcc.py\",\n \"emscripten/embuilder.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/cache/sysroot_install.stamp\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/third_party/**\",\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"compiler_files\",\n srcs = [\n \"bin/clang\",\n \"bin/clang++\",\n \":emcc_common\",\n \":includes\",\n ],\n)\n\nfilegroup(\n name = \"linker_files\",\n srcs = [\n \"bin/clang\",\n \"bin/llvm-ar\",\n \"bin/llvm-dwarfdump\",\n \"bin/llvm-nm\",\n \"bin/llvm-objcopy\",\n \"bin/wasm-ctor-eval\",\n \"bin/wasm-emscripten-finalize\",\n \"bin/wasm-ld\",\n \"bin/wasm-metadce\",\n \"bin/wasm-opt\",\n \"bin/wasm-split\",\n \"bin/wasm2js\",\n \":emcc_common\",\n ] + glob(\n include = [\n \"emscripten/cache/sysroot/lib/**\",\n \"emscripten/node_modules/**\",\n \"emscripten/src/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"ar_files\",\n srcs = [\n \"bin/llvm-ar\",\n \"emscripten/emar.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n", + "sha256": "d574a26c775b4f737a6960871340b4cdb04eefe44f6fd3a5072c62e86837c1fe", + "strip_prefix": "install", + "type": "tar.xz", + "url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/41d2106c68c28e101e6252a48e22c78b07722508/wasm-binaries.tar.xz" + } + }, + "emscripten_bin_mac_arm64": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\npackage(default_visibility = ['//visibility:public'])\n\nfilegroup(\n name = \"all\",\n srcs = glob([\"**\"]),\n)\n\nfilegroup(\n name = \"includes\",\n srcs = glob([\n \"emscripten/cache/sysroot/include/c++/v1/**\",\n \"emscripten/cache/sysroot/include/compat/**\",\n \"emscripten/cache/sysroot/include/**\",\n \"lib/clang/**/include/**\",\n ]),\n)\n\nfilegroup(\n name = \"emcc_common\",\n srcs = [\n \"emscripten/emcc.py\",\n \"emscripten/embuilder.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/cache/sysroot_install.stamp\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/third_party/**\",\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"compiler_files\",\n srcs = [\n \"bin/clang\",\n \"bin/clang++\",\n \":emcc_common\",\n \":includes\",\n ],\n)\n\nfilegroup(\n name = \"linker_files\",\n srcs = [\n \"bin/clang\",\n \"bin/llvm-ar\",\n \"bin/llvm-dwarfdump\",\n \"bin/llvm-nm\",\n \"bin/llvm-objcopy\",\n \"bin/wasm-ctor-eval\",\n \"bin/wasm-emscripten-finalize\",\n \"bin/wasm-ld\",\n \"bin/wasm-metadce\",\n \"bin/wasm-opt\",\n \"bin/wasm-split\",\n \"bin/wasm2js\",\n \":emcc_common\",\n ] + glob(\n include = [\n \"emscripten/cache/sysroot/lib/**\",\n \"emscripten/node_modules/**\",\n \"emscripten/src/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"ar_files\",\n srcs = [\n \"bin/llvm-ar\",\n \"emscripten/emar.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n", + "sha256": "8a571a73461d7755787fc5ffb35b7284216741cfbbcf52d855d54d2cc36ecb9e", + "strip_prefix": "install", + "type": "tar.xz", + "url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/41d2106c68c28e101e6252a48e22c78b07722508/wasm-binaries-arm64.tar.xz" + } + }, + "emscripten_bin_win": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "build_file_content": "\npackage(default_visibility = ['//visibility:public'])\n\nfilegroup(\n name = \"all\",\n srcs = glob([\"**\"]),\n)\n\nfilegroup(\n name = \"includes\",\n srcs = glob([\n \"emscripten/cache/sysroot/include/c++/v1/**\",\n \"emscripten/cache/sysroot/include/compat/**\",\n \"emscripten/cache/sysroot/include/**\",\n \"lib/clang/**/include/**\",\n ]),\n)\n\nfilegroup(\n name = \"emcc_common\",\n srcs = [\n \"emscripten/emcc.py\",\n \"emscripten/embuilder.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/cache/sysroot_install.stamp\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/third_party/**\",\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"compiler_files\",\n srcs = [\n \"bin/clang.exe\",\n \"bin/clang++.exe\",\n \":emcc_common\",\n \":includes\",\n ],\n)\n\nfilegroup(\n name = \"linker_files\",\n srcs = [\n \"bin/clang.exe\",\n \"bin/llvm-ar.exe\",\n \"bin/llvm-dwarfdump.exe\",\n \"bin/llvm-nm.exe\",\n \"bin/llvm-objcopy.exe\",\n \"bin/wasm-ctor-eval.exe\",\n \"bin/wasm-emscripten-finalize.exe\",\n \"bin/wasm-ld.exe\",\n \"bin/wasm-metadce.exe\",\n \"bin/wasm-opt.exe\",\n \"bin/wasm-split.exe\",\n \"bin/wasm2js.exe\",\n \":emcc_common\",\n ] + glob(\n include = [\n \"emscripten/cache/sysroot/lib/**\",\n \"emscripten/node_modules/**\",\n \"emscripten/src/**\",\n ],\n ),\n)\n\nfilegroup(\n name = \"ar_files\",\n srcs = [\n \"bin/llvm-ar.exe\",\n \"emscripten/emar.py\",\n \"emscripten/emscripten-version.txt\",\n \"emscripten/src/settings.js\",\n \"emscripten/src/settings_internal.js\",\n ] + glob(\n include = [\n \"emscripten/tools/**\",\n ],\n exclude = [\n \"**/__pycache__/**\",\n ],\n ),\n)\n", + "sha256": "a394e719b3258ca7502cb85c9f1031b356ec41f511a187f79bb50b91678aae75", + "strip_prefix": "install", + "type": "zip", + "url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/win/41d2106c68c28e101e6252a48e22c78b07722508/wasm-binaries.zip" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_tools", + "rules_cc", + "rules_cc+" + ], + [ + "emsdk+", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, "@@rules_android+//rules/android_sdk_repository:rule.bzl%android_sdk_repository_extension": { "general": { "bzlTransitiveDigest": "NAy+0M15JNVEBb8Tny6t7j3lKqTnsAMjoBB6LJ+C370=", @@ -614,7 +677,7 @@ }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "OlvsB0HsvxbR8ZN+J9Vf00X/+WVz/Y/5Xrq2LgcVfdo=", + "bzlTransitiveDigest": "rL/34P1aFDq2GqVC2zCFgQ8nTuOC6ziogocpvG50Qz8=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -833,5 +896,6 @@ ] } } - } + }, + "facts": {} } diff -r 589bab390fb4 -r f3084bca7317 README.md --- a/README.md Mon Jan 19 16:28:45 2026 -0800 +++ b/README.md Mon Jan 19 16:29:02 2026 -0800 @@ -2,6 +2,12 @@ This is a mono repo where I will share all my codes and utilize them using bazel. I decied to do this since I re-use codes often and I don't want to deal with making make and cmake every time and this eliminates the problem that exists within C or C++ where using library is harder as we need to add gzillian stuff into it lmao. +## Dependency... + +``` +clang +ffmpeg +``` ## Install @@ -19,9 +25,7 @@ brew install bazel ``` -I might move these binary into the repo so that it has full history of it - -I assume mercurial is installed as well. +I might move these binary into the repo so that it has full history of it. I assume mercurial is installed as well. ## Debugging Command @@ -32,20 +36,12 @@ And run whatever your favoriate debugging tools +## MacOS Memory checks + ```bash bazel run //dowa:dowa_test --run_under="valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes" ``` - - -## This is for memory leak cheak in MacOS - brew install valgrind # or use the unofficial ARM build: arch -x86_64 brew install valgrind arch -x86_64 valgrind ./test - -## TODO For me - -- re-write markdown_to_html file in c and ffi into js -- launch hg-web -- fix warnings in dowa diff -r 589bab390fb4 -r f3084bca7317 deita/BUILD --- a/deita/BUILD Mon Jan 19 16:28:45 2026 -0800 +++ b/deita/BUILD Mon Jan 19 16:29:02 2026 -0800 @@ -14,8 +14,8 @@ ], deps = [ "//dowa:dowa", + "//third_party/sqlite3:sqlite3", ], - linkopts = ["-lsqlite3"], visibility = ["//visibility:public"], ) diff -r 589bab390fb4 -r f3084bca7317 deita/deita.h --- a/deita/deita.h Mon Jan 19 16:28:45 2026 -0800 +++ b/deita/deita.h Mon Jan 19 16:29:02 2026 -0800 @@ -3,20 +3,15 @@ #include "dowa/dowa.h" -// Database types typedef enum { DEITA_DATABASE_TYPE_SQLITE3 = 0 - // Future: DEITA_DATABASE_TYPE_POSTGRES, DEITA_DATABASE_TYPE_MYSQL + // TODO: DEITA_DATABASE_TYPE_POSTGRES, DEITA_DATABASE_TYPE_MYSQL } Deita_Database_Type; -// Connection handle (opaque) typedef struct Deita_Connection Deita_Connection; - -// Result set (opaque) typedef struct Deita_Result_Set Deita_Result_Set; -// Column value type typedef enum { DEITA_COLUMN_TYPE_NULL = 0, @@ -28,74 +23,26 @@ // --- Connection Management --- // -extern Deita_Connection* Deita_Connection_Create( - Deita_Database_Type database_type, - const char *connection_string -); - -extern void Deita_Connection_Close(Deita_Connection *p_connection); - -extern boolean Deita_Connection_Is_Open(Deita_Connection *p_connection); +extern Deita_Connection *Deita_Connection_Create(Deita_Database_Type database_type, const char *connection_string); +extern void Deita_Connection_Close(Deita_Connection *p_connection); +extern boolean Deita_Connection_Is_Open(Deita_Connection *p_connection); // --- Query Execution --- // -extern Deita_Result_Set* Deita_Query_Execute( - Deita_Connection *p_connection, - const char *query, - Dowa_Arena *p_arena -); - -extern Deita_Result_Set* Deita_Query_Execute_Prepared( - Deita_Connection *p_connection, - const char *query, - int32 parameter_count, - const char **parameter_values, - Dowa_Arena *p_arena -); - -extern int32 Deita_Query_Execute_Update( - Deita_Connection *p_connection, - const char *query -); - -extern int32 Deita_Query_Execute_Update_Prepared( - Deita_Connection *p_connection, - const char *query, - int32 parameter_count, - const char **parameter_values -); +extern Deita_Result_Set *Deita_Query_Execute( Deita_Connection *p_connection, const char *query, Dowa_Arena *p_arena); +extern Deita_Result_Set *Deita_Query_Execute_Prepared( Deita_Connection *p_connection, const char *query, int32 parameter_count, const char **parameter_values, Dowa_Arena *p_arena); +extern int32 Deita_Query_Execute_Update(Deita_Connection *p_connection, const char *query); +extern int32 Deita_Query_Execute_Update_Prepared(Deita_Connection *p_connection, const char *query, int32 parameter_count, const char **parameter_values); // --- Result Set Access --- // -extern boolean Deita_Result_Set_Next(Deita_Result_Set *p_result_set); - -extern int32 Deita_Result_Set_Get_Column_Count(Deita_Result_Set *p_result_set); - -extern const char* Deita_Result_Set_Get_Column_Name( - Deita_Result_Set *p_result_set, - int32 column_index -); - -extern Deita_Column_Type Deita_Result_Set_Get_Column_Type( - Deita_Result_Set *p_result_set, - int32 column_index -); - -extern const char* Deita_Result_Set_Get_Text( - Deita_Result_Set *p_result_set, - int32 column_index -); - -extern int64 Deita_Result_Set_Get_Integer( - Deita_Result_Set *p_result_set, - int32 column_index -); - -extern double Deita_Result_Set_Get_Real( - Deita_Result_Set *p_result_set, - int32 column_index -); - -extern void Deita_Result_Set_Free(Deita_Result_Set *p_result_set); +extern boolean Deita_Result_Set_Next(Deita_Result_Set *p_result_set); +extern int32 Deita_Result_Set_Get_Column_Count(Deita_Result_Set *p_result_set); +extern const char *Deita_Result_Set_Get_Column_Name(Deita_Result_Set *p_result_set, int32 column_index); +extern Deita_Column_Type Deita_Result_Set_Get_Column_Type(Deita_Result_Set *p_result_set, int32 column_index); +extern const char *Deita_Result_Set_Get_Text(Deita_Result_Set *p_result_set, int32 column_index); +extern int64 Deita_Result_Set_Get_Integer(Deita_Result_Set *p_result_set, int32 column_index); +extern double Deita_Result_Set_Get_Real(Deita_Result_Set *p_result_set, int32 column_index ); +extern void Deita_Result_Set_Free(Deita_Result_Set *p_result_set); #endif diff -r 589bab390fb4 -r f3084bca7317 deita/deita_internal.h --- a/deita/deita_internal.h Mon Jan 19 16:28:45 2026 -0800 +++ b/deita/deita_internal.h Mon Jan 19 16:29:02 2026 -0800 @@ -1,7 +1,7 @@ #ifndef DEITA_INTERNAL #define DEITA_INTERNAL -#include +#include "third_party/sqlite3/sqlite3.h" #include "deita.h" struct Deita_Connection diff -r 589bab390fb4 -r f3084bca7317 dowa/BUILD --- a/dowa/BUILD Mon Jan 19 16:28:45 2026 -0800 +++ b/dowa/BUILD Mon Jan 19 16:29:02 2026 -0800 @@ -30,6 +30,12 @@ data = glob([ "test_folder/**", ]), - copts = ["-fsanitize=address", "-g"], - linkopts = ["-fsanitize=address"], + copts = select({ + "@platforms//os:osx": ["-fsanitize=address", "-g"], + "@platforms//os:linux": ["-g", "-Wall"], + }), + linkopts = select({ + "@platforms//os:osx": ["-fsanitize=address"], + "@platforms//os:linux": [], + }), ) diff -r 589bab390fb4 -r f3084bca7317 gui_ze/gui_ze.bzl --- a/gui_ze/gui_ze.bzl Mon Jan 19 16:28:45 2026 -0800 +++ b/gui_ze/gui_ze.bzl Mon Jan 19 16:29:02 2026 -0800 @@ -24,8 +24,7 @@ cmd_parts = [ setup_cmd, "$CLANG", - "--target=wasm32", - "-nostdlib", + "--target=wasm32-unknown-unknown", "-O2", "-Wl,--no-entry", "-Wl,--export-dynamic", @@ -444,12 +443,15 @@ {name}_signed_app: The signed .app bundle {name}_dmg: The final DMG file """ + macos_constraint = ["@platforms//os:macos"] + # 1. Build the .app bundle _macos_app( name = name + "_app", binary = binary, app_name = name, bundle_id = bundle_id, + target_compatible_with = macos_constraint, ) # 2. Sign the .app @@ -457,6 +459,7 @@ name = name + "_signed_app", app = ":" + name + "_app", app_name = name, + target_compatible_with = macos_constraint, ) # 3. Create the DMG @@ -476,4 +479,5 @@ """.format(name = name), local = 1, # Disable sandboxing for hdiutil tags = ["no-sandbox"], + target_compatible_with = macos_constraint, ) diff -r 589bab390fb4 -r f3084bca7317 markdown_converter/tests/BUILD --- a/markdown_converter/tests/BUILD Mon Jan 19 16:28:45 2026 -0800 +++ b/markdown_converter/tests/BUILD Mon Jan 19 16:29:02 2026 -0800 @@ -1,13 +1,13 @@ -load("//gui_ze:gui_ze.bzl", "bun_run", "move_files_into_dir") - -# Test for WASM module (run with: bazel test //markdown_converter:markdown_to_html_wasm_test) -filegroup( - name = "all_test_files", - srcs = ["//markdown_converter/wasm:markdown_to_html_wasm"], -) - -bun_run( - name = "markdown_to_html_wasm_test", - src = "test_wasm.js", - data = [":all_test_files"], -) +# load("//gui_ze:gui_ze.bzl", "bun_run", "move_files_into_dir") +# +# # Test for WASM module (run with: bazel test //markdown_converter:markdown_to_html_wasm_test) +# filegroup( +# name = "all_test_files", +# srcs = ["//markdown_converter/wasm:markdown_to_html_wasm"], +# ) +# +# bun_run( +# name = "markdown_to_html_wasm_test", +# src = "test_wasm.js", +# data = [":all_test_files"], +# ) diff -r 589bab390fb4 -r f3084bca7317 markdown_converter/wasm/BUILD --- a/markdown_converter/wasm/BUILD Mon Jan 19 16:28:45 2026 -0800 +++ b/markdown_converter/wasm/BUILD Mon Jan 19 16:29:02 2026 -0800 @@ -1,23 +1,22 @@ -load("//gui_ze:gui_ze.bzl", "wasm_binary") - -wasm_binary( - name = "markdown_to_html_wasm", - src = "markdown_to_html_wasm.c", - exports = [ - "malloc", - "free", - "heap_reset", - "markdown_to_html", - "markdown_strlen", - ], - visibility = ["//visibility:public"], -) - -# JS to link wasm with -filegroup( - name = "markdown_to_html_wasm_js", - srcs = glob([ - "**/*.js", - ], allow_empty=True), - visibility = ["//visibility:public"], -) +# load("@rules_cc//cc:defs.bzl", "cc_library") +# load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary") +# +# package(default_visibility = ["//visibility:public"]) +# +# cc_library( +# name = "hello-world", +# srcs = ["markdown_to_html_wasm.c"], +# ) +# +# wasm_cc_binary( +# name = "markdown_to_html_wasm", +# cc_target = ":hello-world", +# ) +# +# # JS to link wasm with +# filegroup( +# name = "markdown_to_html_wasm_js", +# srcs = glob([ +# "**/*.js", +# ], allow_empty=True), +# ) diff -r 589bab390fb4 -r f3084bca7317 mrjunejune/main.c --- a/mrjunejune/main.c Mon Jan 19 16:28:45 2026 -0800 +++ b/mrjunejune/main.c Mon Jan 19 16:29:02 2026 -0800 @@ -187,7 +187,6 @@ printf("DEBUG: Converting image, file_size=%zu bytes\n", file_size); - int open_flags = O_RDWR | O_CREAT | O_EXCL; char *uuid4 = (char *)Dowa_Arena_Allocate(arena, UUID_LEN); @@ -306,13 +305,19 @@ printf("DEBUG: Converting video, file_size=%zu bytes\n", file_size); + int open_flags = O_RDWR | O_CREAT | O_EXCL; + char *uuid4 = (char *)Dowa_Arena_Allocate(arena, UUID_LEN); - Dowa_String_UUID((uint32)time(NULL), uuid4); + uint32 seed = (uint32)time(NULL) ^ (uint32)pthread_self() ^ counter++; + Dowa_String_UUID(seed, uuid4); char *input_path = Dowa_Arena_Allocate(arena, TMP_FILE_LENGTH); snprintf(input_path, TMP_FILE_LENGTH, "/tmp/%s", uuid4); - int input_fd = mkstemp(input_path); + Seobeo_Log(SEOBEO_DEBUG, "Input path: %s\n", input_path); + + int input_fd = open(input_path, open_flags, 0600); if (input_fd == -1) { + Seobeo_Log(SEOBEO_DEBUG, "errno: %d (%s)\n", errno, strerror(errno)); char *error_msg = "Failed to create temporary file"; Dowa_HashMap_Push_Arena(resp, "status", "500", arena); Dowa_HashMap_Push_Arena(resp, "content-type", "text/plain", arena); @@ -323,9 +328,7 @@ write(input_fd, file_data, file_size); close(input_fd); - int open_flags = O_RDWR | O_CREAT | O_EXCL; - - uint32 seed = (uint32)time(NULL) ^ (uint32)pthread_self() ^ counter++;; + seed = (uint32)time(NULL) ^ (uint32)pthread_self() ^ counter++; Dowa_String_UUID(seed, uuid4); char *output_path = (char *)Dowa_Arena_Allocate(arena, TMP_FILE_LENGTH);; snprintf(output_path, TMP_FILE_LENGTH, "/tmp/%s.mp4", uuid4); diff -r 589bab390fb4 -r f3084bca7317 mrjunejune/test/BUILD --- a/mrjunejune/test/BUILD Mon Jan 19 16:28:45 2026 -0800 +++ b/mrjunejune/test/BUILD Mon Jan 19 16:29:02 2026 -0800 @@ -35,7 +35,7 @@ "integration_test.c", "test.h" ], - deps = ["//seobeo:seobeo_tcp_client"], + deps = ["//seobeo:seobeo"], data = [ "//mrjunejune:mrjunejune_server", "//mrjunejune:src_files", diff -r 589bab390fb4 -r f3084bca7317 mrjunejune/test/integration_test.c --- a/mrjunejune/test/integration_test.c Mon Jan 19 16:28:45 2026 -0800 +++ b/mrjunejune/test/integration_test.c Mon Jan 19 16:29:02 2026 -0800 @@ -286,10 +286,8 @@ free(file_data); if (!p_resp || p_resp->status_code != 200) { - printf(" ✗ Conversion failed with status: %d\n", p_resp ? p_resp->status_code : 0); + printf(" ✗ Conversion failed with status: %d, %s\n", p_resp ? p_resp->status_code : 0, p_resp->body); if (p_resp) Seobeo_Client_Response_Destroy(p_resp); - - Seobeo_Client_Response_Destroy(p_resp); Seobeo_Client_Request_Destroy(p_req); return -1; } @@ -307,6 +305,7 @@ Seobeo_Client_Response_Destroy(p_resp); Seobeo_Client_Request_Destroy(p_req); + usleep(100000); printf(" → Testing download: GET %s\n", download_url_path); char full_download_url[1024]; snprintf(full_download_url, sizeof(full_download_url), "%s%s", TEST_URL, download_url_path); @@ -317,6 +316,7 @@ if (!p_resp || p_resp->status_code != 200) { printf(" ✗ Download failed\n"); + printf("%s\n", p_resp->body); if (p_resp) Seobeo_Client_Response_Destroy(p_resp); Seobeo_Client_Request_Destroy(p_req); return -1; diff -r 589bab390fb4 -r f3084bca7317 mrjunejune/test/test.h --- a/mrjunejune/test/test.h Mon Jan 19 16:28:45 2026 -0800 +++ b/mrjunejune/test/test.h Mon Jan 19 16:29:02 2026 -0800 @@ -11,13 +11,9 @@ #define TEST_URL "http://127.0.0.1:6969" #define MAX_RESPONSE_SIZE (1024 * 1024) #ifndef SNAPSHOT_DIR - #define SNAPSHOT_DIR "/Users/mrjunejune/zenbu/mrjunejune/test/snapshots" + #define SNAPSHOT_DIR "/home/june/zenbu/mrjunejune/test/snapshots" #endif -pid_t start_test_server(const char *server_binary); -void stop_test_server(pid_t server_pid); - - pid_t start_test_server(const char *server_binary) { pid_t server_pid = fork(); diff -r 589bab390fb4 -r f3084bca7317 seobeo/s_http_client.c --- a/seobeo/s_http_client.c Mon Jan 19 16:28:45 2026 -0800 +++ b/seobeo/s_http_client.c Mon Jan 19 16:29:02 2026 -0800 @@ -541,11 +541,10 @@ if (p_req->p_arena) Dowa_Arena_Free(p_req->p_arena); - if (p_req->headers_map) - Dowa_HashMap_Free(p_req->headers_map); - - if (p_req->headers_array) - Dowa_Array_Free(p_req->headers_array); + // Note: headers_map and headers_array are allocated using arena functions + // (Dowa_HashMap_Push_Arena, Dowa_Array_Push_Arena), so they are freed + // when the arena is freed above. Do not call Dowa_HashMap_Free or + // Dowa_Array_Free on them. free(p_req); } @@ -558,8 +557,8 @@ if (p_resp->p_arena) Dowa_Arena_Free(p_resp->p_arena); - if (p_resp->headers) - Dowa_HashMap_Free(p_resp->headers); + // Note: headers are allocated using Dowa_HashMap_Push_Arena, so they are + // freed when the arena is freed above. Do not call Dowa_HashMap_Free. free(p_resp); } diff -r 589bab390fb4 -r f3084bca7317 seobeo/tests/BUILD --- a/seobeo/tests/BUILD Mon Jan 19 16:28:45 2026 -0800 +++ b/seobeo/tests/BUILD Mon Jan 19 16:29:02 2026 -0800 @@ -4,6 +4,8 @@ name = "seobeo_client_test", srcs = ["seobeo_client_test.c"], deps = ["//seobeo:seobeo"], + size = "large", + timeout = "long", visibility = ["//visibility:public"], ) @@ -20,9 +22,7 @@ name = "seobeo_websocket_server_test", srcs = ["seobeo_web_server_test.c"], deps = ["//seobeo:seobeo"], - data = [ - "//seobeo/examples:websocket_server_example", - ], + data = ["//seobeo/examples:websocket_server_example"], size = "large", timeout = "long", args = ["$(location //seobeo/examples:websocket_server_example)"],