{"id":18244262,"url":"https://github.com/stackb/subzelle","last_synced_at":"2025-04-04T13:31:14.125Z","repository":{"id":91601611,"uuid":"331240778","full_name":"stackb/subzelle","owner":"stackb","description":"Gazelle plugin that executes a subplugin and communicates the language interface over gRPC","archived":false,"fork":false,"pushed_at":"2021-01-20T23:57:30.000Z","size":36,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T13:41:35.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-20T08:28:31.000Z","updated_at":"2024-04-28T02:28:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"2adea413-38b2-45df-8c97-f1c4605ffc4b","html_url":"https://github.com/stackb/subzelle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fsubzelle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fsubzelle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fsubzelle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackb%2Fsubzelle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackb","download_url":"https://codeload.github.com/stackb/subzelle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247184987,"owners_count":20897871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:15:56.406Z","updated_at":"2025-04-04T13:31:13.826Z","avatar_url":"https://github.com/stackb.png","language":"Go","readme":"# subzelle\n\nAn experimental gazelle plugin that adapts the gazelle-plugin interface over\ngRPC.\n\nEver wanted to write a bazel `BUILD` file generator?\n[Gazelle](https://github.com/bazelbuild/bazel-gazelle) is a great tool to do\nthat. Gazelle implements a plugin architecture, but until now, plugins always had to be written in go.\n\nWith `subzelle`, you write your gazelle plugin in the language of your choice in\nthe form of a gRPC server. The subzelle plugin that is statically compiled into\ngazelle will then RPC out to your plugin.\n\n### Example\n\nCurrently the example requires 2 terminals. The final version will support launching your subprocess.\n\n```\n$ bazel run //plugin/python:subzelle\nStarting subplugin gRPC server on [::]:50051\n```\n\n```\n$ bzl run example/python:subzelle --build_python_zip\n```\n\nClient Output (gazelle/subzelle):\n\n```\ngazelle: Kinds -\u003e\ngazelle: Loads -\u003e\ngazelle: RegisterFlags -\u003e\ngazelle: CheckFlags -\u003e\ngazelle: KnownDirectives -\u003e\ngazelle: /home/pcj/go/src/github.com/stackb/subzelle/BUILD.bazel: unknown directive: gazelle:prefix\ngazelle: Configure -\u003e\ngazelle: Configure -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: Configure -\u003e\ngazelle: Configure -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: Configure -\u003e\ngazelle: Configure -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: Configure -\u003e\ngazelle: Configure -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: Configure -\u003e\ngazelle: /home/pcj/go/src/github.com/stackb/subzelle/plugin/python/BUILD.bazel: unknown directive: gazelle:proto\ngazelle: Configure -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: Configure -\u003e\ngazelle: GenerateRules -\u003e\ngazelle: GenerateRules -\u003e\n```\n\nServer Output (python):\n\n```\nKinds \u003c-\nLoads \u003c-\nRegisterFlags \u003c-\nCheckFlags \u003c-\nKnownDirectives \u003c-\nConfigure \u003c-\nConfigure \u003c-\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/.vscode\"\nrel: \".vscode\"\nregular_files: \"settings.json\"\n\nConfigure \u003c-\nConfigure \u003c-\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/cmd/subzelle\"\nrel: \"cmd/subzelle\"\nfile {\n  pkg: \"cmd/subzelle\"\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/cmd/subzelle/BUILD.bazel\"\n  load {\n    name: \"@bazel_gazelle//:def.bzl\"\n  }\n  rule {\n    kind: \"gazelle_binary\"\n    name: \"subzelle\"\n  }\n  rule {\n    kind: \"gazelle\"\n    name: \"gazelle\"\n  }\n  content: \"load(\\\"@bazel_gazelle//:def.bzl\\\", \\\"gazelle\\\", \\\"gazelle_binary\\\")\\n\\ngazelle_binary(\\n    name = \\\"subzelle\\\",\\n    # NOTE: DEFAULT_LANGUAGES intentionally excluded here - this won\\'t do go or proto.\\n    languages = [\\\"//pkg/subzelle:go_default_library\\\"],\\n    visibility = [\\\"//visibility:public\\\"],\\n)\\n\\ngazelle(\\n    name = \\\"gazelle\\\",\\n    gazelle = \\\":subzelle\\\",\\n    prefix = \\\"github.com/stackb/subzelle\\\",\\n)\\n\"\n}\nregular_files: \"BUILD.bazel\"\n\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/cmd\"\nrel: \"cmd\"\nsubdirs: \"subzelle\"\n\nConfigure \u003c-\nConfigure \u003c-\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/example/python\"\nrel: \"example/python\"\nfile {\n  pkg: \"example/python\"\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/example/python/BUILD.bazel\"\n  load {\n    name: \"//:def.bzl\"\n  }\n  rule {\n    kind: \"subzelle\"\n    name: \"subzelle\"\n  }\n  content: \"load(\\\"//:def.bzl\\\", \\\"subzelle\\\")\\n\\nsubzelle(\\n    name = \\\"subzelle\\\",\\n    plugin = \\\"//plugin/python\\\",\\n    prefix = \\\"github.com/stackb/subzelle/example/python\\\",\\n)\\n\"\n}\nregular_files: \"BUILD.bazel\"\n\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/example\"\nrel: \"example\"\nsubdirs: \"python\"\n\nConfigure \u003c-\nConfigure \u003c-\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/pkg/subzelle\"\nrel: \"pkg/subzelle\"\nfile {\n  pkg: \"pkg/subzelle\"\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/pkg/subzelle/BUILD.bazel\"\n  load {\n    name: \"@io_bazel_rules_go//go:def.bzl\"\n  }\n  load {\n    name: \"@io_bazel_rules_go//proto:def.bzl\"\n  }\n  rule {\n    kind: \"go_library\"\n    name: \"go_default_library\"\n  }\n  rule {\n    kind: \"go_proto_library\"\n    name: \"language_go_proto\"\n  }\n  content: \"load(\\\"@io_bazel_rules_go//go:def.bzl\\\", \\\"go_library\\\")\\nload(\\\"@io_bazel_rules_go//proto:def.bzl\\\", \\\"go_proto_library\\\")\\n\\ngo_library(\\n    name = \\\"go_default_library\\\",\\n    srcs = [\\n        \\\"configurer.go\\\",\\n        \\\"fix.go\\\",\\n        \\\"generator.go\\\",\\n        \\\"language.go\\\",\\n        \\\"plugin.go\\\",\\n        \\\"process.go\\\",\\n        \\\"resolver.go\\\",\\n        \\\"types.go\\\",\\n    ],\\n    importpath = \\\"github.com/stackb/subzelle/pkg/subzelle\\\",\\n    visibility = [\\\"//visibility:public\\\"],\\n    deps = [\\n        \\\":language_go_proto\\\",\\n        \\\"@bazel_gazelle//config:go_default_library\\\",\\n        \\\"@bazel_gazelle//label:go_default_library\\\",\\n        \\\"@bazel_gazelle//language:go_default_library\\\",\\n        \\\"@bazel_gazelle//repo:go_default_library\\\",\\n        \\\"@bazel_gazelle//resolve:go_default_library\\\",\\n        \\\"@bazel_gazelle//rule:go_default_library\\\",\\n        \\\"@com_github_golang_protobuf//proto:go_default_library\\\",\\n        \\\"@org_golang_google_grpc//:go_default_library\\\",\\n    ],\\n)\\n\\ngo_proto_library(\\n    name = \\\"language_go_proto\\\",\\n    compilers = [\\\"@io_bazel_rules_go//proto:go_grpc\\\"],\\n    importpath = \\\"github.com/stackb/subzelle/language\\\",\\n    proto = \\\"//proto:language_proto\\\",\\n    visibility = [\\\"//visibility:public\\\"],\\n)\\n\"\n}\nregular_files: \"BUILD.bazel\"\nregular_files: \"cheetah.go\"\nregular_files: \"config.go\"\nregular_files: \"configurer.go\"\nregular_files: \"fix.go\"\nregular_files: \"generator.go\"\nregular_files: \"kind.go\"\nregular_files: \"language.go\"\nregular_files: \"plugin.go\"\nregular_files: \"process.go\"\nregular_files: \"resolver.go\"\nregular_files: \"types.go\"\n\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/pkg\"\nrel: \"pkg\"\nfile {\n  pkg: \"pkg\"\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/pkg/BUILD.bazel\"\n}\nsubdirs: \"subzelle\"\nregular_files: \"BUILD.bazel\"\n\nConfigure \u003c-\nConfigure \u003c-\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/plugin/python\"\nrel: \"plugin/python\"\nfile {\n  pkg: \"plugin/python\"\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/plugin/python/BUILD.bazel\"\n  directive {\n    key: \"proto\"\n    value: \"disable\"\n  }\n  load {\n    name: \"@rules_python//python:defs.bzl\"\n  }\n  load {\n    name: \"//:plugin.bzl\"\n  }\n  load {\n    name: \"@rules_proto_grpc//python:defs.bzl\"\n  }\n  rule {\n    kind: \"subzelle_plugin\"\n    name: \"python\"\n  }\n  rule {\n    kind: \"py_binary\"\n    name: \"subzelle\"\n  }\n  rule {\n    kind: \"python_grpc_library\"\n    name: \"language_python_grpc\"\n  }\n  content: \"load(\\\"@rules_python//python:defs.bzl\\\", \\\"py_binary\\\")\\nload(\\\"//:plugin.bzl\\\", \\\"subzelle_plugin\\\")\\nload(\\\"@rules_proto_grpc//python:defs.bzl\\\", \\\"python_grpc_library\\\")\\n\\nsubzelle_plugin(\\n    name = \\\"python\\\",\\n    executable = \\\":subzelle\\\",\\n    address = \\\"0.0.0.0:50051\\\",\\n    visibility = [\\\"//visibility:public\\\"],\\n)\\n\\npy_binary(\\n    name = \\\"subzelle\\\",\\n    srcs = [\\\"subzelle.py\\\"],\\n    deps = [\\\":language_python_grpc\\\"],\\n)\\n\\n# gazelle:proto disable\\n\\n# py_test(\\n#     name = \\\"python_grpc_example_test\\\",\\n#     srcs = [\\\"python_grpc_example_test.py\\\"],\\n#     deps = [\\\":simple_service_python_grpc_library\\\"],\\n# )\\n\\npython_grpc_library(\\n    name = \\\"language_python_grpc\\\",\\n    deps = [\\\"//proto:language_proto\\\"],\\n)\\n\"\n}\nregular_files: \"BUILD.bazel\"\nregular_files: \"subzelle.py\"\n\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/plugin\"\nrel: \"plugin\"\nsubdirs: \"python\"\n\nConfigure \u003c-\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle/proto\"\nrel: \"proto\"\nfile {\n  pkg: \"proto\"\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/proto/BUILD.bazel\"\n  load {\n    name: \"@rules_proto//proto:defs.bzl\"\n  }\n  rule {\n    kind: \"proto_library\"\n    name: \"language_proto\"\n  }\n  content: \"load(\\\"@rules_proto//proto:defs.bzl\\\", \\\"proto_library\\\")\\n\\nproto_library(\\n    name = \\\"language_proto\\\",\\n    srcs = [\\\"language.proto\\\"],\\n    visibility = [\\\"//visibility:public\\\"],\\n    deps = [\\\"@com_google_protobuf//:struct_proto\\\"],\\n)\\n\"\n}\nregular_files: \"BUILD.bazel\"\nregular_files: \"language.proto\"\n\nGenerateRules \u003c- config {\n  repo_root: \"/home/pcj/go/src/github.com/stackb/subzelle\"\n  repo_name: \"build_stack_subzelle\"\n  valid_build_file_names: \"BUILD.bazel\"\n  valid_build_file_names: \"BUILD\"\n  index_libraries: true\n}\ndir: \"/home/pcj/go/src/github.com/stackb/subzelle\"\nfile {\n  path: \"/home/pcj/go/src/github.com/stackb/subzelle/BUILD.bazel\"\n  directive {\n    key: \"prefix\"\n    value: \"github.com/stackb/subzelle\"\n  }\n  load {\n    name: \"@bazel_gazelle//:def.bzl\"\n  }\n  rule {\n    kind: \"gazelle\"\n    name: \"gazelle\"\n  }\n  rule {\n    kind: \"exports_files\"\n  }\n  content: \"load(\\\"@bazel_gazelle//:def.bzl\\\", \\\"gazelle\\\")\\n\\n# gazelle:prefix github.com/stackb/subzelle\\ngazelle(\\n    name = \\\"gazelle\\\",\\n    prefix = \\\"github.com/stackb/subzelle\\\",\\n)\\n\\nexports_files([\\\"subzelle.bash.in\\\"])\\n\"\n}\nsubdirs: \".vscode\"\nsubdirs: \"cmd\"\nsubdirs: \"example\"\nsubdirs: \"pkg\"\nsubdirs: \"plugin\"\nsubdirs: \"proto\"\nregular_files: \".bazelrc\"\nregular_files: \".bazelversion\"\nregular_files: \"BUILD.bazel\"\nregular_files: \"WORKSPACE\"\nregular_files: \"bazel-bin\"\nregular_files: \"bazel-out\"\nregular_files: \"bazel-subzelle\"\nregular_files: \"bazel-testlogs\"\nregular_files: \"bazel_version_repository.bzl\"\nregular_files: \"def.bzl\"\nregular_files: \"deps.bzl\"\nregular_files: \"go_deps.bzl\"\nregular_files: \"launch.bazelrc\"\nregular_files: \"plugin.bzl\"\nregular_files: \"subzelle.bash.in\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fsubzelle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackb%2Fsubzelle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackb%2Fsubzelle/lists"}