{"id":26447602,"url":"https://github.com/abitofhelp/multi_module_bazels","last_synced_at":"2026-01-04T21:03:34.163Z","repository":{"id":208571393,"uuid":"721914293","full_name":"abitofhelp/multi_module_bazels","owner":"abitofhelp","description":"This project demonstrates how to implement a monorepo using bzlmod with multiple MODULE.bazel files and Gazelle.","archived":false,"fork":false,"pushed_at":"2023-11-22T07:06:47.000Z","size":2869,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T13:57:37.742Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","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/abitofhelp.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}},"created_at":"2023-11-22T03:24:05.000Z","updated_at":"2023-11-22T03:25:28.000Z","dependencies_parsed_at":"2023-11-22T07:45:11.465Z","dependency_job_id":null,"html_url":"https://github.com/abitofhelp/multi_module_bazels","commit_stats":null,"previous_names":["abitofhelp/multi_module_bazels"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abitofhelp/multi_module_bazels","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abitofhelp%2Fmulti_module_bazels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abitofhelp%2Fmulti_module_bazels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abitofhelp%2Fmulti_module_bazels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abitofhelp%2Fmulti_module_bazels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abitofhelp","download_url":"https://codeload.github.com/abitofhelp/multi_module_bazels/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abitofhelp%2Fmulti_module_bazels/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28208289,"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","status":"online","status_checked_at":"2026-01-04T02:00:06.065Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-03-18T13:57:50.062Z","updated_at":"2026-01-04T21:03:34.141Z","avatar_url":"https://github.com/abitofhelp.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# multimods   \n\nThis project demonstrates how to implement a monorepo using bzlmod with multiple MODULE.bazel files and Gazelle.\n\nThe issue is that Gazelle only permits configuring one go.mod file, which cannot have a path, in the root's MODULE.bazel, as shown below:  \n\n```\n# Register the go.mod file with the go_deps extension.\n# The go_deps extension parses this file directly, so external tooling such as gazelle update-repos is no longer needed.\ngo_deps = use_extension(\"@gazelle//:extensions.bzl\", \"go_deps\")\ngo_deps.from_file(go_mod = \"//:go.mod\")\n```\n\nSo, if there are multiple projects in the monorepo and each one has its own go.mod file, we cannot configure them at the root level.\nEach project has to implement it own Bazel \u0026 go module.\n\nISSUES:\n\nEach project builds properly at its level (lib_a, lib_b).  However, when I try to build the entire project from the root, I\nreceive the following error.  I am still investigating it...\n\n```\n(20:18:53) ERROR: \u003cbuiltin\u003e: fetching local_repository rule //:lib_b~override: java.io.IOException: The repository's path is \"./pkg/lib_b\" (absolute: \"/Users/mike/Go/src/github.com/abitofhelp/multimods/pkg/lib_b\") but it does not exist or is not a directory.\n(20:18:53) ERROR: Error computing the main repository mapping: unknown error during computation of main repo mapping\n(20:18:53) Loading:\nFetching https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabitofhelp%2Fmulti_module_bazels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabitofhelp%2Fmulti_module_bazels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabitofhelp%2Fmulti_module_bazels/lists"}