{"id":27353605,"url":"https://github.com/i-ky/basset","last_synced_at":"2025-04-12T21:06:31.368Z","repository":{"id":78621979,"uuid":"528590650","full_name":"i-ky/basset","owner":"i-ky","description":"A tool that generates a compilation database for clang tooling using ptrace.","archived":false,"fork":false,"pushed_at":"2024-08-12T20:51:25.000Z","size":33,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T21:06:27.796Z","etag":null,"topics":["clang-tooling","compilation-database","hacktoberfest","ptrace"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-ky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-08-24T20:52:28.000Z","updated_at":"2024-12-12T06:46:17.000Z","dependencies_parsed_at":"2024-06-27T23:25:13.358Z","dependency_job_id":null,"html_url":"https://github.com/i-ky/basset","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/i-ky%2Fbasset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-ky%2Fbasset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-ky%2Fbasset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-ky%2Fbasset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-ky","download_url":"https://codeload.github.com/i-ky/basset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631685,"owners_count":21136562,"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":["clang-tooling","compilation-database","hacktoberfest","ptrace"],"created_at":"2025-04-12T21:06:30.857Z","updated_at":"2025-04-12T21:06:31.362Z","avatar_url":"https://github.com/i-ky.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# basset [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/i-ky/basset)\n\nA tool that generates a\n[compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)\nfor [clang] tooling using [ptrace] and [procfs].\n\n## summary\n\nIf you are reading this\nyou probably know what compilation database is\nand what it can be used for.\nAnd you are probably unlucky to use a build system\nthat can't generate `compile_commands.json` for you.\nYour build system may even be especially non-cooperative\ndefeating tools like [bear], [clade] and [compiledb].\nFor example,\nbuild system may not respect injected `CC` and `CXX` environment variables,\nmay hard-code compiler paths,\nmay use statically linked binaries rendering `LD_PRELOAD` tricks useless\nor may not pass `make` flags recursively making build logs incomplete.\nThere is however a less known [compile-db-gen],\nwhich uses [strace] to capture compiler invocations\nand should work even in these conditions.\n\nThis project aims to improve on this idea:\n- to reduce overhead [ptrace] is used directly instead of [strace];\n- working directory, executable path and arguments are read from [procfs] reducing code complexity.\n\n## disclaimer\n\nIt has been developed and tested on Linux.\nWhether it works on other systems is an open question.\nYour feedback (both positive and negative) is highly appreciated!\n\n## prerequisites\n\nYou will need `make` and C++ compiler.\n\n## compile\n\nSimply:\n```bash\nmake\n```\nIt should produce `basset` executable in the project root directory.\n\n## install\n\nCopy `basset` executable to a desired location or create a symlink.\n\n## use\n\nA typical use would be:\n```\nbasset -- \u003cyour-build-command\u003e\n```\nExtra options can precede `--` if needed.\n\n[bear]: https://github.com/rizsotto/Bear\n[clade]: https://github.com/17451k/clade\n[clang]: https://clang.llvm.org\n[compile-db-gen]: https://github.com/sunlin7/compile-db-gen\n[compiledb]: https://github.com/nickdiego/compiledb\n[procfs]: https://en.wikipedia.org/wiki/Procfs\n[ptrace]: https://en.wikipedia.org/wiki/Ptrace\n[strace]: https://strace.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-ky%2Fbasset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-ky%2Fbasset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-ky%2Fbasset/lists"}