From 1dd215f4e347120cc7085fa0c21ae5b46c32ae42 Mon Sep 17 00:00:00 2001 From: Allan Clark Date: Thu, 7 Aug 2025 21:11:27 +0000 Subject: [PATCH] feat: bzlmodify --- .bazelversion | 1 - .bcr/metadata.template.json | 12 +++++++ .bcr/presubmit.yml | 10 ++++++ .bcr/source.template.json | 5 +++ .gitignore | 2 ++ MODULE.bazel | 72 +++++++++++++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 1 deletion(-) delete mode 100644 .bazelversion create mode 100644 .bcr/metadata.template.json create mode 100644 .bcr/presubmit.yml create mode 100644 .bcr/source.template.json create mode 100644 MODULE.bazel diff --git a/.bazelversion b/.bazelversion deleted file mode 100644 index ee74734..0000000 --- a/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -4.1.0 diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json new file mode 100644 index 0000000..42c5f03 --- /dev/null +++ b/.bcr/metadata.template.json @@ -0,0 +1,12 @@ +{ + "maintainers": [ + { + "github": "1e100" + } + ], + "repository": [ + "github:1e100/cloud_archive" + ], + "versions": [], + "yanked_versions": {} +} diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml new file mode 100644 index 0000000..35eeae4 --- /dev/null +++ b/.bcr/presubmit.yml @@ -0,0 +1,10 @@ +matrix: + platform: + - ubuntu2404 + - macos +tasks: + verify_targets: + name: Verify basic build targets + platform: ${{ platform }} + build_targets: + - '@cloud_archive//...' diff --git a/.bcr/source.template.json b/.bcr/source.template.json new file mode 100644 index 0000000..ffa9e7b --- /dev/null +++ b/.bcr/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{TAG}", + "url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.zip" +} diff --git a/.gitignore b/.gitignore index 348fe06..42a6e13 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ __pycache__ xcuserdata/ .idea +# thrash happens; let it happen for now +MODULE.bazel.lock diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000..65bca15 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,72 @@ +module(name = "cloud_archive") + +bazel_dep(name = "rules_cc", version = "0.2.0") + +s3_archive = use_repo_rule("//:cloud_archive.bzl", "s3_archive") + +s3_archive( + name = "archive_s3", + bucket = "1e100-temp", + build_file = "//:BUILD.archive", + file_path = "cloud_archive_test.zip", + sha256 = "d0ff6239646b3a60e4d8926402281311e003ae03183b1ae24f2adba5d9289f04", + strip_prefix = "cloud_archive_test", +) + +minio_archive = use_repo_rule("//:cloud_archive.bzl", "minio_archive") + +minio_archive( + name = "archive_minio_gz", + build_file = "//:BUILD.archive", + file_path = "minio/temp/cloud_archive_test.tar.gz", + sha256 = "bf4dd5304180561a745e816ee6a8db974a3fcf5b9d706a493776d77202c48bc9", + strip_prefix = "cloud_archive_test", +) + +minio_archive( + name = "archive_minio_zstd", + build_file = "//:BUILD.archive", + file_path = "minio/temp/cloud_archive_test.tar.zst", + sha256 = "1891c85349f519206a2a2aa21f4927146b8cf84db04d3be91e0b54ce564d8b73", + strip_prefix = "dir1", +) + +gs_archive = use_repo_rule("//:cloud_archive.bzl", "gs_archive") + +gs_archive( + name = "archive_gcloud_gz", + bucket = "depthwise-temp", + build_file = "//:BUILD.archive", + file_path = "cloud_archive_test.tar.gz", + sha256 = "bf4dd5304180561a745e816ee6a8db974a3fcf5b9d706a493776d77202c48bc9", + strip_prefix = "cloud_archive_test", +) + +gs_archive( + name = "archive_gcloud_zstd", + bucket = "depthwise-temp", + build_file = "//:BUILD.archive", + file_path = "cloud_archive_test.tar.zst", + sha256 = "1891c85349f519206a2a2aa21f4927146b8cf84db04d3be91e0b54ce564d8b73", + strip_prefix = "dir1", +) + +gs_archive( + name = "archive_gcloud_zstd_strip2", + bucket = "depthwise-temp", + build_file = "//:BUILD.archive", + file_path = "cloud_archive_test.tar.zst", + sha256 = "1891c85349f519206a2a2aa21f4927146b8cf84db04d3be91e0b54ce564d8b73", + strip_prefix = "dir1/dir2", +) + +gs_archive( + name = "archive_gcloud_zstd_patch", + bucket = "depthwise-temp", + build_file = "//:BUILD.archive", + file_path = "cloud_archive_test.tar.zst", + patch_args = ["-p1"], + patches = ["//:test.patch"], + sha256 = "1891c85349f519206a2a2aa21f4927146b8cf84db04d3be91e0b54ce564d8b73", + strip_prefix = "dir1", +)