{"id":19168402,"url":"https://github.com/bloomberg/p2473","last_synced_at":"2025-09-14T18:51:13.909Z","repository":{"id":66125195,"uuid":"416479125","full_name":"bloomberg/p2473","owner":"bloomberg","description":"Example code for WG21 paper P2473","archived":false,"fork":false,"pushed_at":"2021-12-07T18:19:57.000Z","size":20,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T23:31:58.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":false,"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/bloomberg.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":"2021-10-12T19:57:17.000Z","updated_at":"2025-03-07T01:29:13.000Z","dependencies_parsed_at":"2023-04-01T14:19:53.084Z","dependency_job_id":null,"html_url":"https://github.com/bloomberg/p2473","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/bloomberg%2Fp2473","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp2473/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp2473/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp2473/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloomberg","download_url":"https://codeload.github.com/bloomberg/p2473/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252897420,"owners_count":21821433,"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-09T09:42:31.460Z","updated_at":"2025-05-07T14:41:49.200Z","avatar_url":"https://github.com/bloomberg.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Proof of Concept for Module Path-based Convention\n\nThis is a proof of concept on how a path-based approach can make it\npossible to build a C++ project with modules, including consuming C++\nmodules external to the build system.\n\nThis is meant as a side-car to the [Distributing C++ Module\nLibraries](https://isocpp.org/files/papers/P2473R1.pdf) paper.\n\n## Invocation\n\nBuilding out-of-source is important, because the project will need to\ncreate bmi files for whatever modules that were not shipped with a\ncompatible BMI file.\n\n```\nmkdir build \u0026\u0026 make -C build -f $(pwd)/Makefile\n```\n\n## VPATH and the module search path\n\nIn order for this to work correctly, we make use of the VPATH feature\nof GNU Make, and we make it coincide with the module search path,\nmeaning that Make itself is capable of resolving the dependency\ninformation and consume whatever bmi is already available, but produce\nwhatever bmi is necessary.\n\nIn this sample project, the module search path is comprised of the\nroot of the current directory (where bmi files are created), the root\nof the repo, where the modules meant as internal to this project, and\nthe external-modules directory, meant to represent other modules\navailable in the system.\n\nVPATH is therefore set to the two directories where the local source\ncode is going to be found as well as the directories where external\nmodules may be found. Meanwhile the module path is set to include the\ncurrent directory ahead of those, as that's where the local builds are\ngoing to be placed.\n\n## Encoding the compatibility in the bmi file name\n\nThis allows an important optimization for systems that do use the same\ncompiler across the board to ship pre-parsed module interfaces. The\nname of those files is made as unique as the compiler needs it to be,\nand the string is discovered by calling the compiler itself in this\nPoC, this is the BMI_UUID variable in the Makefile.\n\nThis compatibility id needs to be communicated to the dependency\nmapping, such that we can correctly generate the build rules.\n\n## `c++-module-config`\n\nThis utility is a proof-of-concept implementation of a tool that knows\nhow to parse your local non-module code and then identify which\nmodules it depends on, and then uses the module search path to\nidentify all the information necessary to parse any internal or\nexternal modules.\n\nThis is implemented to demonstrate that a build system would be able\nto configure any required build steps from modules that follow this\nconvention in a straight-forward way that can be easily replicated by\nother tools, as long as the module search path is provided.\n\n## `c++-module-makemake`\n\nThis utility is a proof-of-concept implementation of a tool that\ntranslates the information generated by `c++-module-config` into a\nmake-compatible dependency file that can be included by the makefile.\n\nThe simple inclusion of `deps.mk`, and the rules to generate it are\nsufficient to fully configure the build in this given directory.\n\n# Copyright statement\n\n\n```\n// ----------------------------------------------------------------------------\n// Copyright 2021 Bloomberg Finance L.P.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ----------------------------- END-OF-FILE ----------------------------------\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fp2473","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloomberg%2Fp2473","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fp2473/lists"}