{"id":16410299,"url":"https://github.com/ctrlcctrlv/makepkg-cg","last_synced_at":"2025-10-26T17:32:49.850Z","repository":{"id":159664119,"uuid":"621621414","full_name":"ctrlcctrlv/makepkg-cg","owner":"ctrlcctrlv","description":"makepkg-cg is a wrapper around makepkg that uses Control Groups via systemd.resource-control to manage resource usage during package building. It helps Arch users to build packages while keeping resource usage within reasonable limits.","archived":false,"fork":false,"pushed_at":"2023-12-03T21:36:59.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T03:11:46.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/ctrlcctrlv.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}},"created_at":"2023-03-31T03:20:37.000Z","updated_at":"2023-12-27T18:00:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"89494c61-aa34-4380-addb-a5d2169c5a68","html_url":"https://github.com/ctrlcctrlv/makepkg-cg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fmakepkg-cg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fmakepkg-cg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fmakepkg-cg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrlcctrlv%2Fmakepkg-cg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctrlcctrlv","download_url":"https://codeload.github.com/ctrlcctrlv/makepkg-cg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238380602,"owners_count":19462402,"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-10-11T06:23:49.896Z","updated_at":"2025-10-26T17:32:44.573Z","avatar_url":"https://github.com/ctrlcctrlv.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# makepkg-cg\n\nmakepkg-cg is a wrapper around makepkg that uses Control Groups via\nsystemd.resource-control to manage resource usage during package building. It\nhelps Arch users to build packages while keeping resource usage within\nreasonable limits.\n\n## Features\n\n1.  Limit CPU usage to a defined percentage of total available CPU resources\n2.  Limit RAM usage to a defined percentage of total available memory\n3.  Set I/O priority and CPU scheduling policy\n4.  Configurable resource limits through a user configuration file\n\n## Requirements\n\n1.  systemd\n2.  bash\n\n## Installation\n\nFollow the instructions in the dist/arch/PKGBUILD file to build and install the\nmakepkg-cg package.\n\n### Configuring `session.slice`\n\nIt is recommended to also increase the priority of `session.slice` to see the\nmost benefit to system stability:\n\n```diff\ndiff --git a/usr/lib/systemd/user/session.slice b/usr/lib/systemd/user/session.slice\nindex aa12b7d..1a96695 100644\n--- a/usr/lib/systemd/user/session.slice\n+++ b/usr/lib/systemd/user/session.slice\n@@ -12,4 +12,5 @@ Description=User Core Session Slice\n Documentation=man:systemd.special(7)\n \n [Slice]\n-CPUWeight=100\n+CPUWeight=1000\n+IOWeight=1000\n```\n\n## Configuration\n\nmakepkg-cg provides a default configuration file located at doc/makepkg-cg.conf.\nYou can customize the resource limits by creating a new configuration file at\n`$HOME/.config/makepkg-cg.conf`.\n\nThe configuration options include:\n\n1.  `CPU_PERCENT`: CPU usage quota (percentage, will be multiplied by nproc)\n2.  `RAM_PERCENT`: RAM usage considered high above (percentage)\n3.  `RAM_MAX`: RAM usage maximum (percentage)\n4.  `IO_LEVEL`: I/O priority level (0-7, lower values have higher priority)\n5.  `IO_CLASS`: I/O class\n6.  `CPU_POLICY`: CPU scheduling policy\n\nExample configuration:\n\n```bash\n#!/bin/bash\n# makepkg-cg configuration file\n\nCPU_PERCENT=75\nRAM_PERCENT=75\nRAM_MAX=90\nIO_LEVEL=7\nIO_CLASS=idle\nCPU_POLICY=idle\n```\n\n## Usage\n\nOnce installed, use makepkg-cg in place of makepkg when building packages. The\ncommand accepts the same arguments as makepkg. Resource limits will be applied\nbased on the configuration file.\n\n```bash\nmakepkg-cg \u003cmakepkg_arguments\u003e\n```\n\n## Contributing\n\nFeel free to contribute to the project by opening pull requests or reporting\nissues on the project's GitHub repository.\n\nNote: The eBPF support is currently **non-functional**. That's as good a place\nto start as any.\n\n## License\n\n```\nCopyright 2023 Fredrick R. Brennan\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis software or any of the provided source code files except in compliance\nwith the License.  You may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations under the License.\n```\n\n**By contributing you release your contribution under the terms of the license.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrlcctrlv%2Fmakepkg-cg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctrlcctrlv%2Fmakepkg-cg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrlcctrlv%2Fmakepkg-cg/lists"}