{"id":15406160,"url":"https://github.com/meh/wrong","last_synced_at":"2025-04-17T12:29:11.280Z","repository":{"id":66195771,"uuid":"156417331","full_name":"meh/wrong","owner":"meh","description":"The most wrong build system and package manager for C and C++.","archived":false,"fork":false,"pushed_at":"2019-04-05T22:38:19.000Z","size":103,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T06:04:55.967Z","etag":null,"topics":["build-system","c","cpp"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meh.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":"2018-11-06T16:56:27.000Z","updated_at":"2024-10-13T07:35:26.000Z","dependencies_parsed_at":"2023-03-22T21:50:27.903Z","dependency_job_id":null,"html_url":"https://github.com/meh/wrong","commit_stats":{"total_commits":58,"total_committers":1,"mean_commits":58.0,"dds":0.0,"last_synced_commit":"7031466847b07b7a56081ac7af2aad7a3ca5829e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meh%2Fwrong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meh%2Fwrong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meh%2Fwrong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meh%2Fwrong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meh","download_url":"https://codeload.github.com/meh/wrong/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249341708,"owners_count":21254178,"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":["build-system","c","cpp"],"created_at":"2024-10-01T16:19:47.039Z","updated_at":"2025-04-17T12:29:11.249Z","avatar_url":"https://github.com/meh.png","language":"Makefile","readme":"WRONG\n=====\nEvery single build system for C/C++ is wrong, especially this one.\n\nExample\n=======\n```cpp\n#include \u003cwrong/mistake\u003e\n\nusing namespace wrong;\nusing namespace wrong::action;\n\nint\nmain ()\n{\n\tmistake my;\n\n\t// Build a C++ executable called \"wrongest\".\n\tauto wrongest = my.program(\"wrongest\",\n\t\tsources(\"src/*.cpp\") \u003e\u003e\n\t\tcompile().flag(\"Os\").language(compiler::language::cxx(17)) \u003e\u003e\n\t\texecutable());\n\n\treturn wrongest.build();\n}\n```\n\nWhat grinds my gears\n====================\nWhy do all build systems suck for me? Let's find out!\n\nYou need to learn some weird (and usually awful) DSL\n----------------------------------------------------\nWhy the hell do I need to learn some godawful DSL some high or drunk programmer\ncame up with in an afternoon when I already know C++?\n\nYou need external tools, that you have to install\n-------------------------------------------------\nWhy should I have to install external dependencies for building a C++ program?\n\nOh, your fancy build system doesn't need a stupid DSL? What do you say? It uses\nPython/Groovy/node.js/Ruby/COBOL as a scripting language? Why, that's\nwonderful, let me install _ANOTHER_ toolchain to build my C/C++ project. Oh\nwait, the toolchain for the scripting language needs Perl and Python and a\nshell to be built? And also a C compiler I guess. Why are you doing this to me?\n\nDo you know what tool every C/C++ programmer has always installed aside from a\ntext editor? A fucking C/C++ compiler, because, and this might come as news to\nyou, they're going to build a C/C++ project.\n\nIt should not be a task runner\n------------------------------\nMost build sytems seem to conflate building things and running tasks, for\ninstance you don't want your build system to create packages for distributions,\nor running tests, or doing whatever, you want your build system to build, and\nthat is it.\n\nA typical setup could be using a `Mistake` to build a library or program or\nwhatever, and a `Makefile` to build the package or install the library, I don't\nreally care, I don't maintain distributions.\n\nIt must handle third-party dependencies\n---------------------------------------\nIt doesn't need to be fancy, but if your build system can't download\nthird-party libraries and other dependencies and build them, then it's garbage.\n\nNo, I don't want to use git submodules, they're terrible, and no, I don't want\nto just run `curl` in my `Makefile`, that's a terrible idea. And I seriously\nhope you didn't just mutter the word _container_.\n\nBuilding in different configurations or for entirely different targets is hell\n------------------------------------------------------------------------------\nA build system should handle different configurations depending on the target\nand handle cross-compilation as easily as it handles building for the host.\n\nThis is especially important for embedded, but it's also important for desktops\nand other garbage.\n\nModifying a dependency is practically impossible\n----------------------------------------------\nEver needed to change a line in a dependency of a dependency, or add a file, or\ndo something before or after building?  Sucks to be you, you can't.\n\nFAQ\n===\nFollowing are some questions (and answers) that I believe would be frequently\nasked if anyone knew about this project.\n\nIs it fast?\n-----------\nFor some reason people seem to boast the speed of their build system as an\nimportant perk, but yes, this is as fast as compiling a build system for your\nspecific use case.\n\nSo wait, am I supposed to build my build system, to then build my project?\n--------------------------------------------------------------------------\nExactly, it sounds insane, but it's not!\n\nAs compilers and hardware got better doing this sort of thing is not\nunreasonably slow anymore, and I mean, people are running **entire** JVM\ninstances to build their shit (looking at you `gradle`)\n\nIf you add a `Makefile` next to your `Mistake` you can then just run `make` to\nbuild your stuff, and then add any other bullshit to your `Makefile` (like\npackage creation, running tests, whatever).\n\nAnd you get free caching of the compiled output and recompilation only when the\n`Mistake` actually changes!\n\n```make\nCXX       ?= g++\nDEVICE    ?= EFR32MG12P433F1024GM48\nCOMMANDER ?= commander\n\nbuild: Mistake.out\n\t@env DEVICE=$(DEVICE) ./Mistake.out\n\nMistake.out: Mistake\n\t@$(CXX) -O2 -g0 -xc++ -std=c++2a -Wall -fpermissive -o Mistake.out Mistake -lstdc++fs -lpthread\n\nflash: build\n\t$(COMMANDER) flash --device $(DEVICE) firmware.bin\n\t\ndebug: flash\n\t$(COMMANDER) flash --device $(DEVICE) firmware.bin\n\t$(COMMANDER) swo read --device $(DEVICE)\n\n.PHONY: build flash debug\n```\n\nAre you insane?\n---------------\nYou tell me.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeh%2Fwrong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeh%2Fwrong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeh%2Fwrong/lists"}