{"id":34023889,"url":"https://github.com/pinetr2e/scons-compiledb","last_synced_at":"2026-04-07T17:31:06.336Z","repository":{"id":42328192,"uuid":"247449366","full_name":"pinetr2e/scons-compiledb","owner":"pinetr2e","description":"SCons support for compile_commands.json genearation","archived":false,"fork":false,"pushed_at":"2020-06-26T11:43:39.000Z","size":84,"stargazers_count":24,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-15T05:28:29.190Z","etag":null,"topics":["clang-tooling","clangd","compile-commands-json","pypi","scons"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pinetr2e.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}},"created_at":"2020-03-15T11:03:34.000Z","updated_at":"2024-08-29T16:59:31.000Z","dependencies_parsed_at":"2022-08-29T11:30:35.560Z","dependency_job_id":null,"html_url":"https://github.com/pinetr2e/scons-compiledb","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/pinetr2e/scons-compiledb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinetr2e%2Fscons-compiledb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinetr2e%2Fscons-compiledb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinetr2e%2Fscons-compiledb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinetr2e%2Fscons-compiledb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinetr2e","download_url":"https://codeload.github.com/pinetr2e/scons-compiledb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinetr2e%2Fscons-compiledb/sbom","scorecard":{"id":734293,"data":{"date":"2025-08-11","repo":{"name":"github.com/pinetr2e/scons-compiledb","commit":"99b76893625d86c0dd2da137be3ceb799c746b76"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T15:17:46.257Z","repository_id":42328192,"created_at":"2025-08-22T15:17:46.257Z","updated_at":"2025-08-22T15:17:46.257Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31522194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["clang-tooling","clangd","compile-commands-json","pypi","scons"],"created_at":"2025-12-13T16:03:31.594Z","updated_at":"2026-04-07T17:31:06.322Z","avatar_url":"https://github.com/pinetr2e.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/pinetr2e/scons-compiledb.svg?branch=master)](https://travis-ci.org/pinetr2e/scons-compiledb)\n[![PyPI version](https://badge.fury.io/py/scons-compiledb.svg)](https://badge.fury.io/py/scons-compiledb)\n# SCons Compilation DB support\n\nscons-compiledb adds a support for generating JSON formatted compilation\ndatabase defined by\n[Clang](https://clang.llvm.org/docs/JSONCompilationDatabase.html).\n\nFeatures:\n\n- Multiple construction environments support.\n- compile_commands.json merge across SCons invocations\n- Customisation for DB entry generation.\n- Build with command line option, --compiledb\n- Simpler installation with PyPI\n\n\nAt the moment, SCons mainline does not have compilation DB generation\nfunctionality and it is likely to have it in the near feature. However, this\nmodule can still provide some advantages such as supporting old version of SCons\nand other useful features.\n\nThe module was tested with Python 2.x/3.x along with SCons 2.x/3.x.\n\n\n## Installation\n\nInstall and update using `pip`\n```\npip install scons-compiledb\n```\n\n## Usage\n\n### Enable and use CompileDb builder\n\n```python\nimport scons_compiledb\n\nenv = DefaultEnvironment()  # Or with any other way\nscons_compiledb.enable(env)\n# \n# ... use env normally ...\n#\nenv.CompileDb()\n```\n\n`enable(env)` adds a new builder, `CompileDb` to the specified environment,\n`env`. In order to build the `compile_commands.json` file, `CompileDb()` should\nbe called. It can also specify the DB file name as an optional argument.\n\nNote that `enable(env)` should be called before the `env` is used to compile any\ntargets.\n\n\n### Simpler usage with command line option --compiledb\n\nInstead of `enable()`, `enable_with_cmdline()` can be used to add a command line\noption `--compiledb`, which, when specified, generates 'compile_commands.json'\nas default target.\n\n```python\nimport scons_compiledb\n\nenv = DefaultEnvironment()  # Or with any other way\nscons_compiledb.enable_with_cmdline(env)\n\n#\n# ... Use env normnally ...\n#\n```\n\nWith the above build script, `compile_commands.json` file will be generated when\nSCons is invoked with `--compiledb` command line option as follows:\n\n```\n$ scons --compiledb=\n```\nNote that the command line option requires an option string as argument and the trailing `=` means empty.\nThe comma-separated option string can specify the bool type config options(see below) as follows:\n```\n$ scons --compiledb=reset,multi\n```\n\nIn order to build DB while building other target, `compiledb` can be used as an\nalias as follows:\n\n```\n$ scons --compiledb= compiledb other_targets\n```\n\n\n### Customisation\nWhile enabling, a `Config` object can be passed. For example:\n```\nconfig = scons_compiledb.Config(db='foo.json')\nscons_compiledb.enable(env, config)\n\n```\n\n| Parameter    | Value                                                      | Default                   |\n|--------------|------------------------------------------------------------|---------------------------|\n| db           | filename of compilation DB.                                | '#/compile_commands.json' |\n| entry_func   | function to determine the entry dict for each source file. | entry_func_default        |\n| cxx_suffixes | Suffixes for C++ files.                                    | ('.cpp', '.cc')           |\n| cc_suffixes  | Suffixes for C files.                                      | ('.c',)                   |\n| reset        | Whether to remove existing entries                         | False                     |\n| multi        | Whether to allow multiple entries with the same 'file'.    | False                     |\n\n#### entry_func\n\n`entry_func` is the main logic to convert source file node in SCons to a dict\n containing `directory`, `source` and `command` as keys. There are predefined\n entry functions as follows:\n\n- `entry_func_default`\n\nThis is default and it should work for the most of cases.\n\n- `entry_func_simple`\n\nUse `CPPPATH` and `CPPDEFINES` only and *clang*/*clang++* as compiler tool name.\nThis will be useful to use clangd with compilers, which use command line\narguments clangd cannot understand.\n\n`entry_func` can be easily customised. Please refer to the source code of [the\npredefined functions](./scons_compiledb/entry_func.py)\n\n#### reset\n\nAs default, `compile_commands.json` file is merged across the multiple\ninvocations of SCons so that one DB file can be used. This is usually good\nthing. However, if it is not desirable for any reasons, `reset` config can be\nused to remove any existing entries before generating new ones.\n\n#### multi\n\nAs default, `compile_commands.json` file keeps only one entry with the same\n`file` as the key. However, some tools can handle multiple entries with the same\nkey. If `multi` is set, multiple entries are stored as long as they generate the\ndifferent target(output) files.\n\n## Details\n\n\n`enable(env)` modifies the builders related to the compilations, such as\nStaticObject, to add an additional Scanner, which make sure that the compilation\ncommands are captured. `enable(env)` also adds a new builder `CompileDb`, which\ngenerates `compile_commands.json` from the captured commands.\n\n`scons_compiledb` maintains an internal dot file `.compile_commands.json` as\ndefault, to merge compile commands across the multiple SCons invocations. The\nfinal file, `compile_commands.json` is touched only when the internal dot file\nis changed.\n\nWhen the compile commands are merged, it is based on source/output file name. It\nmeans that the entry with the same pair will be overwritten.\n\n`enabled(env)` can be called to check whether it is enabled before or not.\n\n\n## Examples\n\nPlease check SConscript files in [test folder](./tests)\n\n\n## Credits\n\nThe core functionality of scons-compiledb is based on [MongoDB source\ncode](https://github.com/mongodb/mongo/blob/master/site_scons/site_tools/compilation_db.py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinetr2e%2Fscons-compiledb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinetr2e%2Fscons-compiledb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinetr2e%2Fscons-compiledb/lists"}