278 Commits

Author SHA1 Message Date
ba810d2d98 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-08-05 21:37:42 +08:00
61ad537055 New translations changelog.mdx (Russian)
[ci skip]
2026-08-05 21:37:39 +08:00
59f0a80ff5 New translations changelog.mdx (Polish)
[ci skip]
2026-08-05 21:37:35 +08:00
20bca3b66b New translations changelog.mdx (German)
[ci skip]
2026-08-05 21:37:32 +08:00
e1b32a5161 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-08-03 21:38:13 +08:00
85783ff981 New translations changelog.mdx (Russian)
[ci skip]
2026-08-03 21:38:10 +08:00
199f663d1b New translations changelog.mdx (Polish)
[ci skip]
2026-08-03 21:38:06 +08:00
c68f639e61 New translations changelog.mdx (German)
[ci skip]
2026-08-03 21:38:03 +08:00
19aee3e079 New translations contributing.mdx (Ukrainian)
[ci skip]
2026-07-24 19:40:52 +08:00
4b061dae37 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-07-24 19:40:50 +08:00
e294cc47e6 New translations readme.mdx (Ukrainian)
[ci skip]
2026-07-24 19:40:47 +08:00
81ae976c15 New translations contributing.mdx (Russian)
[ci skip]
2026-07-24 19:40:45 +08:00
587d6aeb80 New translations changelog.mdx (Russian)
[ci skip]
2026-07-24 19:40:42 +08:00
0e7825ab77 New translations readme.mdx (Russian)
[ci skip]
2026-07-24 19:40:39 +08:00
b9a53bbed1 New translations contributing.mdx (Polish)
[ci skip]
2026-07-24 19:40:36 +08:00
12950b0c46 New translations changelog.mdx (Polish)
[ci skip]
2026-07-24 19:40:34 +08:00
5ba6d07847 New translations readme.mdx (Polish)
[ci skip]
2026-07-24 19:40:31 +08:00
cd33597a8a New translations contributing.mdx (German)
[ci skip]
2026-07-24 19:40:28 +08:00
81ac949d6d New translations changelog.mdx (German)
[ci skip]
2026-07-24 19:40:26 +08:00
9487b10e2d New translations readme.mdx (German)
[ci skip]
2026-07-24 19:40:22 +08:00
9cf6223fcf New translations dcr-toml.mdx (Ukrainian)
[ci skip]
2026-07-24 19:40:20 +08:00
ceddc3bb5c New translations dcr-toml.mdx (Russian)
[ci skip]
2026-07-24 19:40:17 +08:00
82de6e8c60 New translations dcr-toml.mdx (Polish)
[ci skip]
2026-07-24 19:40:14 +08:00
6badcb7465 New translations dcr-toml.mdx (German)
[ci skip]
2026-07-24 19:40:11 +08:00
60a14c7a4c New translations installation.mdx (Ukrainian)
[ci skip]
2026-07-24 19:40:07 +08:00
72e7a4c7ad New translations installation.mdx (Russian)
[ci skip]
2026-07-24 19:40:05 +08:00
a0216a8fb0 New translations installation.mdx (Polish)
[ci skip]
2026-07-24 19:40:02 +08:00
9c9a66d0fe New translations installation.mdx (German)
[ci skip]
2026-07-24 19:40:00 +08:00
47d88d13ff New translations os-flat-bin-archive.mdx (Ukrainian)
[ci skip]
2026-07-21 18:19:02 +08:00
f56f23b501 New translations platform-support.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:59 +08:00
fc75d6239a New translations cross-compilation.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:57 +08:00
edf1c6d181 New translations build-system.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:54 +08:00
f104472a7e New translations first-steps.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:52 +08:00
39a99e85fd New translations workspaces.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:49 +08:00
42c5cbe97e New translations dependencies.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:47 +08:00
9a18dae5fd New translations dcr-toml.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:44 +08:00
7287af6a84 New translations faq.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:41 +08:00
f1b66c511d New translations contributing.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:39 +08:00
fd6077ff74 New translations build-commands.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:36 +08:00
983ca31a0e New translations changelog.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:34 +08:00
0fcfc41f1b New translations readme.mdx (Ukrainian)
[ci skip]
2026-07-21 18:18:31 +08:00
a0da1bc328 New translations os-flat-bin-archive.mdx (Russian)
[ci skip]
2026-07-21 18:18:28 +08:00
d334d2bcb3 New translations platform-support.mdx (Russian)
[ci skip]
2026-07-21 18:18:25 +08:00
781081f791 New translations cross-compilation.mdx (Russian)
[ci skip]
2026-07-21 18:18:23 +08:00
80355ab713 New translations build-system.mdx (Russian)
[ci skip]
2026-07-21 18:18:20 +08:00
5aee983fd4 New translations first-steps.mdx (Russian)
[ci skip]
2026-07-21 18:18:18 +08:00
1cb585b2b2 New translations contributing.mdx (Russian)
[ci skip]
2026-07-21 18:18:15 +08:00
638f26c5df New translations build-commands.mdx (Russian)
[ci skip]
2026-07-21 18:18:13 +08:00
054e715b06 New translations changelog.mdx (Russian)
[ci skip]
2026-07-21 18:18:10 +08:00
1960f354ef New translations readme.mdx (Russian)
[ci skip]
2026-07-21 18:18:07 +08:00
e41b69f0e2 New translations os-flat-bin-archive.mdx (Polish)
[ci skip]
2026-07-21 18:18:05 +08:00
c10fbccfef New translations platform-support.mdx (Polish)
[ci skip]
2026-07-21 18:18:02 +08:00
52dd403065 New translations cross-compilation.mdx (Polish)
[ci skip]
2026-07-21 18:18:00 +08:00
39f6817481 New translations build-system.mdx (Polish)
[ci skip]
2026-07-21 18:17:57 +08:00
3caa5e0fc8 New translations first-steps.mdx (Polish)
[ci skip]
2026-07-21 18:17:54 +08:00
bb5be69f89 New translations contributing.mdx (Polish)
[ci skip]
2026-07-21 18:17:52 +08:00
20d7c33440 New translations build-commands.mdx (Polish)
[ci skip]
2026-07-21 18:17:49 +08:00
8579a22127 New translations changelog.mdx (Polish)
[ci skip]
2026-07-21 18:17:47 +08:00
c2e66576d5 New translations readme.mdx (Polish)
[ci skip]
2026-07-21 18:17:44 +08:00
e011803ad7 New translations os-flat-bin-archive.mdx (German)
[ci skip]
2026-07-21 18:17:42 +08:00
ea96f279cc New translations platform-support.mdx (German)
[ci skip]
2026-07-21 18:17:39 +08:00
5f80e65b4c New translations cross-compilation.mdx (German)
[ci skip]
2026-07-21 18:17:37 +08:00
91bc295f41 New translations build-system.mdx (German)
[ci skip]
2026-07-21 18:17:34 +08:00
6c23a8316a New translations first-steps.mdx (German)
[ci skip]
2026-07-21 18:17:32 +08:00
d50ae819f8 New translations contributing.mdx (German)
[ci skip]
2026-07-21 18:17:29 +08:00
084059d414 New translations build-commands.mdx (German)
[ci skip]
2026-07-21 18:17:27 +08:00
92f02abfd3 New translations changelog.mdx (German)
[ci skip]
2026-07-21 18:17:24 +08:00
f9ad515f4c New translations readme.mdx (German)
[ci skip]
2026-07-21 18:17:21 +08:00
5222038639 New translations workspaces.mdx (Russian)
[ci skip]
2026-07-21 18:17:19 +08:00
5fabc5b432 New translations workspaces.mdx (Polish)
[ci skip]
2026-07-21 18:17:16 +08:00
18736a544a New translations workspaces.mdx (German)
[ci skip]
2026-07-21 18:17:14 +08:00
fc6edd6a56 New translations dependencies.mdx (Russian)
[ci skip]
2026-07-21 18:17:11 +08:00
493da800bf New translations dependencies.mdx (Polish)
[ci skip]
2026-07-21 18:17:09 +08:00
ccc4749eb8 New translations dependencies.mdx (German)
[ci skip]
2026-07-21 18:17:06 +08:00
533874a331 New translations dcr-toml.mdx (Russian)
[ci skip]
2026-07-21 18:17:03 +08:00
87b9828511 New translations dcr-toml.mdx (Polish)
[ci skip]
2026-07-21 18:17:00 +08:00
4901ad59d6 New translations dcr-toml.mdx (German)
[ci skip]
2026-07-21 18:16:58 +08:00
e42fc593c5 New translations faq.mdx (Russian)
[ci skip]
2026-07-21 18:16:55 +08:00
3b6aca3560 New translations faq.mdx (Polish)
[ci skip]
2026-07-21 18:16:52 +08:00
5b1f774ac6 New translations faq.mdx (German)
[ci skip]
2026-07-21 18:16:49 +08:00
e72bc4e778 New translations workspaces.mdx (Ukrainian)
[ci skip]
2026-07-18 20:13:09 +08:00
57cff02e58 New translations workspaces.mdx (Russian)
[ci skip]
2026-07-18 20:13:06 +08:00
6157f1d860 New translations workspaces.mdx (Polish)
[ci skip]
2026-07-18 20:13:04 +08:00
4868b5d0d0 New translations workspaces.mdx (German)
[ci skip]
2026-07-18 20:13:01 +08:00
2dc80ea281 New translations dependencies.mdx (Ukrainian)
[ci skip]
2026-07-18 20:12:59 +08:00
80ec220477 New translations dependencies.mdx (Russian)
[ci skip]
2026-07-18 20:12:56 +08:00
7dc8d77e19 New translations dependencies.mdx (Polish)
[ci skip]
2026-07-18 20:12:54 +08:00
aaba0d4f3d New translations dependencies.mdx (German)
[ci skip]
2026-07-18 20:12:51 +08:00
f7bb1fee0f New translations dcr-toml.mdx (Ukrainian)
[ci skip]
2026-07-18 20:12:48 +08:00
2d182e7259 New translations dcr-toml.mdx (Russian)
[ci skip]
2026-07-18 20:12:46 +08:00
02872886fd New translations dcr-toml.mdx (Polish)
[ci skip]
2026-07-18 20:12:43 +08:00
a8538fe408 New translations dcr-toml.mdx (German)
[ci skip]
2026-07-18 20:12:40 +08:00
140dbe9469 New translations multi-package-workspace.mdx (Ukrainian)
[ci skip]
2026-07-18 20:12:38 +08:00
7d23753199 New translations multi-package-workspace.mdx (Russian)
[ci skip]
2026-07-18 20:12:35 +08:00
bdf4c0baee New translations multi-package-workspace.mdx (Polish)
[ci skip]
2026-07-18 20:12:33 +08:00
09dbd7f8e2 New translations multi-package-workspace.mdx (German)
[ci skip]
2026-07-18 20:12:30 +08:00
78151ff0de New translations license.mdx (Ukrainian)
[ci skip]
2026-07-18 20:12:28 +08:00
66797c2265 New translations license.mdx (Russian)
[ci skip]
2026-07-18 20:12:25 +08:00
b07ca1c0ac New translations license.mdx (Polish)
[ci skip]
2026-07-18 20:12:23 +08:00
8ff841f2f5 New translations license.mdx (German)
[ci skip]
2026-07-18 20:12:20 +08:00
54849b2c43 New translations installation.mdx (Ukrainian)
[ci skip]
2026-07-18 20:12:17 +08:00
8dae42f8ea New translations installation.mdx (Russian)
[ci skip]
2026-07-18 20:12:15 +08:00
8edb16f1e4 New translations installation.mdx (Polish)
[ci skip]
2026-07-18 20:12:12 +08:00
6704c96b30 New translations installation.mdx (German)
[ci skip]
2026-07-18 20:12:10 +08:00
02ad12a902 New translations faq.mdx (Ukrainian)
[ci skip]
2026-07-18 20:12:08 +08:00
c7d5d135ca New translations faq.mdx (Russian)
[ci skip]
2026-07-18 20:12:05 +08:00
8998d19bce New translations faq.mdx (Polish)
[ci skip]
2026-07-18 20:12:02 +08:00
d42eeee0ff New translations faq.mdx (German)
[ci skip]
2026-07-18 20:11:59 +08:00
ba408c3dcc New translations system-commands.mdx (Ukrainian)
[ci skip]
2026-07-18 20:11:57 +08:00
98068b54f7 New translations system-commands.mdx (Russian)
[ci skip]
2026-07-18 20:11:54 +08:00
5770d69128 New translations system-commands.mdx (Polish)
[ci skip]
2026-07-18 20:11:52 +08:00
80fc509997 New translations system-commands.mdx (German)
[ci skip]
2026-07-18 20:11:49 +08:00
05f16fc6b4 New translations project-commands.mdx (Ukrainian)
[ci skip]
2026-07-18 20:11:47 +08:00
e63175549c New translations project-commands.mdx (Russian)
[ci skip]
2026-07-18 20:11:44 +08:00
525bd52f8b New translations project-commands.mdx (Polish)
[ci skip]
2026-07-18 20:11:41 +08:00
9f97202121 New translations project-commands.mdx (German)
[ci skip]
2026-07-18 20:11:39 +08:00
0e2d05788a New translations test-framework.mdx (Russian)
[ci skip]
2026-07-06 15:02:04 +08:00
468cdef2d9 New translations running-tests.mdx (Russian)
[ci skip]
2026-07-06 15:02:02 +08:00
ee9cade5c8 New translations self-update.mdx (Russian)
[ci skip]
2026-07-06 15:01:59 +08:00
25ab25b9a2 New translations platform-support.mdx (Russian)
[ci skip]
2026-07-06 15:01:54 +08:00
360619fb78 New translations environment-variables.mdx (Russian)
[ci skip]
2026-07-06 15:01:52 +08:00
4c24089cb2 New translations dependencies.mdx (Russian)
[ci skip]
2026-07-06 15:01:49 +08:00
3e810c476d New translations dcr-toml.mdx (Russian)
[ci skip]
2026-07-06 15:01:47 +08:00
5682792c2f New translations cross-compilation.mdx (Russian)
[ci skip]
2026-07-06 15:01:44 +08:00
ff5d8ba4bf New translations build-system.mdx (Russian)
[ci skip]
2026-07-06 15:01:41 +08:00
0f1fff7072 New translations build-profiles.mdx (Russian)
[ci skip]
2026-07-06 15:01:38 +08:00
b8cceb2945 New translations license.mdx (Russian)
[ci skip]
2026-07-06 15:01:29 +08:00
fce6804c32 New translations ide-integration.mdx (Russian)
[ci skip]
2026-07-06 15:01:27 +08:00
a988adea3a New translations installation.mdx (Russian)
[ci skip]
2026-07-06 15:01:24 +08:00
6575f5d2f0 New translations first-steps.mdx (Russian)
[ci skip]
2026-07-06 15:01:22 +08:00
17aa2937be New translations faq.mdx (Russian)
[ci skip]
2026-07-06 15:01:19 +08:00
828624860a New translations contributing.mdx (Russian)
[ci skip]
2026-07-06 15:01:16 +08:00
66195b53e2 New translations system-commands.mdx (Russian)
[ci skip]
2026-07-06 15:01:14 +08:00
8ded7958f6 New translations quality-commands.mdx (Russian)
[ci skip]
2026-07-06 15:01:11 +08:00
9c9a2d9096 New translations changelog.mdx (Russian)
[ci skip]
2026-07-06 15:01:09 +08:00
9d033ef9a4 New translations readme.mdx (Russian)
[ci skip]
2026-07-06 15:01:06 +08:00
50fa84c317 New translations quality-commands.mdx (Russian)
[ci skip]
2026-07-06 13:57:31 +08:00
d001ef3e82 New translations quality-commands.mdx (Russian)
[ci skip]
2026-07-06 03:25:46 +08:00
d3cdb8d479 New translations test-framework.mdx (Russian)
[ci skip]
2026-07-06 02:21:58 +08:00
b36d6a2109 New translations running-tests.mdx (Russian)
[ci skip]
2026-07-06 02:21:56 +08:00
facf44ddc3 New translations self-update.mdx (Russian)
[ci skip]
2026-07-06 02:21:53 +08:00
0840956347 New translations workspaces.mdx (Russian)
[ci skip]
2026-07-06 02:21:51 +08:00
4b779d1432 New translations platform-support.mdx (Russian)
[ci skip]
2026-07-06 02:21:48 +08:00
32d76ff80f New translations environment-variables.mdx (Russian)
[ci skip]
2026-07-06 02:21:46 +08:00
8a33a31445 New translations dependencies.mdx (Russian)
[ci skip]
2026-07-06 02:21:43 +08:00
0d4c2399c9 New translations dcr-toml.mdx (Russian)
[ci skip]
2026-07-06 02:21:41 +08:00
ec655d4783 New translations cross-compilation.mdx (Russian)
[ci skip]
2026-07-06 02:21:38 +08:00
b926bbdb31 New translations build-system.mdx (Russian)
[ci skip]
2026-07-06 02:21:36 +08:00
028c9ef16c New translations build-profiles.mdx (Russian)
[ci skip]
2026-07-06 02:21:33 +08:00
b840f658a2 New translations multi-package-workspace.mdx (Russian)
[ci skip]
2026-07-06 02:21:31 +08:00
7203996588 New translations library-project.mdx (Russian)
[ci skip]
2026-07-06 02:21:28 +08:00
57c35a1c99 New translations cross-to-windows.mdx (Russian)
[ci skip]
2026-07-06 02:21:26 +08:00
c7c743c0c9 New translations license.mdx (Russian)
[ci skip]
2026-07-06 02:21:23 +08:00
5876c71be7 New translations ide-integration.mdx (Russian)
[ci skip]
2026-07-06 02:21:21 +08:00
7cf2cd65b4 New translations installation.mdx (Russian)
[ci skip]
2026-07-06 02:21:18 +08:00
4a3c97d674 New translations first-steps.mdx (Russian)
[ci skip]
2026-07-06 02:21:16 +08:00
9ba9cade86 New translations faq.mdx (Russian)
[ci skip]
2026-07-06 02:21:13 +08:00
194963c6b9 New translations contributing.mdx (Russian)
[ci skip]
2026-07-06 02:21:11 +08:00
bd4648b278 New translations system-commands.mdx (Russian)
[ci skip]
2026-07-06 02:21:09 +08:00
f73eb0191e New translations quality-commands.mdx (Russian)
[ci skip]
2026-07-06 02:21:06 +08:00
0edda3658b New translations project-commands.mdx (Russian)
[ci skip]
2026-07-06 02:21:04 +08:00
63d0da68f3 New translations gen-commands.mdx (Russian)
[ci skip]
2026-07-06 02:21:01 +08:00
eee70da275 New translations dependency-commands.mdx (Russian)
[ci skip]
2026-07-06 02:20:59 +08:00
d44c62da6d New translations build-commands.mdx (Russian)
[ci skip]
2026-07-06 02:20:56 +08:00
8c032da3ee New translations changelog.mdx (Russian)
[ci skip]
2026-07-06 02:20:54 +08:00
19a1a6c21f New translations readme.mdx (Russian)
[ci skip]
2026-07-06 02:20:51 +08:00
00c554f59a New translations test-framework.mdx (Ukrainian)
[ci skip]
2026-07-05 17:40:23 +08:00
dd3b858825 New translations test-framework.mdx (Russian)
[ci skip]
2026-07-05 17:40:21 +08:00
c9ce87896e New translations test-framework.mdx (Polish)
[ci skip]
2026-07-05 17:40:19 +08:00
a6e925cd73 New translations test-framework.mdx (German)
[ci skip]
2026-07-05 17:40:16 +08:00
d437378db5 New translations running-tests.mdx (Ukrainian)
[ci skip]
2026-07-05 17:40:14 +08:00
d45fc40eff New translations running-tests.mdx (Russian)
[ci skip]
2026-07-05 17:40:12 +08:00
f3bdded8d4 New translations running-tests.mdx (Polish)
[ci skip]
2026-07-05 17:40:09 +08:00
1f0692dc7d New translations running-tests.mdx (German)
[ci skip]
2026-07-05 17:40:07 +08:00
8545585480 New translations self-update.mdx (Ukrainian)
[ci skip]
2026-07-05 17:40:05 +08:00
9cff770aa1 New translations self-update.mdx (Russian)
[ci skip]
2026-07-05 17:40:02 +08:00
2b40fcd2c5 New translations self-update.mdx (Polish)
[ci skip]
2026-07-05 17:40:00 +08:00
d72f73a0a3 New translations self-update.mdx (German)
[ci skip]
2026-07-05 17:39:57 +08:00
e520331501 New translations workspaces.mdx (Ukrainian)
[ci skip]
2026-07-05 17:39:55 +08:00
8afe307c5c New translations workspaces.mdx (Russian)
[ci skip]
2026-07-05 17:39:53 +08:00
72767955b8 New translations workspaces.mdx (Polish)
[ci skip]
2026-07-05 17:39:50 +08:00
fae2c4cc85 New translations workspaces.mdx (German)
[ci skip]
2026-07-05 17:39:48 +08:00
9eb10ba6ab New translations platform-support.mdx (Ukrainian)
[ci skip]
2026-07-05 17:39:45 +08:00
c0bcb5b0eb New translations platform-support.mdx (Russian)
[ci skip]
2026-07-05 17:39:43 +08:00
b715d7a7ea New translations platform-support.mdx (Polish)
[ci skip]
2026-07-05 17:39:41 +08:00
fbb2ac8cbc New translations platform-support.mdx (German)
[ci skip]
2026-07-05 17:39:38 +08:00
a04952c5f7 New translations environment-variables.mdx (Ukrainian)
[ci skip]
2026-07-05 17:39:36 +08:00
7856b5a1b1 New translations environment-variables.mdx (Russian)
[ci skip]
2026-07-05 17:39:33 +08:00
60fe9864dc New translations environment-variables.mdx (Polish)
[ci skip]
2026-07-05 17:39:31 +08:00
cefaf40a0a New translations environment-variables.mdx (German)
[ci skip]
2026-07-05 17:39:29 +08:00
00e9dacd14 New translations dependencies.mdx (Ukrainian)
[ci skip]
2026-07-05 17:39:26 +08:00
b3c3583d79 New translations dependencies.mdx (Russian)
[ci skip]
2026-07-05 17:39:24 +08:00
1ebc741c6d New translations dependencies.mdx (Polish)
[ci skip]
2026-07-05 17:39:21 +08:00
6302cc5d37 New translations dependencies.mdx (German)
[ci skip]
2026-07-05 17:39:19 +08:00
207709f65c New translations dcr-toml.mdx (Ukrainian)
[ci skip]
2026-07-05 17:39:17 +08:00
94e32d8f10 New translations dcr-toml.mdx (Russian)
[ci skip]
2026-07-05 17:39:14 +08:00
aee2bc2fda New translations dcr-toml.mdx (Polish)
[ci skip]
2026-07-05 17:39:11 +08:00
928a35d017 New translations dcr-toml.mdx (German)
[ci skip]
2026-07-05 17:39:09 +08:00
abd79d0f49 New translations cross-compilation.mdx (Ukrainian)
[ci skip]
2026-07-05 17:39:06 +08:00
0f4abebd5f New translations cross-compilation.mdx (Russian)
[ci skip]
2026-07-05 17:39:03 +08:00
70b6968a78 New translations cross-compilation.mdx (Polish)
[ci skip]
2026-07-05 17:39:01 +08:00
54736fb8a6 New translations cross-compilation.mdx (German)
[ci skip]
2026-07-05 17:38:59 +08:00
2ddcebbc8f New translations build-system.mdx (Ukrainian)
[ci skip]
2026-07-05 17:38:56 +08:00
bb2dbcd5fe New translations build-system.mdx (Russian)
[ci skip]
2026-07-05 17:38:54 +08:00
0f7b8e4ea4 New translations build-system.mdx (Polish)
[ci skip]
2026-07-05 17:38:51 +08:00
46a3c0bf2b New translations build-system.mdx (German)
[ci skip]
2026-07-05 17:38:48 +08:00
9f9851ba5e New translations build-profiles.mdx (Ukrainian)
[ci skip]
2026-07-05 17:38:46 +08:00
b6ba06a848 New translations build-profiles.mdx (Russian)
[ci skip]
2026-07-05 17:38:43 +08:00
887c9600cf New translations build-profiles.mdx (Polish)
[ci skip]
2026-07-05 17:38:41 +08:00
c02ad0b0e1 New translations build-profiles.mdx (German)
[ci skip]
2026-07-05 17:38:38 +08:00
1f14d2ce90 New translations multi-package-workspace.mdx (Ukrainian)
[ci skip]
2026-07-05 17:38:36 +08:00
e04ecbe286 New translations multi-package-workspace.mdx (Russian)
[ci skip]
2026-07-05 17:38:34 +08:00
c9b5c78967 New translations multi-package-workspace.mdx (Polish)
[ci skip]
2026-07-05 17:38:31 +08:00
65e8f93287 New translations multi-package-workspace.mdx (German)
[ci skip]
2026-07-05 17:38:29 +08:00
d89f3dc9da New translations library-project.mdx (Ukrainian)
[ci skip]
2026-07-05 17:38:26 +08:00
c19923f9f5 New translations library-project.mdx (Russian)
[ci skip]
2026-07-05 17:38:24 +08:00
9642e19d2b New translations library-project.mdx (Polish)
[ci skip]
2026-07-05 17:38:22 +08:00
179860687c New translations library-project.mdx (German)
[ci skip]
2026-07-05 17:38:19 +08:00
948e24c65b New translations cross-to-windows.mdx (Ukrainian)
[ci skip]
2026-07-05 17:38:17 +08:00
10409b76a3 New translations cross-to-windows.mdx (Russian)
[ci skip]
2026-07-05 17:38:15 +08:00
892f31777f New translations cross-to-windows.mdx (Polish)
[ci skip]
2026-07-05 17:38:12 +08:00
ae02639a02 New translations cross-to-windows.mdx (German)
[ci skip]
2026-07-05 17:38:10 +08:00
aeb8dee892 New translations license.mdx (Ukrainian)
[ci skip]
2026-07-05 17:38:07 +08:00
dcfc2c5c20 New translations license.mdx (Russian)
[ci skip]
2026-07-05 17:38:05 +08:00
3f845db46b New translations license.mdx (Polish)
[ci skip]
2026-07-05 17:38:02 +08:00
6568f9195f New translations license.mdx (German)
[ci skip]
2026-07-05 17:38:00 +08:00
cee6874d2d New translations ide-integration.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:57 +08:00
90cfb9bb80 New translations ide-integration.mdx (Russian)
[ci skip]
2026-07-05 17:37:55 +08:00
831796481a New translations ide-integration.mdx (Polish)
[ci skip]
2026-07-05 17:37:53 +08:00
4be42f2762 New translations ide-integration.mdx (German)
[ci skip]
2026-07-05 17:37:50 +08:00
ba7da2cab0 New translations installation.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:48 +08:00
70a8034af4 New translations installation.mdx (Russian)
[ci skip]
2026-07-05 17:37:45 +08:00
15a9dff751 New translations installation.mdx (Polish)
[ci skip]
2026-07-05 17:37:43 +08:00
ea6fa550d5 New translations installation.mdx (German)
[ci skip]
2026-07-05 17:37:40 +08:00
6b76866234 New translations first-steps.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:38 +08:00
2f3eda7413 New translations first-steps.mdx (Russian)
[ci skip]
2026-07-05 17:37:35 +08:00
8dd15718dd New translations first-steps.mdx (Polish)
[ci skip]
2026-07-05 17:37:33 +08:00
7e68c560b0 New translations first-steps.mdx (German)
[ci skip]
2026-07-05 17:37:31 +08:00
157fa46b4f New translations faq.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:28 +08:00
98f719cb3c New translations faq.mdx (Russian)
[ci skip]
2026-07-05 17:37:26 +08:00
fa890abaae New translations faq.mdx (Polish)
[ci skip]
2026-07-05 17:37:24 +08:00
d624d45b63 New translations faq.mdx (German)
[ci skip]
2026-07-05 17:37:21 +08:00
052f503a91 New translations contributing.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:19 +08:00
9623d8e5f2 New translations contributing.mdx (Russian)
[ci skip]
2026-07-05 17:37:16 +08:00
0fb266324c New translations contributing.mdx (Polish)
[ci skip]
2026-07-05 17:37:14 +08:00
402b8d29b8 New translations contributing.mdx (German)
[ci skip]
2026-07-05 17:37:11 +08:00
8b95e622df New translations system-commands.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:09 +08:00
9e61448f8f New translations system-commands.mdx (Russian)
[ci skip]
2026-07-05 17:37:07 +08:00
c0f61beccc New translations system-commands.mdx (Polish)
[ci skip]
2026-07-05 17:37:04 +08:00
2b3b520f46 New translations system-commands.mdx (German)
[ci skip]
2026-07-05 17:37:02 +08:00
e8df2839d7 New translations quality-commands.mdx (Ukrainian)
[ci skip]
2026-07-05 17:37:00 +08:00
efa332f2f1 New translations quality-commands.mdx (Russian)
[ci skip]
2026-07-05 17:36:57 +08:00
2294c03800 New translations quality-commands.mdx (Polish)
[ci skip]
2026-07-05 17:36:55 +08:00
426f98bb7a New translations quality-commands.mdx (German)
[ci skip]
2026-07-05 17:36:53 +08:00
12e7d605a6 New translations project-commands.mdx (Ukrainian)
[ci skip]
2026-07-05 17:36:50 +08:00
4be83b31ee New translations project-commands.mdx (Russian)
[ci skip]
2026-07-05 17:36:48 +08:00
fa8f604afc New translations project-commands.mdx (Polish)
[ci skip]
2026-07-05 17:36:45 +08:00
2f6a47af7c New translations project-commands.mdx (German)
[ci skip]
2026-07-05 17:36:43 +08:00
4f2bc3e4dc New translations gen-commands.mdx (Ukrainian)
[ci skip]
2026-07-05 17:36:40 +08:00
9f99f01a54 New translations gen-commands.mdx (Russian)
[ci skip]
2026-07-05 17:36:38 +08:00
95622e5ba6 New translations gen-commands.mdx (Polish)
[ci skip]
2026-07-05 17:36:36 +08:00
6fb5021063 New translations gen-commands.mdx (German)
[ci skip]
2026-07-05 17:36:33 +08:00
00d0cbada4 New translations dependency-commands.mdx (Ukrainian)
[ci skip]
2026-07-05 17:36:31 +08:00
2d2905b5be New translations dependency-commands.mdx (Russian)
[ci skip]
2026-07-05 17:36:28 +08:00
a94af1567b New translations dependency-commands.mdx (Polish)
[ci skip]
2026-07-05 17:36:26 +08:00
2849a7071f New translations dependency-commands.mdx (German)
[ci skip]
2026-07-05 17:36:23 +08:00
0d3ced3750 New translations build-commands.mdx (Ukrainian)
[ci skip]
2026-07-05 17:36:21 +08:00
76df19c5b8 New translations build-commands.mdx (Russian)
[ci skip]
2026-07-05 17:36:19 +08:00
f85cee6c10 New translations build-commands.mdx (Polish)
[ci skip]
2026-07-05 17:36:16 +08:00
26e8416458 New translations build-commands.mdx (German)
[ci skip]
2026-07-05 17:36:14 +08:00
08fb2eed35 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-07-05 17:36:11 +08:00
beed70fbac New translations changelog.mdx (Russian)
[ci skip]
2026-07-05 17:36:09 +08:00
e6a8e07908 New translations changelog.mdx (Polish)
[ci skip]
2026-07-05 17:36:06 +08:00
d8061b641c New translations changelog.mdx (German)
[ci skip]
2026-07-05 17:36:03 +08:00
c09056dcef New translations readme.mdx (Ukrainian)
[ci skip]
2026-07-05 17:36:01 +08:00
9b56f7a053 New translations readme.mdx (Russian)
[ci skip]
2026-07-05 17:35:58 +08:00
756c6edc08 New translations readme.mdx (Polish)
[ci skip]
2026-07-05 17:35:56 +08:00
f20056d3ec New translations readme.mdx (German)
[ci skip]
2026-07-05 17:35:53 +08:00
239 changed files with 13771 additions and 12383 deletions

View File

@@ -5,30 +5,10 @@ on:
branches:
- master
- main
- dev
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci.yml'
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
CARGO_INCREMENTAL: "0"
SCCACHE_GHA_ENABLED: "true"
jobs:
checks:
name: fmt / clippy / check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -38,129 +18,11 @@ jobs:
with:
components: rustfmt, clippy
- name: sccache
uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
shared-key: dcr-ci
cache-all-crates: true
- name: Format
run: cargo fmt --all --check
- name: Clippy (default features)
run: cargo clippy --all-targets -- -D warnings
- name: Clippy (all features)
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check (all features)
- name: Check
run: cargo check --all-targets --all-features
test:
name: tests (${{ matrix.os }})
needs: checks
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: sccache
uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
shared-key: dcr-ci
cache-all-crates: true
cache-on-failure: true
- name: Cache apt packages
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: apt-${{ runner.os }}-
- name: Install Linux tools
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
clang \
nasm \
clang-format \
clang-tidy \
git \
llvm
- name: Install macOS tools
if: runner.os == 'macOS'
run: |
brew install nasm llvm || true
echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH"
- name: Install Windows tools
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install nasm llvm -y
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if (Test-Path "C:\Program Files\LLVM\bin") {
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
- name: Unit tests (binary crate)
run: cargo test --bins -- --nocapture
- name: Integration tests (default features)
run: cargo test --tests -- --nocapture
- name: Integration tests (archive feature)
if: runner.os != 'Windows'
run: cargo test --tests --features archive -- --nocapture
- name: sccache stats
if: always()
run: sccache --show-stats || true
test-archive-linux:
name: archive feature smoke
needs: checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: sccache
uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
shared-key: dcr-ci
cache-all-crates: true
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential clang nasm llvm
- name: Build with archive
run: cargo build --features archive
- name: Flat-bin + unit suite with archive
run: cargo test --features archive --test cli_build --test cli_workspace --test cli_errors -- --nocapture
- name: sccache stats
if: always()
run: sccache --show-stats || true

View File

@@ -1,38 +0,0 @@
name: Mirror source code to GitVerse
on:
push:
branches:
- '**'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: code-mirror-${{ github.ref }}
cancel-in-progress: true
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Mirror all branches
env:
GITVERSE_PAT: ${{ secrets.GITVERSE_PAT }}
GITVERSE_ORG: ${{ vars.GITVERSE_ORG || 'dcr_labs' }}
GITVERSE_REPO: ${{ vars.GITVERSE_REPO || 'dcr' }}
run: |
set -euo pipefail
test -n "$GITVERSE_PAT" || { echo 'GITVERSE_PAT is not configured' >&2; exit 1; }
remote="https://oauth2:${GITVERSE_PAT}@gitverse.ru/${GITVERSE_ORG}/${GITVERSE_REPO}.git"
git remote add gitverse "$remote"
# Use a private ref namespace: Git will not overwrite the checked-out
# branch, and broken legacy submodule metadata is not traversed.
git fetch --no-recurse-submodules origin '+refs/heads/*:refs/mirror/*'
git push --prune --force gitverse 'refs/mirror/*:refs/heads/*'

View File

@@ -1,290 +0,0 @@
name: Mirror releases to GitVerse, SourceCraft, and GitLab
on:
workflow_run:
workflows:
- Release
types:
- completed
workflow_dispatch:
inputs:
tag:
description: Git tag of the GitHub release to mirror (for example v0.7.1)
required: true
type: string
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release.outputs.tag }}
found: ${{ steps.release.outputs.found }}
steps:
- name: Resolve release tag
id: release
env:
GH_TOKEN: ${{ github.token }}
MANUAL_TAG: ${{ inputs.tag }}
WORKFLOW_HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
WORKFLOW_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
set -euo pipefail
tag="$MANUAL_TAG"
if [ -z "$tag" ] && [[ "$WORKFLOW_HEAD_BRANCH" == v* ]]; then
tag="$WORKFLOW_HEAD_BRANCH"
fi
if [ -z "$tag" ] && [ -n "$WORKFLOW_HEAD_SHA" ]; then
releases=$(curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
-H 'Accept: application/vnd.github+json' \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases?per_page=100")
while IFS= read -r candidate; do
ref=$(curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
-H 'Accept: application/vnd.github+json' \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/${candidate}")
sha=$(jq -r '.object.sha' <<< "$ref")
if [ "$(jq -r '.object.type' <<< "$ref")" = tag ]; then
sha=$(curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
-H 'Accept: application/vnd.github+json' \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/git/tags/${sha}" | jq -r '.object.sha')
fi
if [ "$sha" = "$WORKFLOW_HEAD_SHA" ]; then
tag="$candidate"
break
fi
done < <(jq -r '.[].tag_name' <<< "$releases")
fi
if [ -z "$tag" ] || [[ "$tag" != v* ]]; then
echo 'No release tag was found; release.yml may have failed before creating a GitHub release.'
echo 'found=false' >> "$GITHUB_OUTPUT"
exit 0
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo 'found=true' >> "$GITHUB_OUTPUT"
- name: Download GitHub release metadata and assets
if: steps.release.outputs.found == 'true'
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.release.outputs.tag }}
run: |
set -euo pipefail
mkdir -p assets
curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
-H 'Accept: application/vnd.github+json' \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${TAG}" > release.json
jq -e '.tag_name == $tag' --arg tag "$TAG" release.json >/dev/null
total=$(jq '.assets | length' release.json)
downloaded=0
failed=0
while IFS=$' ' read -r name url; do
if curl -fsSL -L -H "Authorization: Bearer $GH_TOKEN" \
-H 'Accept: application/octet-stream' -o "assets/$name" "$url"; then
downloaded=$((downloaded+1))
else
echo "::warning::Failed to download asset: $name"
failed=$((failed+1))
fi
done < <(jq -r '.assets[] | [.name, .browser_download_url] | @tsv' release.json)
echo "Downloaded ${downloaded}/${total} assets (${failed} failed)"
[ "$failed" -eq 0 ] || { echo 'Not all release assets were downloaded.' >&2; exit 1; }
- name: Upload release metadata artifact
if: steps.release.outputs.found == 'true'
uses: actions/upload-artifact@v4
with:
name: release-mirror-data
path: |
release.json
assets/*
if-no-files-found: error
mirror-gitverse:
needs: setup
if: needs.setup.outputs.found == 'true'
runs-on: ubuntu-latest
steps:
- name: Download release metadata
uses: actions/download-artifact@v4
with:
name: release-mirror-data
- name: Sync tag and release to GitVerse
env:
GITVERSE_PAT: ${{ secrets.GITVERSE_PAT }}
GITVERSE_ORG: ${{ vars.GITVERSE_ORG || 'dcr_labs' }}
GITVERSE_REPO: ${{ vars.GITVERSE_REPO || 'dcr' }}
TAG: ${{ needs.setup.outputs.tag }}
run: |
set -euo pipefail
test -n "$GITVERSE_PAT" || { echo 'GITVERSE_PAT is not configured' >&2; exit 1; }
project="${GITVERSE_ORG}%2F${GITVERSE_REPO}"
remote="https://oauth2:${GITVERSE_PAT}@gitverse.ru/${GITVERSE_ORG}/${GITVERSE_REPO}.git"
git clone --mirror "https://github.com/${GITHUB_REPOSITORY}.git" mirror.git
git -C mirror.git remote add gitverse "$remote"
git -C mirror.git push gitverse "refs/tags/${TAG}:refs/tags/${TAG}"
title=$(jq -r '.name // .tag_name' release.json)
notes=$(jq -r '.body // ""' release.json)
payload=$(jq -n --arg tag "$TAG" --arg title "$title" --arg notes "$notes" \
'{name:$title, tag_name:$tag, description:$notes, ref:$tag}')
http=$(curl -sS -o gitverse-release.json -w '%{http_code}' \
-H "PRIVATE-TOKEN: $GITVERSE_PAT" \
"https://gitverse.ru/api/v4/projects/${project}/releases/${TAG}" || true)
if [ "$http" = '200' ]; then
echo "GitVerse release ${TAG} already exists; skipping create."
else
curl -fsSL -X POST -H "PRIVATE-TOKEN: $GITVERSE_PAT" \
-H 'Content-Type: application/json' --data "$payload" \
"https://gitverse.ru/api/v4/projects/${project}/releases" || \
curl -fsSL -X PUT -H "PRIVATE-TOKEN: $GITVERSE_PAT" \
-H 'Content-Type: application/json' --data "$payload" \
"https://gitverse.ru/api/v4/projects/${project}/releases/${TAG}"
fi
uploaded=0; failed=0
for file in assets/*; do
[ -f "$file" ] || continue
name=$(basename "$file")
upload_response=$(curl -sS -w "\n%{http_code}" -X POST -H "PRIVATE-TOKEN: $GITVERSE_PAT" \
-F "file=@$file" "https://gitverse.ru/api/v4/projects/${project}/uploads")
http_code=$(echo "$upload_response" | tail -n1)
body=$(echo "$upload_response" | sed '$d')
if [ "$http_code" != "201" ] && [ "$http_code" != "200" ]; then
echo "::warning::GitVerse: failed to upload $name (HTTP $http_code)"
failed=$((failed+1))
continue
fi
url=$(jq -r '.url // .file_path' <<< "$body" 2>/dev/null || echo "")
if [ -z "$url" ]; then
echo "::warning::GitVerse: failed to parse upload response for $name"
failed=$((failed+1))
continue
fi
link=$(jq -n --arg name "$name" --arg url "$url" '{name:$name,url:$url}')
link_response=$(curl -sS -w "\n%{http_code}" -X POST -H "PRIVATE-TOKEN: $GITVERSE_PAT" \
-H 'Content-Type: application/json' --data "$link" \
"https://gitverse.ru/api/v4/projects/${project}/releases/${TAG}/assets/links")
link_http=$(echo "$link_response" | tail -n1)
if [ "$link_http" = "201" ] || [ "$link_http" = "200" ] || [ "$link_http" = "409" ]; then
uploaded=$((uploaded+1))
else
echo "::warning::GitVerse: failed to attach asset $name (HTTP $link_http)"
failed=$((failed+1))
fi
done
echo "GitVerse: uploaded ${uploaded}, failed ${failed}"
[ "$failed" -eq 0 ] || exit 1
mirror-sourcecraft:
needs: setup
if: needs.setup.outputs.found == 'true'
runs-on: ubuntu-latest
steps:
- name: Download release metadata
uses: actions/download-artifact@v4
with:
name: release-mirror-data
- name: Sync tag and release to SourceCraft
env:
SOURCECRAFT_PAT: ${{ secrets.SOURCECRAFT_PAT }}
SOURCECRAFT_ORG: ${{ vars.SOURCECRAFT_ORG || 'dexoron-dev' }}
SOURCECRAFT_REPO: ${{ vars.SOURCECRAFT_REPO || 'dcr' }}
TAG: ${{ needs.setup.outputs.tag }}
run: |
set -euo pipefail
test -n "$SOURCECRAFT_PAT" || { echo 'SOURCECRAFT_PAT is not configured' >&2; exit 1; }
remote="https://anyname:${SOURCECRAFT_PAT}@git.sourcecraft.dev/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}.git"
git clone "$remote" sourcecraft
git -C sourcecraft remote add github "https://github.com/${GITHUB_REPOSITORY}.git"
git -C sourcecraft fetch github "refs/tags/${TAG}:refs/tags/${TAG}"
git -C sourcecraft push origin "refs/tags/${TAG}"
title=$(jq -r '.name // .tag_name' release.json)
notes=$(jq -r '.body // ""' release.json)
payload=$(jq -n --arg tag "$TAG" --arg title "$title" --arg notes "$notes" \
'{tag:$tag,title:$title,release_notes:$notes,publish:true}')
base="https://api.sourcecraft.tech/repos/${SOURCECRAFT_ORG}/${SOURCECRAFT_REPO}"
http=$(curl -sS -o /dev/null -w '%{http_code}' \
-H "Authorization: Bearer $SOURCECRAFT_PAT" "${base}/releases/tag/${TAG}" || true)
if [ "$http" != '200' ]; then
curl -fsSL -X POST -H "Authorization: Bearer $SOURCECRAFT_PAT" \
-H 'Content-Type: application/json' --data "$payload" "${base}/releases" || \
curl -fsSL -X PUT -H "Authorization: Bearer $SOURCECRAFT_PAT" \
-H 'Content-Type: application/json' --data "$payload" "${base}/releases/${TAG}" || \
echo 'SourceCraft release already exists; continuing with assets.'
else
echo "SourceCraft release ${TAG} already exists; continuing with assets."
fi
uploaded=0; failed=0
for file in assets/*; do
[ -f "$file" ] || continue
name=$(basename "$file")
upload_response=$(curl -sS -w "\n%{http_code}" -X POST -H "Authorization: Bearer $SOURCECRAFT_PAT" \
-F "file=@$file" \
"${base}/releases/tag/${TAG}/assets")
http_code=$(echo "$upload_response" | tail -n1)
if [ "$http_code" = "201" ] || [ "$http_code" = "200" ]; then
uploaded=$((uploaded+1))
elif [ "$http_code" = "409" ]; then
uploaded=$((uploaded+1))
else
echo "::warning::SourceCraft: failed to attach asset $name (HTTP $http_code)"
failed=$((failed+1))
fi
done
echo "SourceCraft: uploaded ${uploaded}, failed ${failed}"
[ "$failed" -eq 0 ] || exit 1
mirror-gitlab:
needs: setup
if: needs.setup.outputs.found == 'true'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Download release metadata
uses: actions/download-artifact@v4
with:
name: release-mirror-data
- name: Sync release to GitLab
env:
GITLAB_PAT: ${{ secrets.GITLAB_PAT }}
GITLAB_PROJECT: ${{ vars.GITLAB_PROJECT || 'dexoron-dev/dcr-tool/dcr' }}
TAG: ${{ needs.setup.outputs.tag }}
run: |
set -euo pipefail
test -n "$GITLAB_PAT" || { echo 'GITLAB_PAT is not configured' >&2; exit 0; }
project_id="${GITLAB_PROJECT//\//%2F}"
api="https://gitlab.com/api/v4/projects/${project_id}"
title=$(jq -r '.name // .tag_name' release.json)
notes=$(jq -r '.body // ""' release.json)
payload=$(jq -n --arg tag "$TAG" --arg title "$title" --arg notes "$notes" \
'{tag_name:$tag, name:$title, description:$notes}')
http=$(curl -sS -o /dev/null -w '%{http_code}' \
-H "PRIVATE-TOKEN: $GITLAB_PAT" "${api}/releases/${TAG}" || true)
if [ "$http" = '200' ]; then
echo "GitLab release ${TAG} already exists; skipping"
exit 0
fi
echo "Creating release on GitLab..."
curl -fsSL -X POST -H "PRIVATE-TOKEN: $GITLAB_PAT" \
-H 'Content-Type: application/json' --data "$payload" "${api}/releases" || true

View File

@@ -45,10 +45,6 @@ on:
description: "Update Homebrew tap"
type: boolean
default: false
run_s3:
description: "Mirror Release to Yandex Object Storage (S3)"
type: boolean
default: false
permissions:
contents: write
@@ -227,9 +223,9 @@ jobs:
- name: Build
run: |
if [ "${{ matrix.target }}" != "x86_64-unknown-linux-gnu" ]; then
cargo zigbuild --release --features archive --target ${{ matrix.target }}
cargo zigbuild --release --target ${{ matrix.target }}
else
cargo build --release --features archive --target ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
fi
- name: Prepare Artifact
@@ -302,9 +298,9 @@ jobs:
run: |
cargo install cargo-deb
if [ "${{ matrix.target }}" != "x86_64-unknown-linux-gnu" ]; then
cargo zigbuild --release --features archive --target ${{ matrix.target }}
cargo zigbuild --release --target ${{ matrix.target }}
else
cargo build --release --features archive --target ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
fi
cargo deb --no-build --target ${{ matrix.target }}
mkdir -p dist-packages && cp target/${{ matrix.target }}/debian/*.deb dist-packages/
@@ -315,9 +311,9 @@ jobs:
run: |
cargo install cargo-generate-rpm
if [ "${{ matrix.target }}" != "x86_64-unknown-linux-gnu" ]; then
cargo zigbuild --release --features archive --target ${{ matrix.target }}
cargo zigbuild --release --target ${{ matrix.target }}
else
cargo build --release --features archive --target ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
fi
cargo generate-rpm --target ${{ matrix.target }}
mkdir -p dist-packages && cp target/${{ matrix.target }}/generate-rpm/*.rpm dist-packages/
@@ -326,7 +322,7 @@ jobs:
- name: Build Snap Package
if: matrix.package_type == 'snap'
run: |
cargo build --release --features archive
cargo build --release
mkdir -p packaging/snap/dist/bin
cp target/release/dcr packaging/snap/dist/bin/
cp -r man packaging/snap/dist/man
@@ -368,7 +364,7 @@ jobs:
cd "\$srcdir/\$pkgname-${PKGVER_ORIG}"
unset CFLAGS CXXFLAGS LDFLAGS
export RUSTFLAGS="-C linker=cc"
cargo build --release --locked --features archive
cargo build --release --locked
}
package() {
cd "\$srcdir/dcr-${PKGVER_ORIG}"
@@ -458,7 +454,7 @@ jobs:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --features archive --target ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}
- name: Prepare Artifact
run: |
@@ -503,7 +499,7 @@ jobs:
run: |
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
pkg install -y rust perl5 gmake
cargo build --release --features archive
cargo build --release
- name: Prepare FreeBSD Artifact
if: matrix.system == 'freebsd'
@@ -521,7 +517,7 @@ jobs:
run: |
export PATH="/usr/local/bin:$PATH"
pkg_add rust perl gmake
cargo build --release --features archive
cargo build --release
- name: Prepare OpenBSD Artifact
if: matrix.system == 'openbsd'
@@ -541,7 +537,7 @@ jobs:
mkdir -p /tmp/bin
ln -sf /usr/pkg/bin/gmake /tmp/bin/make
export PATH="/tmp/bin:/usr/pkg/bin:/usr/pkg/sbin:$PATH"
cargo build --release --features archive
cargo build --release
- name: Prepare NetBSD Artifact
if: matrix.system == 'netbsd'
@@ -589,7 +585,7 @@ jobs:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --features archive --target ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}
- name: Prepare Artifact
shell: pwsh
@@ -658,7 +654,7 @@ jobs:
cd "\$srcdir/\$pkgname-${PKGVER_ORIG}"
unset CFLAGS CXXFLAGS LDFLAGS
export RUSTFLAGS="-C linker=cc"
cargo build --release --locked --features archive
cargo build --release --locked
}
package() {
@@ -923,7 +919,7 @@ jobs:
cd "\$srcdir/dcr-${PKGVER_ORIG}"
unset CFLAGS CXXFLAGS LDFLAGS
export RUSTFLAGS="-C linker=cc"
cargo build --release --locked --features archive
cargo build --release --locked
}
package() {
@@ -1191,7 +1187,6 @@ jobs:
- name: Update Formula/dcr.rb
run: |
VERSION="${{ needs.setup.outputs.version }}"
cat > Formula/dcr.rb <<FORMULA
class Dcr < Formula
desc "Cargo-like utility to manage C/C++ projects"
@@ -1200,36 +1195,37 @@ jobs:
on_macos do
on_intel do
url "https://github.com/dexoron/dcr/releases/download/v${VERSION}/dcr-x86_64-apple-darwin-${VERSION}"
url "https://github.com/dexoron/dcr/releases/download/v#{version}/dcr-x86_64-apple-darwin-#{version}"
sha256 "${{ steps.sha.outputs.macos_x86 }}"
end
on_arm do
url "https://github.com/dexoron/dcr/releases/download/v${VERSION}/dcr-aarch64-apple-darwin-${VERSION}"
url "https://github.com/dexoron/dcr/releases/download/v#{version}/dcr-aarch64-apple-darwin-#{version}"
sha256 "${{ steps.sha.outputs.macos_arm }}"
end
end
on_linux do
on_intel do
url "https://github.com/dexoron/dcr/releases/download/v${VERSION}/dcr-x86_64-unknown-linux-gnu-${VERSION}"
url "https://github.com/dexoron/dcr/releases/download/v#{version}/dcr-x86_64-unknown-linux-gnu-#{version}"
sha256 "${{ steps.sha.outputs.linux_x86 }}"
end
on_arm do
url "https://github.com/dexoron/dcr/releases/download/v${VERSION}/dcr-aarch64-unknown-linux-gnu-${VERSION}"
url "https://github.com/dexoron/dcr/releases/download/v#{version}/dcr-aarch64-unknown-linux-gnu-#{version}"
sha256 "${{ steps.sha.outputs.linux_arm }}"
end
end
def install
bin.install Dir["dcr*"].first => "dcr"
end
resource "man-pages" do
url "https://github.com/dexoron/dcr/releases/download/v${VERSION}/dcr-man-pages-${VERSION}.tar.gz"
url "https://github.com/dexoron/dcr/releases/download/v#{version}/dcr-man-pages-#{version}.tar.gz"
sha256 "${{ steps.sha.outputs.man_pages }}"
end
def install
bin.install Dir["dcr*"].first => "dcr"
resource("man-pages").stage do
man1.install Dir["usr/share/man/man1/*.1"]
end
@@ -1257,73 +1253,4 @@ jobs:
# sudo snap install --classic --dangerous dcrup_*.snap
#
# publish-snap:
# if: ...
# ── Mirror Release to Yandex Object Storage (S3) ─────────────────────────
publish-s3:
if: |
(github.event_name == 'push' && needs.setup.outputs.prerelease == 'false') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_s3 == 'true')
needs:
- setup
- create-release
- man-pages
- build-linux
- build-macos
- build-bsd
- build-windows
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.tag }}
- name: Prepare Directory and Download GitHub Release Assets
id: fetch-assets
shell: bash
run: |
set -euo pipefail
TAG="${{ needs.setup.outputs.tag }}"
mkdir -p dist
cd dist
echo "Downloading assets from GitHub Release for tag: ${TAG}"
gh release download "${TAG}" --dir . --repo "${{ github.repository }}"
cd ..
echo "Archiving source code..."
git archive --format=tar.gz --prefix="dcr-${TAG}/" "${TAG}" -o "dist/dcr-src-${TAG}.tar.gz"
git archive --format=zip --prefix="dcr-${TAG}/" "${TAG}" -o "dist/dcr-src-${TAG}.zip"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Everything to Yandex Object Storage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
shell: bash
run: |
set -euo pipefail
TAG="${{ needs.setup.outputs.tag }}"
aws s3 sync dist/ "s3://${{ secrets.S3_BUCKET_NAME }}/${TAG}/" \
--endpoint-url https://storage.yandexcloud.net \
--region ru-central1
- name: Upload Everything to Cloudflare R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
shell: bash
run: |
set -euo pipefail
TAG="${{ needs.setup.outputs.tag }}"
aws s3 sync dist/ "s3://${{ secrets.R2_BUCKET_NAME }}/${TAG}/" \
--endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
--region auto
# if: ...

View File

@@ -1,14 +0,0 @@
name: Trigger site rebuild
on:
push:
branches: [master]
paths:
- 'docs/**'
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger Cloudflare Pages build
run: curl -sS -X POST "${{ secrets.CF_PAGES_DEPLOY_HOOK }}"

6
.gitignore vendored
View File

@@ -5,8 +5,4 @@ sandbox/**
.cargo/
.env
personal/
.*
!.gitignore
!.github/
graphify-out/
personal/

56
AGENTS.md Normal file
View File

@@ -0,0 +1,56 @@
# AGENTS.md
## Quick start
```bash
cargo build --release && ./target/release/dcr setup
```
## Pre-PR (CI) gate
```bash
cargo fmt --all --check
cargo clippy --all-targets --all-features -- -D warnings
cargo check --all-targets --all-features
cargo test
```
CI (`.github/workflows/ci.yml`) runs fmt, clippy, check — **not** tests.
## Tests
- Integration tests in `tests/` build the dcr binary and run it in temp dirs under `sandbox/cli-tests/` (gitignored).
- Some tests **skip** if no C compiler (`gcc`/`clang`/`cc`) is found at runtime.
- Compiler can be overridden via `DCR_COMPILER` or `DCR_CC` env vars.
- Tests use `$CARGO_BIN_EXE_dcr` when available, else `target/debug/dcr`.
## Architecture
- **Single Rust package** (edition 2024), not a workspace. Only one binary: `dcr`.
- **Entrypoint**: `src/main.rs` — matches `args[1]` against command names.
- **Compiler backends** in `src/core/builder/`: `unix_cc` (gcc/clang), `msvc` (cl/clang-cl), `gas`, `nasm`. Dispatched by matching compiler name string.
- **Config**: `dcr.toml` (per-project), `~/.dcr/config.toml` (registry), `~/.dcr/index.json` (index). Defaults: `language=c`, `standard=c11`, `compiler=clang`, `kind=bin`.
- **`build.rs`** embeds `TARGET` as `DCR_TARGET` env var (shown in `--version`).
- **CLI output** must be in English. Use `utils::log` for messaging.
## Key commands
| Command | Notes |
|---|---|
| `dcr new <name>` | Creates project dir |
| `dcr init` | Init from CWD (must be empty) |
| `dcr build [--debug\|--release] [--target <triple>]` | Default profile: `--debug` |
| `dcr run [--debug\|--release]` | Only for `kind = "bin"` |
| `dcr clean [--debug\|--release] [--all]` | `--all` for workspace roots |
| `dcr tree` | Dependency tree viewer |
| `dcr test [--init]` | Runs/test project tests |
| `dcr gen <vscode\|clion\|compile-commands>` | IDE integration |
| `dcr --update` | Self-update from GitHub Releases |
## Cross-compilation
`--target` accepts short names (`linux`, `macos`, `windows`) or full triples. In CI, Linux cross-builds use `cargo-zigbuild`. When `build.target` is set in `dcr.toml`, DCR auto-injects `--target=<value>` into cflags (clang). Bare-metal targets (containing `none`/`-elf`/`eabi`/`baremetal`) skip DCR's default compiler flags.
## Dependencies (Cargo)
reqwest (blocking+json+rustls-tls), serde, toml, git2, openssl (vendored), self-replace, sha2, ctrlc.

View File

@@ -1,319 +1,5 @@
# Changelog
## [v0.9.1] - 2026-09-13 "Системные pkg-config-зависимости / System pkg-config Dependencies"
### RU
**Добавлено:**
- **Зависимости через `pkg-config`** — `fmt = { pkg-config = "fmt" }` или массив имён пакетов (`pkg-config = ["openssl", "libcrypto"]`) подключает системные библиотеки через `.pc`-метаданные.
- **Поддержка префиксов в `dcr add`** — команды `dcr add fmt pkg-config:fmt` и `dcr add openssl pkg:openssl,libcrypto` добавляют зависимости от системных пакетов в `dcr.toml`.
- **Полный набор флагов** — DCR собирает и пробрасывает compiler/linker flags (`-I`, `-L`, `-l`, `-pthread` и другие), включая транзитивные зависимости и интеграцию с `dcr gen` / `dcr test`.
- **Фиксация в `dcr.lock`** — записывается источник `pkg-config+...` и обнаруженная версия пакета.
- **Отображение в `dcr tree`** — `pkg-config` зависимости наглядно помечаются в дереве зависимостей.
**Исправлено:**
- **Ошибка создания проекта в папках со спецсимволами** — `dcr new` больше не завершается ошибкой `Failed to create dcr.toml`, если родительская директория содержит пробелы или не-ASCII символы.
### EN
**Added:**
- **`pkg-config` dependencies** — `fmt = { pkg-config = "fmt" }` or an array of package names (`pkg-config = ["openssl", "libcrypto"]`) connects system libraries through their `.pc` metadata.
- **Prefix support in `dcr add`** — `dcr add fmt pkg-config:fmt` and `dcr add openssl pkg:openssl,libcrypto` add system package dependencies to `dcr.toml`.
- **Complete flag propagation** — compiler/linker flags (`-I`, `-L`, `-l`, `-pthread`, and others) are preserved and passed to builds, `dcr test`, and IDE integrations via `dcr gen`.
- **Lockfile entries** — `dcr.lock` records the `pkg-config+...` source and detected package version.
- **`dcr tree` representation** — `pkg-config` dependencies are clearly labeled in the dependency tree.
**Fixed:**
- **Project creation failure in special character directories** — `dcr new` no longer fails with `Failed to create dcr.toml` when invoked inside parent folders with spaces or non-ASCII characters.
## [v0.9.0] - 2026-08-31 "Полные Path/Git-зависимости и готовые библиотеки / Complete Path/Git Dependencies & Prebuilt Libraries"
### RU
**Добавлено:**
- **Зеркала загрузок в `dcrup`** — `--mirror auto|cf|gh|sf|ya` и `DCRUP_MIRROR`.
По умолчанию `auto`: **cf → gh → sf → ya** (CloudFlare CDN, GitHub, SourceForge, Yandex CDN).
- **Полные Path/Git-зависимости** — DCR-пакеты из `path` и `git` собираются перед потребителем; Git-код кешируется в `~/.dcr/git`, поддерживает `branch`/`tag`/`rev` и фиксирует точный commit в `dcr.lock`.
- **Транзитивные зависимости и защита от циклов** — DCR рекурсивно собирает DCR-пакеты и показывает цепочку циклической зависимости.
- **Внешние готовые библиотеки через path/Git** — `include`, `lib` и `libs` подключают библиотеку без `dcr.toml`; Git prebuilt-источники тоже фиксируются по точному commit.
- **Явный режим зависимости** — `mode = "build"` и `mode = "prebuild"` позволяют выбрать сборку DCR-пакета или подключение готовых артефактов, даже когда репозиторий содержит оба варианта.
**Удалено:**
- **`install.sh` / `install.ps1` / `install_bsd.sh`** — устарели, заменены `dcrup`.
### EN
**Added:**
- **Download mirrors in `dcrup`** — `--mirror auto|cf|gh|sf|ya` and `DCRUP_MIRROR`.
Default `auto` tries **cf → gh → sf → ya** (CloudFlare CDN, GitHub, SourceForge, Yandex CDN).
- **Complete Path/Git dependencies** — DCR packages from `path` and `git` are built before their consumer; Git sources are cached in `~/.dcr/git`, support `branch`/`tag`/`rev`, and lock the exact commit in `dcr.lock`.
- **Transitive dependencies and cycle protection** — DCR recursively builds DCR packages and reports the dependency cycle chain.
- **Prebuilt external libraries through path/Git** — `include`, `lib`, and `libs` link libraries without `dcr.toml`; Git prebuilt sources are locked to their exact commit as well.
- **Explicit dependency mode** — `mode = "build"` and `mode = "prebuild"` select DCR package builds or ready-made artifacts when a repository contains both forms.
**Removed:**
- **`install.sh` / `install.ps1` / `install_bsd.sh`** — superseded by `dcrup`.
## [v0.8.5] - 2026-08-08 "Фиксация версии dcr-version и предупреждения совместимости / Config Version Pinning & Compatibility Warnings"
### RU
**Добавлено:**
- **`package.dcr-version`** — опциональный pin версии CLI в `dcr.toml`.
`dcr new` / `dcr init` пишут текущую версию. При загрузке конфига:
- нет / пустой pin → warn «добавь dcr-version»;
- dcr старше pin → warn «обнови dcr»;
- dcr новее pin → warn «проверь changelog, подними pin»;
- равенство — тишина.
Команды не падают, только предупреждение (раз на path за процесс).
### EN
**Added:**
- **`package.dcr-version`** — optional CLI version pin in `dcr.toml`.
`dcr new` / `dcr init` write the current version. On config load:
- missing / empty pin → warn "add dcr-version";
- dcr older than pin → warn "update dcr";
- dcr newer than pin → warn "check changelog, update pin";
- equal → silent.
Commands do not fail, warning only (once per path per process).
## [0.8.4] - 2026-08-04 "Инфраструктура .dcr/ и интеграция с IDE / Internal .dcr/ Layout & IDE Integration"
### RU
**Добавлено:**
- **Директория `.dcr/`** — единый machine-readable источник фактов о сборке для IDE/расширений:
- `.dcr/compile_commands.json`
- `.dcr/build-info.json` (`schemaVersion`, `artifact_path`, `profile`, …)
- `.dcr/toolchain.json` (compiler/debugger paths, moc/uic/rcc)
- `.dcr/ide/` (заготовки lock-файлов для расширений)
- **`dcr gen project-info`** — поля `target`, `target_dir`, `artifact_path`, `artifact_kind`, `source_roots`, `include_globs`, `exclude_globs`; пути абсолютные/канонические.
- **`dcr build --print-artifact-path`** — после успешной сборки одна строка absolute path на stdout.
- **`dcr gen … --quiet` / `-q`** — без human-лога на stdout для `compile-commands` / `project-info`.
- **`.clangd`** — при первом `gen` создаётся с `CompilationDatabase: .dcr` (маркер `# managed by dcr gen`); ручной `.clangd` не перезаписывается.
- **Хелперы** `canonicalize_path`, `atomic_write`, `ensure_dcr_dir`; pure `resolve_artifact_path` через `platform::*`.
- **`dcr new` / `dcr init`** — `.dcr/` в `.gitignore`.
**Изменено (breaking):**
- **`compile_commands.json` перенесён** из корня проекта в **`.dcr/compile_commands.json`**.
clangd находит базу через `.clangd` / `clangd.arguments --compile-commands-dir=.dcr`.
CLion `misc.xml` и VSCode `settings.json` обновлены под новый путь.
- **Атомарная запись** `compile_commands.json` (tmp + rename).
- **`gen vscode` / `gen clion` launch/run** — `program`/`executable` через тот же artifact resolver, что `project-info` / `build-info.json` (Linux triple, Windows `.exe`, custom `target`/`filename`).
**Исправлено:**
- Launch-конфиги больше не указывают `target/<profile>/<name>` без triple на Linux.
- Симлинки/mount: root и пути в compile database канонизируются best-effort.
### EN
**Added:**
- **`.dcr/` directory** — shared machine-readable build facts for IDE integrations:
- `.dcr/compile_commands.json`
- `.dcr/build-info.json` (`schemaVersion`, `artifact_path`, `profile`, …)
- `.dcr/toolchain.json` (compiler/debugger paths, moc/uic/rcc)
- `.dcr/ide/` (placeholder for IDE lock files)
- **`dcr gen project-info`** — `target`, `target_dir`, `artifact_path`, `artifact_kind`, `source_roots`, `include_globs`, `exclude_globs`; absolute/canonical paths.
- **`dcr build --print-artifact-path`** — one absolute artifact path line on stdout after a successful build.
- **`dcr gen … --quiet` / `-q`** — suppress human success logs for gen subcommands.
- **`.clangd`** — created on first gen with `CompilationDatabase: .dcr` (`# managed by dcr gen`); custom `.clangd` is not overwritten.
- **Helpers** `canonicalize_path`, `atomic_write`, `ensure_dcr_dir`; pure `resolve_artifact_path` via `platform::*`.
- **`dcr new` / `dcr init`** — add `.dcr/` to `.gitignore`.
**Changed (breaking):**
- **`compile_commands.json` moved** from project root to **`.dcr/compile_commands.json`**.
clangd discovers it via `.clangd` / `--compile-commands-dir=.dcr`.
CLion and VSCode generators updated accordingly.
- **Atomic write** for compile_commands (tmp + rename).
- **`gen vscode` / `gen clion` launch/run** — use the same artifact path resolver as `project-info` / `build-info.json`.
**Fixed:**
- Launch configs no longer hardcode `target/<profile>/<name>` without the Linux triple segment.
- Symlink/mount roots: best-effort canonicalize for root and compile database paths.
## [0.8.3] - 2026-08-03 "Конфигурация host target, аргументы run и нативные пути артефактов / Host Target Config, Run Args & Native Artifact Paths"
### RU
**Добавлено:**
- **`dcr run -- <args>...`** — cargo-style: всё после bare `--` передаётся собранному бинарнику
(`dcr run --release -- --test_help`). Работает и для прямого запуска, и для `[run].cmd`.
- **Интеграционные / unit-тесты** — host target sections применяют `ldflags` без `--target`; проброс аргументов после `--`; парсер `split_double_dash`.
**Изменено:**
- **Native-сборка резолвит host triple** — без `--target` / без `build.target` конфиг-секции вида
`[build.x86_64-unknown-linux-gnu]` (и аналоги host) снова применяются (`cflags` / `ldflags` / toolchain).
Раньше target был «пустым», секции молча игнорировались, а артефакты уже лежали под host triple — линковка без `-L`/`-l`.
- **Пустой target** — `normalize_target_os("")` больше не warn'ит `Unknown target ''`.
- **`dcr run --help` / man `dcr-run`** — документирован разделитель `--` и forwarding args.
**Исправлено:**
- **Нативные пути артефактов на Windows и macOS** — без явного `--target` / `build.target` артефакты снова сохраняются в `target/<profile>`, поэтому `dcr run` и flat-bin находят результат сборки.
- Target-specific `ldflags` на native Linux/macOS/Windows (host triple) не доходили до линкера.
- Ложный warning на пустой target string.
### EN
**Added:**
- **`dcr run -- <args>...`** — cargo-style: arguments after a bare `--` are forwarded to the built binary
(`dcr run --release -- --test_help`). Works for direct binary runs and `[run].cmd`.
- **Tests** — host target sections apply `ldflags` without CLI `--target`; run-arg forwarding; `split_double_dash` unit tests.
**Changed:**
- **Native builds resolve the host triple** — without `--target` / without package `build.target`, host sections such as
`[build.x86_64-unknown-linux-gnu]` (and host equivalents) apply again (`cflags` / `ldflags` / toolchain).
Previously the target was empty, those sections were silently ignored while artifacts already used the host triple path — link failed without `-L`/`-l` (e.g. sandbox micro-lang + `libsct-elf`).
- **Empty target** — `normalize_target_os("")` no longer warns `Unknown target ''`.
- **`dcr run --help` / man `dcr-run`** — document `--` and argument forwarding.
**Fixed:**
- **Native artifact paths on Windows and macOS** — without an explicit `--target` / `build.target`, artifacts again use `target/<profile>`, so `dcr run` and flat-bin find the build output.
- Target-specific `ldflags` on native host builds not reaching the linker.
- Spurious warning for an empty target string.
## [0.8.2] - 2026-07-22 "CLI Progress, archive Feature, Workspace Path Fixes / CLI Progress, archive Feature, Workspace Path Fixes"
### RU
**Добавлено:**
- **Прогресс компиляции `[N/M]`** — live-строка `compile pkg v0.1.0 [12/41]` на TTY (stderr), чтобы длинные mono-package сборки не выглядели «зависшими».
- **Свой стиль статуса build** — фиксированная колонка глаголов: `project`, `compile`, `dep`, `ready`, `pack`, `done`, `run` (не cargo-clone).
- **Cargo feature `archive`** — `fatfs` и упаковка FAT-образов опциональны (`cargo build --features archive`). Release CI собирает с feature; без feature `[archive]` даёт явную ошибку.
- **Интеграционные тесты** — `flat_bin_nasm_build`, `package_build_target_used_without_cli_flag`, усилен workspace `clean --all`.
- **Расширенный CI** — unit + integration на Linux/macOS/Windows, отдельный job с `--features archive`, rust-cache, clippy default + all-features.
**Изменено:**
- **CLI host triple больше не форсится** — без `--target` используется `build.target` пакета/member (важно для bare-metal / post_steps ISO).
- **Relative `-I`/`-L`/`-T` (и `-isystem`/`-idirafter`)** в cflags/ldflags абсолютизируются относительно корня пакета (workspace CWD = root).
- **`dcr clean --all`** — не спамит `target not found` по members без локального `target/` (общий root `target/`).
- **`error` / `warn`** — красный / жёлтый, вывод на stderr; `Подсказка:` → `Hint:`.
- **`dcr --help` / man** — добавлены `add`, `lint`, `setup`; unknown command → exit code 1.
- **Сообщения NotFound** — `linker not found: ld.lld …` / `{tool} not found …` вместо сырого `os error 2`.
### EN
**Added:**
- **Compile progress `[N/M]`** — live TTY line `compile pkg v0.1.0 [12/41]` so long mono-package builds do not look hung.
- **DCR status verbs** — fixed-width column: `project`, `compile`, `dep`, `ready`, `pack`, `done`, `run`.
- **Cargo feature `archive`** — optional `fatfs` / FAT packing (`cargo build --features archive`). Release CI builds with the feature; without it `[archive]` errors clearly.
- **Integration tests** — `flat_bin_nasm_build`, package `build.target` without CLI flag, stricter workspace `clean --all`.
- **Expanded CI** — unit + integration on Linux/macOS/Windows, archive feature job, rust-cache, clippy default + all-features.
**Changed:**
- **CLI no longer forces host triple** — without `--target`, package/member `build.target` is used (bare-metal / ISO post_steps).
- **Relative `-I`/`-L`/`-T` (and `-isystem`/`-idirafter`)** in flags are absolutized against the package root when workspace CWD is the root.
- **`dcr clean --all`** — no spam for members without a local `target/` (shared root `target/`).
- **`error` / `warn`** — red / yellow on stderr; Russian `Подсказка:` → `Hint:`.
- **`dcr --help` / man** — list `add`, `lint`, `setup`; unknown command exits 1.
- **NotFound messages** — `linker not found: ld.lld …` / `{tool} not found …` instead of raw `os error 2`.
## [0.8.1] - 2026-07-20 "OS-Dev: flat-bin, FAT-образы / OS-Dev: flat-bin & FAT Images"
### RU
**Добавлено:**
- **`build.kind = "flat-bin"`** — сырой бинарный артефакт (расширение по умолчанию `.bin`):
- **NASM** — `-f bin`, прямой вывод `<stem>.bin`
- **FASM** — прямой вывод (ожидается `format binary` в исходнике)
- **GAS / MASM / LLVM IR (`llc`)** — объект → `objcopy -O binary` → `<stem>.bin`
- **C/C++ (gcc/clang/MSVC)** — compile → link (nostdlib/static) → `objcopy -O binary` → `<name>.bin`
- Требуется `llvm-objcopy` / `objcopy` / `gobjcopy` в PATH (кроме NASM/FASM direct)
- **Секция `[archive]`** — после успешной сборки DCR собирает образ диска (FAT12/16/32): размер, offset, volume label, опциональный bootsector и `layout`. С 0.8.2 — за feature `archive`.
- **Одиночные файлы в `build.roots`** — корень может быть файлом (`.c`, `.asm`, header), а не только каталогом.
**Изменено:**
- **`dcr build --force` / `dcr run --force`** — force также перезапускает `build.steps` и `build.post_steps`.
- **`dcr run` на workspace-only root** — если задан `[run].cmd`, сначала build + run по конфигу корня; иначе делегирование члену workspace.
### EN
**Added:**
- **`build.kind = "flat-bin"`** — raw binary (default `.bin`) across NASM/FASM/GAS/MASM/LLC and C/C++ (objcopy where needed).
- **`[archive]` section** — FAT12/16/32 disk images after build (from 0.8.2 gated by feature `archive`).
- **Single-file `build.roots`**.
**Changed:**
- **`--force`** re-runs steps/post_steps; workspace-only **`dcr run`** prefers root `[run].cmd` when set.
## [0.8.0] - 2026-07-18 "Модульный Движок Сборки, Новая Архитектура Ядра и Улучшение Workspaces / Modular Build Engine, New Core Architecture, & Workspace Improvements"
### RU
**Добавлено:**
- **Выделенное ядро сборки (Build Engine extraction)** — вся логика оркестрации компиляции и сборки полностью вынесена из интерфейсного модуля `src/cli/build.rs` в изолированный, переиспользуемый модуль ядра `src/core/build/engine.rs`.
- **Полиморфная модель языков (Трейт `Language`)** — введение абстрактного трейта `Language` (`src/core/build/language/mod.rs`). Логика поиска файлов, сопоставления расширений и компиляторов распределена по выделенным языковым бэкендам для C, C++ (включая шаги генерации Qt), LLVM IR и ассемблера (GAS, NASM, FASM, MASM).
- **Абстракция сборщиков (Трейт `Builder`)** — введение трейта `Builder` для полиморфного управления процессами компиляции (`src/core/build/builder/mod.rs`). Логика вызова компиляторов семейства GCC/Clang вынесена в общий модуль `builder/cc_common.rs`, а MSVC — в `builder/msvc/`.
- **Поязыковая конфигурация (`[build.<lang>]`)** — добавлена поддержка индивидуальных настроек для каждого языка в `dcr.toml` (например, `[build.c]`, `[build.cpp]`, `[build.asm]`), позволяя независимо настраивать компилятор, стандарт и флаги сборки.
- **Интеграция путей зависимостей в Workspaces** — сборщик теперь автоматически инжектирует пути заголовков (включая исходники `src/` членов, папки `include/` и директорию `target/include`) и библиотек (`target/lib`, а также специфичные для целевой платформы папки сборки) зависимых членов workspace при сборке.
- **Система событий `BuildReporter`** — весь вывод сборщика переведён на событийную модель (`src/core/build/report.rs`), что делает движок пригодным для программного встраивания (например, в IDE) без необходимости перехвата stdout/stderr.
- **Поддержка отмены сборки** — добавлен потокобезопасный токен отмены (`Arc<AtomicBool>`), позволяющий безопасно прервать выполнение компиляции на любом этапе.
- **Сохранение кастомных ключей TOML** — парсер `dcr.toml` переведен на `toml_edit`, что гарантирует сохранение всех неизвестных/пользовательских ключей, комментариев и форматирования при перезаписи файла (например, через `dcr add`).
- **Разрешение заголовков для локальных path-зависимостей** — исправлена проблема, при которой потребители не могли найти заголовочные файлы статических/динамических библиотек, лежащие в упакованной папке `target/include` локальных path-зависимостей.
- **Новая система интеграционных тестов** — старый громоздкий файл `tests/cli_basic.rs` разделен на изолированные и структурированные интеграционные тесты для каждой команды и фичи: `cli_build.rs`, `cli_deps.rs`, `cli_lint.rs`, `cli_new.rs`, `cli_qt.rs`, `cli_test.rs`, `cli_workspace.rs`.
**Изменено:**
- **Дедупликация генерации артефактов** — логика линковки бинарных файлов (ELF, PE, EXE), динамических библиотек (`.so`, `.dll`, `.dylib`) и архивации статических библиотек (`.a`, `.lib`) полностью перенесена в выделенный модуль `src/core/build/builder/artifact.rs`.
- **Запуск членов workspace из корня** — команда `dcr run` при вызове из корня workspace-only проекта теперь запускает сборку выбранного пакета в контексте workspace (через флаг `--workspace`), исключая изолированные ошибки сборки.
- **Отказ от глобального состояния** — все операции сборки изолированы внутри структуры `BuildContext`, обеспечивая многопоточную безопасность сборщика.
- **Вынос логики кэширования** — проверка инкрементальных изменений, отслеживание заголовков (`#include`) и вычисление хэшей сборки перенесено в изолированный модуль `src/core/build/cache.rs`.
- **Модуляризация кастомных шагов** — обработка этапа `build.steps` для препроцессоров вынесена в `src/core/build/steps.rs`.
### EN
**Added:**
- **Dedicated Build Engine (`src/core/build/engine.rs`)** — decoupled the build orchestration logic completely from the CLI front-end wrapper in `src/cli/build.rs` to a reusable, decoupled core build engine.
- **Polymorphic Language Model (`Language` trait)** — introduced the abstract `Language` trait (`src/core/build/language/mod.rs`). File scanning, compiler resolution, and flags handling are now encapsulated in dedicated language modules for C, C++ (including Qt code generation), LLVM IR, and ASM (GAS, NASM, FASM, MASM).
- **Polymorphic Compilation Dispatch (`Builder` trait)** — introduced the `Builder` trait to generalize builder invocations (`src/core/build/builder/mod.rs`). Consolidated GCC/Clang logic into `builder/cc_common.rs` and Microsoft Visual C++ logic into `builder/msvc/`.
- **Per-Language Configuration overrides (`[build.<lang>]`)** — introduced support for configuring language-specific compiler, standard, and flags (e.g. `[build.c]`, `[build.cpp]`, `[build.asm]`) independently in `dcr.toml`.
- **Automatic Workspace Dependency Injection** — during workspace builds, include/lib paths of dependent workspace members (including their source headers, local `include/` folders, and build target `target/include` / `target/lib` folders) are automatically resolved and injected.
- **`BuildReporter` Event System** — decoupled build orchestration output into a structured event-driven reporter model (`src/core/build/report.rs`), making DCR suitable for library embedding and IDE integrations without stderr capturing.
- **Build Cancellation Support** — introduced thread-safe cancellation tokens (`Arc<AtomicBool>`) allowing clients to safely abort compile runs mid-execution.
- **TOML Formatting & Custom Keys Preservation** — migrated the config editor to `toml_edit`, preserving all unknown/user-defined TOML keys, structures, and comments during file write operations (e.g., in `dcr add`).
- **Path Dependencies Target Include Resolution** — local path dependencies configured via tables now correctly expose headers built and packaged into their `target/include` folder to consumer packages.
- **Modular Integration Test Suite** — refactored the monolith `tests/cli_basic.rs` file into clean, specialized integration tests: `cli_build.rs`, `cli_deps.rs`, `cli_lint.rs`, `cli_new.rs`, `cli_qt.rs`, `cli_test.rs`, `cli_workspace.rs`.
**Changed:**
- **Consolidated Linking and Archiving** — artifact generation (linking executables/shared libraries and archiving static libraries) consolidated into a single `src/core/build/builder/artifact.rs` module.
- **Workspace-Aware member execution** — `dcr run` executed at the workspace root of a `workspace_only` project now triggers the member build inside the workspace context using the `--workspace` parameter, preventing standalone build issues.
- **Elimination of Global State** — removed global variables and states from the build core, encapsulating build logic inside isolated `BuildContext` structs for thread safety.
- **Build Cache Separation** — relocated mtime tracking, incremental caching, and header-dependency checking logic to `src/core/build/cache.rs`.
- **Modularized Pre-build Steps** — decoupled generator scripts and pre-build commands parsing into `src/core/build/steps.rs`.
## [0.7.4] - 2026-06-17 "Qt Поддержка, Linting и Рефакторинг Архитектуры / Qt Support, Linting, & Architecture Refactor"
### RU
@@ -409,31 +95,25 @@
### RU
**Добавлено:**
- Учтён `target_env` в `default_target_triple()` — Linux (gnu/musl) и Windows (msvc/gnu) теперь используют правильное окружение, а не хардкод.
**Исправлено:**
- **Сборка на macOS Apple Silicon падала с `_main` undefined** — `--target=` теперь передаётся и в ldflags, не только в cflags. `default_target_triple()` на macOS использует `std::env::consts::ARCH` вместо хардкода `x86_64`.
- **Бейджи GitHub Stars и GPL-3.0 не рендерились в README** — блок бейджей переведён на чистый HTML.
**Изменено:**
- Вычисление таргета по умолчанию вынесено в общую функцию `default_target_triple()` — устранено дублирование в build, run, clean.
### EN
**Added:**
- `default_target_triple()` now respects `target_env` — Linux (gnu/musl) and Windows (msvc/gnu) use the correct environment instead of hardcoded values.
**Fixed:**
- **macOS Apple Silicon builds failed with `_main` undefined** — `--target=` is now passed to ldflags, not just cflags. `default_target_triple()` uses `std::env::consts::ARCH` on macOS instead of hardcoded `x86_64`.
- **GitHub Stars and GPL-3.0 badges not rendering in README** — badge block converted to pure HTML.
**Changed:**
- Default target resolution extracted into shared `default_target_triple()` — removed duplication across build, run, clean.
## [0.7.1] - 2026-06-02 "Мультиархитектурное расширение / The Multi-Arch Expansion"
@@ -441,7 +121,6 @@
### RU
**Добавлено:**
- Вывод `--help` для всех команд с цветным форматированием.
- man-страницы (12 штук в `man/man1/`) и их установка во всех пакетах.
- Валидация имен проектов в `dcr init` и `dcr new` (только ASCII буквы, цифры, `_` и `-`).
@@ -452,7 +131,6 @@
- Пакеты AUR (`dcr-dev`, `dcr-dev-bin`) и сборка Snap в CI.
**Изменено:**
- Функция `validate_package_name` стала публичной.
- Команды `gen`, `tree`, `fmt`, `setup` больше не игнорируют аргументы и используют цветной вывод.
- Инструкция в README изменена с `| bash` на `| sh` для POSIX.
@@ -470,7 +148,6 @@
### EN
**Added:**
- `--help` for all commands with styled headers and usage lines.
- Man pages (12 troff man pages in `man/man1/`) and their installation across all packaging formats.
- Project name validation in `dcr init` and `dcr new` (ASCII letters, digits, `_`, `-` only).
@@ -481,7 +158,6 @@
- AUR packages (`dcr-dev`, `dcr-dev-bin`) and Snap build in CI.
**Changed:**
- `validate_package_name` made public and callable from CLI commands directly.
- `gen.rs`, `tree.rs`, `fmt.rs`, `setup.rs` no longer ignore arguments and use styled output.
- README install instructions changed from `| bash` to `| sh` for POSIX compatibility.
@@ -658,7 +334,6 @@ Added:
```
Produces `KERNEL.EFI` (works for `bin`, `staticlib`, and `sharedlib`).
- Automatic injection of `--target=<build.target>` into compiler flags when `build.target` is set in `dcr.toml`. This greatly simplifies clang-based cross-compilation (especially for bare-metal targets like `aarch64-none-elf`).
- Bare-metal targets (containing `none`, `-elf`, `eabi`, `baremetal`) no longer receive DCR's internal default flags (`-g`, `-Wall`, `-Wextra`, `-fno-omit-frame-pointer`, `-DDCR_DEBUG`, etc.). Prevents unwanted sections (`.comment`, debug info, etc.) that break custom linker scripts when `inherit = true`.
- `build.ldscript` in `dcr.toml` — linker script path passed as `-T <path>` to the linker. Essential for bare-metal/embedded/freestanding targets.
@@ -693,28 +368,28 @@ Fixed:
- Path dependencies now work correctly: `dcr add` stores them as `{ path =
"./..." }` tables, `is_registry_dep` properly distinguishes registry strings
from path/git strings, and `deps/mod.rs` resolves both table-form and
legacy string-form path dependencies
from path/git strings, and `deps/mod.rs` resolves both table-form and
legacy string-form path dependencies
- Registry dependency paths no longer hardcoded to `project_root/dcr-index`;
now use `package_root_from_registry_info()` which resolves relative to the
registry cache root (`~/.dcr/`)
now use `package_root_from_registry_info()` which resolves relative to the
registry cache root (`~/.dcr/`)
- Registry dependencies are now actually built: `build_project_at()` is
called when `include_dir` or `lib_dir` is missing
called when `include_dir` or `lib_dir` is missing
Added:
- `SIGINT`/`Ctrl+C` handler via `ctrlc` crate — `dcr build` now checks
`BUILD_INTERRUPTED` flag at key points and aborts cleanly
`BUILD_INTERRUPTED` flag at key points and aborts cleanly
- `utils/build.rs` — extracted shared utilities: `parse_version_info`,
`normalize_target_os`, `resolve_compiler`, `primary_language`,
`resolve_pkg_config_flags` and config helpers. Eliminates code duplication
between `cli/build.rs`, `cli/run.rs`, `cli/clean.rs`, `cli/gen.rs`
`normalize_target_os`, `resolve_compiler`, `primary_language`,
`resolve_pkg_config_flags` and config helpers. Eliminates code duplication
between `cli/build.rs`, `cli/run.rs`, `cli/clean.rs`, `cli/gen.rs`
- `utils/fs.rs::with_dir` — extracted common directory-scoped execution
- `run_command_sync_output` in `builder/common.rs` with global `OUTPUT_MUTEX`
— synchronized compiler output across all backends (unix_cc, gas, nasm, msvc)
— synchronized compiler output across all backends (unix_cc, gas, nasm, msvc)
- New helper functions in `deps/register.rs`: `get_registry_cache_root`,
`package_root_from_registry_info`, `registry_include_dir`, `registry_lib_dir`,
`path_from_string_dep`
`package_root_from_registry_info`, `registry_include_dir`, `registry_lib_dir`,
`path_from_string_dep`
- Unit tests for `register.rs` (`is_registry_dep`, `package_root_from_registry_info`),
`deps/mod.rs` (`path_dep_path`, `push_default_lib_dirs`),
`utils/build.rs` (`normalize_target_os`, `parse_version_info`)

View File

@@ -11,7 +11,6 @@ Thanks for your interest in the project.
```bash
git clone https://github.com/dexoron/dcr.git
# or a source mirror: GitVerse / SourceCraft / SourceForge / GitLab (see README)
cd dcr
cargo check
```

598
Cargo.lock generated
View File

@@ -2,98 +2,18 @@
# It is not intended for manual editing.
version = 4
[[package]]
name = "aho-corasick"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
dependencies = [
"memchr",
]
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
[[package]]
name = "anstyle-parse"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [
"anstyle",
"once_cell_polyfill",
"windows-sys 0.61.2",
]
[[package]]
name = "anyhow"
version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
[[package]]
name = "autocfg"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]]
name = "base64"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.11.1"
@@ -118,28 +38,6 @@ dependencies = [
"objc2",
]
[[package]]
name = "bumpalo"
version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8"
dependencies = [
"find-msvc-tools",
"shlex",
]
[[package]]
name = "cfg-if"
version = "1.0.4"
@@ -152,25 +50,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chrono"
version = "0.4.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
dependencies = [
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-link",
]
[[package]]
name = "colorchoice"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
[[package]]
name = "core-foundation"
version = "0.9.4"
@@ -219,54 +98,18 @@ dependencies = [
[[package]]
name = "dcr"
version = "0.9.1"
version = "0.7.4"
dependencies = [
"ctrlc",
"env_logger",
"fatfs",
"glob",
"log",
"owo-colors",
"self-replace",
"serde",
"serde_json",
"sha2",
"toml",
"toml_edit",
"ureq",
]
[[package]]
name = "defmt"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1"
dependencies = [
"bitflags 1.3.2",
"defmt-macros",
]
[[package]]
name = "defmt-macros"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8"
dependencies = [
"defmt-parser",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "defmt-parser"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
dependencies = [
"thiserror",
]
[[package]]
name = "digest"
version = "0.10.7"
@@ -283,7 +126,7 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
dependencies = [
"bitflags 2.11.1",
"bitflags",
"block2",
"libc",
"objc2",
@@ -297,30 +140,7 @@ checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "env_filter"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217"
dependencies = [
"log",
"regex",
]
[[package]]
name = "env_logger"
version = "0.11.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6"
dependencies = [
"anstream",
"anstyle",
"env_filter",
"jiff",
"log",
"syn",
]
[[package]]
@@ -345,24 +165,6 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
[[package]]
name = "fatfs"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05669f8e7e2d7badc545c513710f0eba09c2fbef683eb859fd79c46c355048e0"
dependencies = [
"bitflags 1.3.2",
"byteorder",
"chrono",
"log",
]
[[package]]
name = "find-msvc-tools"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
[[package]]
name = "foldhash"
version = "0.1.5"
@@ -378,30 +180,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "futures-core"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7"
[[package]]
name = "futures-task"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109"
[[package]]
name = "futures-util"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa"
dependencies = [
"futures-core",
"futures-task",
"pin-project-lite",
"slab",
]
[[package]]
name = "generic-array"
version = "0.14.7"
@@ -452,30 +230,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "iana-time-zone"
version = "0.1.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"log",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "icu_collections"
version = "2.2.0"
@@ -597,65 +351,12 @@ dependencies = [
"serde_core",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "itoa"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "jiff"
version = "0.2.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "668b7183bd07af9a4885f5c35b0cc5c83c4607a913c16b7e17291832910d2dcc"
dependencies = [
"defmt",
"jiff-core",
"jiff-static",
"log",
"portable-atomic",
"portable-atomic-util",
"serde_core",
]
[[package]]
name = "jiff-core"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7feca88439efe53da3754500c1851dedf3cb36c524dd5cf8225cc0794de95d09"
dependencies = [
"defmt",
]
[[package]]
name = "jiff-static"
version = "0.2.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a69dcb3a21cfb32ce1cd056169337ca284af0766dd766e7878819b251a49204"
dependencies = [
"jiff-core",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "js-sys"
version = "0.3.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"
dependencies = [
"cfg-if",
"futures-util",
"wasm-bindgen",
]
[[package]]
name = "leb128fmt"
version = "0.1.0"
@@ -682,9 +383,9 @@ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
[[package]]
name = "log"
version = "0.4.34"
version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5"
[[package]]
name = "memchr"
@@ -698,21 +399,12 @@ version = "0.31.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
dependencies = [
"bitflags 2.11.1",
"bitflags",
"cfg-if",
"cfg_aliases",
"libc",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "objc2"
version = "0.6.4"
@@ -734,51 +426,18 @@ version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]]
name = "once_cell_polyfill"
version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
name = "openssl-probe"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "owo-colors"
version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c45bb4a6ae1280ec0803b1ef9d3455eb50f01efbbe1447ab020f1d54fba9d8"
[[package]]
name = "percent-encoding"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "pin-project-lite"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "portable-atomic"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
[[package]]
name = "portable-atomic-util"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
dependencies = [
"portable-atomic",
]
[[package]]
name = "potential_utf"
version = "0.1.5"
@@ -795,7 +454,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn 2.0.117",
"syn",
]
[[package]]
@@ -822,42 +481,13 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "regex"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "rustix"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
"bitflags 2.11.1",
"bitflags",
"errno",
"libc",
"linux-raw-sys",
@@ -895,12 +525,6 @@ dependencies = [
"zeroize",
]
[[package]]
name = "rustversion"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
[[package]]
name = "schannel"
version = "0.1.29"
@@ -916,7 +540,7 @@ version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
"bitflags 2.11.1",
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
@@ -977,7 +601,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
"syn",
]
[[package]]
@@ -1013,18 +637,6 @@ dependencies = [
"digest",
]
[[package]]
name = "shlex"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
[[package]]
name = "slab"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "smallvec"
version = "1.15.1"
@@ -1048,17 +660,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "syn"
version = "3.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "synstructure"
version = "0.13.2"
@@ -1067,7 +668,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
"syn",
]
[[package]]
@@ -1083,26 +684,6 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "thiserror"
version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.5",
]
[[package]]
name = "tinystr"
version = "0.8.3"
@@ -1122,18 +703,12 @@ dependencies = [
"indexmap",
"serde_core",
"serde_spanned",
"toml_datetime 1.1.1+spec-1.1.0",
"toml_datetime",
"toml_parser",
"toml_writer",
"winnow 1.0.3",
"winnow",
]
[[package]]
name = "toml_datetime"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
[[package]]
name = "toml_datetime"
version = "1.1.1+spec-1.1.0"
@@ -1143,33 +718,15 @@ dependencies = [
"serde_core",
]
[[package]]
name = "toml_edit"
version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
"indexmap",
"toml_datetime 0.6.11",
"toml_write",
"winnow 0.7.15",
]
[[package]]
name = "toml_parser"
version = "1.1.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
dependencies = [
"winnow 1.0.3",
"winnow",
]
[[package]]
name = "toml_write"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
[[package]]
name = "toml_writer"
version = "1.1.1+spec-1.1.0"
@@ -1227,12 +784,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "version_check"
version = "0.9.5"
@@ -1257,51 +808,6 @@ dependencies = [
"wit-bindgen 0.51.0",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn 2.0.117",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"
dependencies = [
"unicode-ident",
]
[[package]]
name = "wasm-encoder"
version = "0.244.0"
@@ -1330,71 +836,18 @@ version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
dependencies = [
"bitflags 2.11.1",
"bitflags",
"hashbrown 0.15.5",
"indexmap",
"semver",
]
[[package]]
name = "windows-core"
version = "0.62.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link",
"windows-result",
"windows-strings",
]
[[package]]
name = "windows-implement"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "windows-interface"
version = "0.59.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-result"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-strings"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
@@ -1477,15 +930,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
dependencies = [
"memchr",
]
[[package]]
name = "winnow"
version = "1.0.3"
@@ -1528,7 +972,7 @@ dependencies = [
"heck",
"indexmap",
"prettyplease",
"syn 2.0.117",
"syn",
"wasm-metadata",
"wit-bindgen-core",
"wit-component",
@@ -1544,7 +988,7 @@ dependencies = [
"prettyplease",
"proc-macro2",
"quote",
"syn 2.0.117",
"syn",
"wit-bindgen-core",
"wit-bindgen-rust",
]
@@ -1556,7 +1000,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
dependencies = [
"anyhow",
"bitflags 2.11.1",
"bitflags",
"indexmap",
"log",
"serde",
@@ -1611,7 +1055,7 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
"syn",
"synstructure",
]
@@ -1632,7 +1076,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
"syn",
"synstructure",
]
@@ -1672,7 +1116,7 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
"syn",
]
[[package]]

View File

@@ -1,6 +1,6 @@
[package]
name = "dcr"
version = "0.9.1"
version = "0.7.4"
edition = "2024"
build = "build.rs"
description = "DCR is a utility for managing C/C++ projects in a Cargo-like style."
@@ -59,10 +59,6 @@ assets = [
{ source = "man/man1/dcr-tree.1", dest = "/usr/share/man/man1/dcr-tree.1", mode = "644" },
]
[features]
default = []
archive = ["dep:fatfs"]
[dependencies]
glob = "0.3"
ureq = { version = "2.10", default-features = false, features = ["json", "native-certs"] }
@@ -70,15 +66,8 @@ serde = { version = "1", features = ["derive"] }
self-replace = "1"
sha2 = "0.10"
toml = "1.0.3"
toml_edit = "0.22"
serde_json = "1"
ctrlc = "3"
fatfs = { version = "0.3", optional = true }
# Logging
log = "0.4.34"
env_logger = "0.11.11"
owo-colors = "4"
[profile.release]
opt-level = "z"
@@ -93,13 +82,4 @@ opt-level = 1
lto = false
codegen-units = 16
panic = "abort"
strip = true
[profile.dev]
incremental = false
opt-level = 0
debug = "line-tables-only"
[profile.dev.package."*"]
opt-level = 1
debug = false
strip = true

11
FAQ.md
View File

@@ -61,19 +61,8 @@ Available installation methods may vary by project version.
Recommended path:
- check instructions in `README.md`;
- use `dcrup install stable` (default mirror chain: **cf → gh → sf → ya**);
- pin a host with `--mirror cf|gh|sf|ya` or `DCRUP_MIRROR` if needed;
- if there is no prebuilt package for your platform, build from source using `cargo build --release`.
## How do I choose a download mirror?
`dcrup` defaults to `--mirror auto`: CloudFlare CDN, then GitHub, then SourceForge, then Yandex CDN.
```sh
dcrup install stable --mirror cf
export DCRUP_MIRROR=ya
```
## How can I get started quickly?
Minimal workflow:

View File

@@ -34,15 +34,38 @@
<table>
<tr>
<td><b>Linux (Dexoron Packages)</b></td>
<td>
See https://pkg.dexoron.su for settings youre packages manager
**Arch Linux:**
```sh
sudo pacman -Sy dcr
```
**Debian/Ubuntu:**
```sh
sudo apt update && sudo apt install dcr
```
**Fedora/RHEL:**
```sh
sudo dnf install dcr
```
</td>
</tr>
<tr>
<td><b>Arch Linux (AUR)</b></td>
<td>
```sh
yay -S dcr
# or
paru -S dcr
```
> 💡 Do you like DCR? Vote for the package on the [AUR](https://aur.archlinux.org/packages/dcr) page—it will help the project get into the official "extra" repository!
</td>
</tr>
@@ -80,32 +103,21 @@ cargo install dcr
</td>
</tr>
<tr>
<td><b>dcrup (Linux / macOS / BSD / Windows(Bash))</b></td>
<td><b>Linux / macOS (script)</b></td>
<td>
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable # auto: cf → gh → sf → ya
# dcrup install stable --mirror cf # CloudFlare CDN
# dcrup install stable --mirror ya # Yandex CDN (RU)
curl -fsSL https://dcr.dexoron.su/install.sh | sh
```
</td>
</tr>
<tr>
<td><b>dcrup (Windows PowerShell)</b></td>
<td><b>BSD (script)</b></td>
<td>
```powershell
irm https://ps1.dcr-tool.ru | iex
# or:
# irm https://ps1.dcr-tool.ru -OutFile dcrup.ps1
# powershell -File .\dcrup.ps1 self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable # auto: cf → gh → sf → ya
# dcrup install stable --mirror cf # CloudFlare CDN
# dcrup install stable --mirror ya # Yandex CDN (RU)
```sh
curl -fsSL https://dcr.dexoron.su/install_bsd.sh | sh
```
</td>
@@ -121,6 +133,16 @@ dcrup install stable # auto: cf → gh → sf → ya
sudo snap install --classic --dangerous dcrup_*.snap
```
</td>
</tr>
<tr>
<td><b>Windows (PowerShell)</b></td>
<td>
```powershell
irm https://dcr.dexoron.su/install.ps1 | iex
```
</td>
</tr>
<tr>
@@ -129,7 +151,7 @@ sudo snap install --classic --dangerous dcrup_*.snap
```sh
git clone https://github.com/dexoron/dcr.git
cd dcr && cargo build --release --features archive
cd dcr && cargo build --release
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
```
@@ -223,41 +245,6 @@ Full docs at **[dcr.dexoron.su](https://dcr.dexoron.su)** or in the [`docs/`](do
---
## Repository Mirrors
The primary repository is hosted on GitHub. Source and release mirrors:
| Region | Mirror | Contents |
|---|---|---|
| Worldwide | [GitHub](https://github.com/dexoron/dcr) | Source code and releases |
| Worldwide | [SourceForge](https://sourceforge.net/projects/dcr-tool/) | Source code and releases |
| Russia | [GitVerse](https://gitverse.ru/dcr_labs/dcr) | Source code |
| Russia | [SourceCraft](https://sourcecraft.dev/dexoron-dev/dcr) | Source code |
Release CDN (used by `dcrup`):
| Code | Host | Role |
|---|---|---|
| `cf` | [cdn-global.dcr-tool.ru](https://cdn-global.dcr-tool.ru) (CloudFlare) | Worldwide CDN |
| `gh` | GitHub Releases | Primary host |
| `sf` | SourceForge | Worldwide fallback |
| `ya` | [cdn-ru.dcr-tool.ru](https://cdn-ru.dcr-tool.ru) (Yandex) | Paid RU fallback for restrictions |
`dcrup install` defaults to `--mirror auto` and tries **cf → gh → sf → ya**. Override with `--mirror cf|gh|sf|ya` or `DCRUP_MIRROR`.
---
## VS Code Extension
Install the recommended [DCR extension by Dexoron-Labs](https://marketplace.visualstudio.com/items?itemName=Dexoron-Labs.dcr) for VS Code. Do not install Microsoft C/C++ extensions for DCR projects; DCR uses `clangd` instead. If you need debugging with Microsoft's debugger, use MS C/C++ only for its debugger component.
Recommended companion extensions:
- [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)
- [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb), or MS C/C++ for debugger support only
---
## Contributors
<div align="center">

65
TODO.md Normal file
View File

@@ -0,0 +1,65 @@
# DCR TODO.md
Priority list of tasks to turn DCR into a true Cargo killer for C/C++ developers.
**Legend:** `[ ]` — not implemented | `[-]` — partially implemented | `[x]` — implemented
## 🔥 High Priority
- [ ] **CLI Output Refactoring & Cleanup**
- [ ] Move all terminal strings to a dedicated module (`src/ui/messages.rs`)
- [ ] Standardize logging formats (`error:`, `warning:`, `status:`)
- [x] Add build execution time statistics to the final output (e.g., `Finished in 4.23s`)
- [ ] **Internationalization (i18n) / Localization**
- [ ] Integrate a lightweight localization engine (`fluent` or `gettext` pure-Rust port)
- [ ] Create initial translation catalogs (`en.ftl`, `ru.ftl`)
- [x] **Self-Update Stability Validation**
- [x] Self-update implemented via `self-replace` + `ureq` in `flag_update.rs`
- [-] **Freestanding / Embedded Automation**
- *`-ffreestanding` injected at compile time, `-nostdlib -static` at link time for bare-metal targets or `build.freestanding = true`. Config option `build.freestanding` (bool) added.*
- [ ] **Conan and vcpkg integration** Automatic download, installation and linking of packages
## ✅ Medium Priority
- [ ] **Static analysis** (`dcr check`)
Integration with clang-tidy, cppcheck, include-what-you-use
- [-] **Linter + Formatter** (`dcr fmt`, `dcr lint`)
*`dcr fmt` (clang-format) implemented; `dcr lint` does not exist yet*
- [ ] **Hot reload / Live reload** for applications (raylib, SFML, SDL, etc.)
- [-] **Workspaces improvements** Per-member include directories, selective builds, better dependency graph
*Basic workspaces with dep ordering + topological sort work; advanced features missing*
- [-] **Build-time code generation** Support for protobuf, flatbuffers, Qt moc, custom generators
*Generic `build.steps` machinery + Qt toolchain (uic/moc/rcc) work; no dedicated protobuf/flatbuffers generators*
- [-] **dcr publish + official package registry** *Registry consumption (fetch, resolve, link) works; `dcr publish` command / local packing missing*
## 📌 Low Priority / Nice to Have
- [ ] Support for Meson and Ninja as alternative backends
- [ ] Dockerfile generation (`dcr docker init`)
- [ ] First-class Windows MSVC support (currently works but rough)
- [ ] Documentation generation (`dcr doc`)
- [ ] Sanitizers integration (`dcr sanitize`)
- [ ] Benchmarks and comparison with CMake/Meson
- [ ] C++20 modules support (when it becomes stable)
## 🧠 Future Ideas
- Official DCR package registry (dcrhub)
- GUI wrapper (dcr-gui)
- Plugin system
- Toolchain manager (like rustup)
- Zig as alternative compiler
- deb/rpm/flatpak/AppImage packaging support
---
**Currently in progress:**
- UI/UX terminal output unification and benchmarking metrics.
**Completed in recent releases:**
- Extreme binary size optimization (-50% weight reduction via `ureq` + `native-certs`)
- Complete removal of `git2` and `openssl` in favor of system Git execution
- Workspaces & Cross-compilation (`--target <triple>`)
- IDE config generation (VS Code, CLion, compile_commands.json)
- EFI support & Linker script support (`build.ldscript`)
- Mixed C/C++/ASM compilation with custom `std::thread::scope` work-stealing engine

471
dcrup.ps1
View File

@@ -1,471 +0,0 @@
#Requires -Version 5.1
$ErrorActionPreference = 'Stop'
$DcrupHome = if ($env:DCRUP_HOME) { $env:DCRUP_HOME } else { Join-Path $env:USERPROFILE '.dcr' }
$DcrupBin = if ($env:DCRUP_BIN) { $env:DCRUP_BIN } else { Join-Path $DcrupHome 'bin' }
$DcrupTc = Join-Path $DcrupHome 'toolchains'
$DcrupMeta = Join-Path $DcrupHome 'meta'
$RepoUrl = if ($env:DCRUP_REPO) { $env:DCRUP_REPO } else { 'https://github.com/dexoron/dcr' }
$InstallUrl = if ($env:DCRUP_INSTALL_URL) { $env:DCRUP_INSTALL_URL } else { 'https://ps1.dcr-tool.ru' }
$DcrupMirror = if ($env:DCRUP_MIRROR) { $env:DCRUP_MIRROR } else { 'auto' }
$ApiLatest = 'https://api.github.com/repos/dexoron/dcr/releases/latest'
$ApiAll = 'https://api.github.com/repos/dexoron/dcr/releases'
$Features = if ($env:DCR_FEATURES) { $env:DCR_FEATURES } else { 'archive' }
function Info($m) { Write-Host "[dcrup] $m" -ForegroundColor Cyan }
function Ok($m) { Write-Host "[ok] $m" -ForegroundColor Green }
function Warn($m) { Write-Host "[warn] $m" -ForegroundColor Yellow }
function Die($m) { Write-Host "[error] $m" -ForegroundColor Red; exit 1 }
function Show-Usage {
@'
dcrup — install and switch DCR versions (Windows)
Usage:
dcrup install <spec> [--build|--release] [--force] [--mirror auto|cf|gh|sf|ya]
dcrup default <spec>
dcrup update
dcrup list
dcrup show
dcrup which
dcrup uninstall [<spec>|--all]
dcrup self-install [--to DIR]
dcrup help
Spec:
stable | dev | night
VERSION → VERSION@stable (e.g. 0.8.2)
VERSION@stable
VERSION@dev
night → always build from branch "dev" HEAD
Modes:
--release download prebuilt binary (default for stable/dev)
--build cargo build --release --features archive
night always --build (prebuilt not available)
Mirrors (prebuilt download only):
--mirror auto try cf → gh → sf → ya, first successful download wins (default)
--mirror cf download from cdn-global.dcr-tool.ru
--mirror gh download from github.com/dexoron/dcr
--mirror sf download from sourceforge.net/projects/dcr-tool
--mirror ya download from cdn-ru.dcr-tool.ru
DCRUP_MIRROR env override (default: auto)
Env:
DCRUP_HOME default ~/.dcr
DCRUP_BIN default $DCRUP_HOME/bin
DCR_FEATURES default archive
DCRUP_REPO git/GitHub repo URL
DCRUP_MIRROR auto|cf|gh|sf|ya (default: auto)
'@ | Write-Host
}
function Ensure-Dirs {
New-Item -ItemType Directory -Force -Path $DcrupTc, $DcrupBin, $DcrupMeta | Out-Null
}
function Get-Target {
$arch = $env:PROCESSOR_ARCHITECTURE
if ($env:PROCESSOR_ARCHITEW6432) { $arch = $env:PROCESSOR_ARCHITEW6432 }
switch ($arch) {
'AMD64' { return 'x86_64-pc-windows-msvc' }
'ARM64' { return 'aarch64-pc-windows-msvc' }
'x86' { return 'i686-pc-windows-msvc' }
default { Die "unsupported arch: $arch" }
}
}
function Normalize-Version([string]$v) {
if ($v.StartsWith('v')) { return $v.Substring(1) }
return $v
}
function Parse-Spec([string]$raw) {
$script:SpecRaw = $raw
$script:SpecChannel = $null
$script:SpecVersion = $null
$script:SpecFloating = $false
if ($raw -in @('stable', 'dev', 'night')) {
$script:SpecChannel = $raw
$script:SpecFloating = $true
return
}
if ($raw -match '^(.*)@(.*)$') {
$script:SpecVersion = Normalize-Version $Matches[1]
$script:SpecChannel = $Matches[2]
if ($script:SpecChannel -eq 'night') { Die 'cannot pin version on night' }
if ($script:SpecChannel -notin @('stable', 'dev')) { Die "unknown channel: $($script:SpecChannel)" }
return
}
$script:SpecVersion = Normalize-Version $raw
$script:SpecChannel = 'stable'
}
function Toolchain-Id([string]$extra = '') {
if ($script:SpecChannel -eq 'night') {
return "night-$extra"
}
if ($script:SpecFloating) {
return "$($script:SpecChannel)-$extra"
}
return "$($script:SpecVersion)-$($script:SpecChannel)"
}
function Active-Path { Join-Path $DcrupMeta 'active' }
function Read-Active {
$p = Active-Path
if (Test-Path $p) { return (Get-Content $p -Raw).Trim() }
return $null
}
function Write-Active([string]$id) {
Set-Content -Path (Active-Path) -Value $id -NoNewline
}
function Link-Default([string]$id) {
$src = Join-Path (Join-Path $DcrupTc $id) 'dcr.exe'
if (-not (Test-Path $src)) { Die "toolchain not installed: $id" }
$dst = Join-Path $DcrupBin 'dcr.exe'
Copy-Item $src $dst -Force
Write-Active $id
Ok "default → $id ($dst)"
}
function Resolve-InstalledId([string]$spec) {
Parse-Spec $spec
if ($script:SpecChannel -eq 'night' -or $script:SpecFloating) {
$item = Get-ChildItem $DcrupTc -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -like "$($script:SpecChannel)-*" } |
Sort-Object Name | Select-Object -Last 1
if ($item) { return $item.Name }
return $null
}
return (Toolchain-Id)
}
function Set-Mirror([string]$value) {
if ($value -notin @('auto', 'cf', 'gh', 'sf', 'ya')) {
Die "invalid --mirror: $value (use auto|cf|gh|sf|ya)"
}
$script:DcrupMirror = $value
}
function Get-MirrorUrl([string]$mirror, [string]$tag, [string]$asset) {
switch ($mirror) {
'cf' { return "https://cdn-global.dcr-tool.ru/$tag/$asset" }
'gh' { return "https://github.com/dexoron/dcr/releases/download/$tag/$asset" }
'sf' { return "https://sourceforge.net/projects/dcr-tool/files/$tag/$asset/download" }
'ya' { return "https://cdn-ru.dcr-tool.ru/$tag/$asset" }
default { Die "invalid mirror: $mirror" }
}
}
function Get-MirrorsToTry {
switch ($script:DcrupMirror) {
'auto' { return @('cf', 'gh', 'sf', 'ya') }
{ $_ -in @('cf', 'gh', 'sf', 'ya') } { return @($script:DcrupMirror) }
default { Die "invalid mirror: $($script:DcrupMirror) (use auto|cf|gh|sf|ya)" }
}
}
function Download-FromMirrors([string]$tag, [string]$asset, [string]$destFile) {
$tmp = "$destFile.download"
foreach ($m in (Get-MirrorsToTry)) {
$url = Get-MirrorUrl $m $tag $asset
Info "trying mirror $m …"
Remove-Item $tmp -ErrorAction SilentlyContinue
try {
Invoke-WebRequest -Uri $url -OutFile $tmp -UserAgent 'dcrup'
$size = (Get-Item $tmp).Length
if ($size -gt 100000) {
Move-Item $tmp $destFile -Force
return $m
}
Warn "mirror $m returned a too-small file ($size bytes)"
} catch {
Warn "mirror $m failed"
}
Remove-Item $tmp -ErrorAction SilentlyContinue
}
return $null
}
function Fetch-Release($channel, $version) {
if ($version) {
return Invoke-RestMethod -Uri "https://api.github.com/repos/dexoron/dcr/releases/tags/v$version"
}
if ($channel -eq 'dev') {
$all = Invoke-RestMethod -Uri $ApiAll
$pre = $all | Where-Object { $_.prerelease } | Select-Object -First 1
if (-not $pre) { Die 'no prerelease (dev) found' }
return $pre
}
return Invoke-RestMethod -Uri $ApiLatest
}
function Install-Prebuilt([switch]$Force) {
$triple = Get-Target
$rel = Fetch-Release $script:SpecChannel $script:SpecVersion
$tag = $rel.tag_name
$ver = Normalize-Version $tag
$assetName = "dcr-$triple-$ver.exe"
$id = if ($script:SpecFloating) { Toolchain-Id $ver } else { Toolchain-Id }
$dest = Join-Path $DcrupTc $id
$bin = Join-Path $dest 'dcr.exe'
if ((Test-Path $bin) -and -not $Force) {
Ok "already installed: $id"
Link-Default $id
return
}
Ensure-Dirs
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Info "downloading $assetName (mirror=$($script:DcrupMirror)) …"
$mirror = Download-FromMirrors $tag $assetName $bin
if (-not $mirror) { Die "no mirror reachable for $assetName (try: --mirror cf|gh|sf|ya)" }
Info "mirror → $mirror"
@"
channel=$($script:SpecChannel)
version=$ver
tag=$tag
source=release
triple=$triple
mirror=$mirror
"@ | Set-Content (Join-Path $dest 'dcrup-meta')
Ok "installed prebuilt $id ($triple via $mirror)"
Link-Default $id
}
function Install-Build([switch]$Force) {
if (-not (Get-Command git -ErrorAction SilentlyContinue)) { Die 'git not found' }
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) { Die 'cargo not found' }
$tmp = Join-Path $env:TEMP ("dcrup-" + [guid]::NewGuid().ToString('N'))
New-Item -ItemType Directory -Path $tmp | Out-Null
try {
$src = Join-Path $tmp 'src'
if ($script:SpecChannel -eq 'night') {
Info "cloning dev for night …"
git clone --depth 1 --branch dev $RepoUrl $src 2>$null
if ($LASTEXITCODE -ne 0) { git clone --depth 1 $RepoUrl $src | Out-Null }
$sha = (git -C $src rev-parse --short HEAD).Trim()
$id = Toolchain-Id $sha
$ver = 'night'
} elseif ($script:SpecFloating) {
$rel = Fetch-Release $script:SpecChannel $null
$tag = $rel.tag_name
$ver = Normalize-Version $tag
$id = Toolchain-Id $ver
Info "cloning $tag …"
git clone --depth 1 --branch $tag $RepoUrl $src 2>$null
if ($LASTEXITCODE -ne 0) {
git clone --depth 1 $RepoUrl $src | Out-Null
git -C $src fetch --depth 1 origin "refs/tags/${tag}:refs/tags/${tag}"
git -C $src checkout $tag
}
$sha = (git -C $src rev-parse --short HEAD).Trim()
} else {
$tag = "v$($script:SpecVersion)"
$ver = $script:SpecVersion
$id = Toolchain-Id
Info "cloning $tag …"
git clone --depth 1 --branch $tag $RepoUrl $src 2>$null
if ($LASTEXITCODE -ne 0) {
git clone --depth 1 $RepoUrl $src | Out-Null
git -C $src fetch --depth 1 origin "refs/tags/${tag}:refs/tags/${tag}"
git -C $src checkout $tag
}
$sha = (git -C $src rev-parse --short HEAD).Trim()
}
$dest = Join-Path $DcrupTc $id
$bin = Join-Path $dest 'dcr.exe'
if ((Test-Path $bin) -and -not $Force) {
Ok "already installed: $id"
Link-Default $id
return
}
$triple = Get-Target
Info "building release (features: $Features) …"
Push-Location $src
cargo build --release --features $Features --target $triple
if ($LASTEXITCODE -ne 0) { Die 'cargo build failed' }
Pop-Location
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Copy-Item (Join-Path $src "target\$triple\release\dcr.exe") $bin -Force
@"
channel=$($script:SpecChannel)
version=$ver
git=$sha
source=build
features=$Features
"@ | Set-Content (Join-Path $dest 'dcrup-meta')
Ok "installed build $id"
Link-Default $id
} finally {
Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue
}
}
function Ensure-UserPath {
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
if (-not $userPath) { $userPath = '' }
if (-not ($userPath -split ';' | Where-Object { $_ -eq $DcrupBin })) {
$new = if ($userPath) { "$userPath;$DcrupBin" } else { $DcrupBin }
[Environment]::SetEnvironmentVariable('Path', $new, 'User')
$env:Path = "$env:Path;$DcrupBin"
Warn "added to user PATH: $DcrupBin (restart shell if needed)"
}
}
function Install-CmdShim {
$cmd = Join-Path $DcrupBin 'dcrup.cmd'
$ps1 = Join-Path $DcrupBin 'dcrup.ps1'
@"
@echo off
setlocal
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0dcrup.ps1" %*
"@ | Set-Content -Path $cmd -Encoding ASCII
if (-not (Test-Path $ps1)) {
Copy-Item $PSCommandPath $ps1 -Force
}
}
function Cmd-Install {
param([string[]]$Args)
$mode = 'release'
$force = $false
$spec = $null
$i = 0
while ($i -lt $Args.Count) {
$a = $Args[$i]
switch -Regex ($a) {
'^--build$' { $mode = 'build' }
'^--release$' { $mode = 'release' }
'^--force$' { $force = $true }
'^--mirror$' {
if ($i + 1 -ge $Args.Count) { Die '--mirror needs auto|cf|gh|sf|ya' }
$i++
Set-Mirror $Args[$i]
}
'^--mirror=(.+)$' { Set-Mirror $Matches[1] }
'^-' { Die "unknown flag: $a" }
default {
if ($spec) { Die "unexpected: $a" }
$spec = $a
}
}
$i++
}
if (-not $spec) { Die 'usage: dcrup install <spec> [--build|--release] [--force] [--mirror auto|cf|gh|sf|ya]' }
Parse-Spec $spec
Ensure-Dirs
if ($script:SpecChannel -eq 'night') { $mode = 'build' }
Info "install spec=$spec channel=$($script:SpecChannel) mode=$mode mirror=$($script:DcrupMirror)"
if ($mode -eq 'build') { Install-Build -Force:$force } else { Install-Prebuilt -Force:$force }
Ensure-UserPath
Install-CmdShim
}
function Cmd-List {
Ensure-Dirs
$active = Read-Active
Get-ChildItem $DcrupTc -Directory -ErrorAction SilentlyContinue | ForEach-Object {
$mark = if ($_.Name -eq $active) { ' *' } else { ' ' }
Write-Host "$mark $($_.Name)"
}
}
function Cmd-Show {
Ensure-Dirs
Write-Host "DCRUP_HOME=$DcrupHome"
Write-Host "DCRUP_BIN=$DcrupBin"
Write-Host "active=$(Read-Active)"
$exe = Join-Path $DcrupBin 'dcr.exe'
if (Test-Path $exe) { & $exe --version }
}
function Cmd-SelfInstall {
Ensure-Dirs
if ([string]::IsNullOrWhiteSpace($PSCommandPath) -or -not (Test-Path $PSCommandPath)) {
# With `irm URL | iex`, PowerShell evaluates text and there is no
# source path. Download the canonical installer for self-install.
$tmp = Join-Path $env:TEMP ("dcrup-" + [guid]::NewGuid().ToString('N') + '.ps1')
try {
Invoke-WebRequest -Uri $InstallUrl -OutFile $tmp -UseBasicParsing -UserAgent 'dcrup'
Copy-Item $tmp (Join-Path $DcrupBin 'dcrup.ps1') -Force
} finally {
Remove-Item $tmp -Force -ErrorAction SilentlyContinue
}
} else {
Copy-Item $PSCommandPath (Join-Path $DcrupBin 'dcrup.ps1') -Force
}
Install-CmdShim
Ensure-UserPath
Ok "dcrup installed to $DcrupBin (use: dcrup …)"
}
$cmd = if ($args.Count -ge 1) { $args[0] } else { 'help' }
$rest = @()
if ($args.Count -gt 1) { $rest = $args[1..($args.Count - 1)] }
switch ($cmd) {
{ $_ -in @('help', '-h', '--help') } { Show-Usage }
'install' { Cmd-Install $rest }
'list' { Cmd-List }
'show' { Cmd-Show }
'which' {
$p = Join-Path $DcrupBin 'dcr.exe'
if (Test-Path $p) { $p } else { Die 'dcr not installed' }
}
'default' {
if ($rest.Count -ne 1) { Die 'usage: dcrup default <spec>' }
Parse-Spec $rest[0]
if ($script:SpecFloating -or $script:SpecChannel -eq 'night') {
$id = Get-ChildItem $DcrupTc -Directory |
Where-Object { $_.Name -like "$($script:SpecChannel)-*" } |
Sort-Object Name | Select-Object -Last 1
if (-not $id) { Die "not installed: $($rest[0])" }
Link-Default $id.Name
} else {
Link-Default (Toolchain-Id)
}
}
'update' {
$a = Read-Active
if (-not $a) { Die 'no active toolchain' }
if ($a -like 'night-*') { Cmd-Install @('night', '--build', '--force') }
elseif ($a -like 'stable-*') { Cmd-Install @('stable', '--force') }
elseif ($a -like 'dev-*') { Cmd-Install @('dev', '--force') }
else { Ok "pinned $a - install a newer version explicitly" }
}
'uninstall' {
if ($rest -contains '--all') {
Remove-Item -Recurse -Force $DcrupTc -ErrorAction SilentlyContinue
Remove-Item (Join-Path $DcrupBin 'dcr.exe') -ErrorAction SilentlyContinue
Remove-Item (Active-Path) -ErrorAction SilentlyContinue
Ok 'removed all'
} else {
if ($rest.Count -ne 1) { Die 'usage: dcrup uninstall <spec>|--all' }
$id = Resolve-InstalledId $rest[0]
if (-not $id) { Die "not installed: $($rest[0])" }
$dir = Join-Path $DcrupTc $id
if (-not (Test-Path $dir)) { Die "not installed: $($rest[0])" }
Remove-Item -Recurse -Force $dir
if ((Read-Active) -eq $id) {
Remove-Item (Join-Path $DcrupBin 'dcr.exe') -ErrorAction SilentlyContinue
Remove-Item (Active-Path) -ErrorAction SilentlyContinue
Warn 'removed active toolchain; install or select another default'
}
Ok "removed $id"
}
}
'self-install' { Cmd-SelfInstall }
default { Die "unknown command: $cmd" }
}

700
dcrup.sh
View File

@@ -1,700 +0,0 @@
#!/usr/bin/env bash
set -Eeuo pipefail
DCRUP_HOME="${DCRUP_HOME:-$HOME/.dcr}"
DCRUP_BIN="${DCRUP_BIN:-$DCRUP_HOME/bin}"
DCRUP_TC="${DCRUP_HOME}/toolchains"
DCRUP_META="${DCRUP_HOME}/meta"
REPO_URL="${DCRUP_REPO:-https://github.com/dexoron/dcr}"
DCRUP_INSTALL_URL="${DCRUP_INSTALL_URL:-https://sh.dcr-tool.ru}"
DCRUP_MIRROR="${DCRUP_MIRROR:-auto}"
API_LATEST="https://api.github.com/repos/dexoron/dcr/releases/latest"
API_ALL="https://api.github.com/repos/dexoron/dcr/releases"
FEATURES="${DCR_FEATURES:-archive}"
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'
log() { printf "${CYAN}[dcrup]${NC} %s\n" "$*"; }
ok() { printf "${GREEN}[ok]${NC} %s\n" "$*"; }
warn() { printf "${YELLOW}[warn]${NC} %s\n" "$*"; }
die() {
printf "${RED}[error]${NC} %s\n" "$*" >&2
exit 1
}
usage() {
cat <<'EOF'
dcrup — install and switch DCR versions
Usage:
dcrup install <spec> [--build|--release] [--force] [--libc gnu|musl|auto] [--mirror auto|cf|gh|sf|ya]
dcrup default <spec>
dcrup update
dcrup list
dcrup show
dcrup which
dcrup uninstall [<spec>|--all]
dcrup self-install [--to DIR]
dcrup help
Spec:
stable | dev | night
VERSION → VERSION@stable (e.g. 0.8.2)
VERSION@stable
VERSION@dev
night → always build from branch "dev" HEAD
Modes:
--release download prebuilt binary (default for stable/dev)
--build cargo build --release --features archive
night always --build (prebuilt not available)
Linux libc (prebuilt triple only):
--libc gnu x86_64-unknown-linux-gnu (default)
--libc musl x86_64-unknown-linux-musl
--libc auto musl if host ldd/libc is musl, else gnu
Mirrors (prebuilt download only):
--mirror auto try cf → gh → sf → ya, first successful download wins (default)
--mirror cf download from cdn-global.dcr-tool.ru
--mirror gh download from github.com/dexoron/dcr
--mirror sf download from sourceforge.net/projects/dcr-tool
--mirror ya download from cdn-ru.dcr-tool.ru
DCRUP_MIRROR env override (default: auto)
Env:
DCRUP_HOME default ~/.dcr
DCRUP_BIN default $DCRUP_HOME/bin
DCR_FEATURES default archive
DCRUP_REPO git/GitHub repo URL
DCRUP_LIBC gnu|musl|auto (default: gnu)
DCRUP_MIRROR auto|cf|gh|sf|ya (default: auto)
EOF
}
need_cmd() {
command -v "$1" >/dev/null 2>&1 || die "required command not found: $1"
}
detect_linux_libc() {
local pref="${DCRUP_LIBC:-gnu}"
case "$pref" in
gnu | glibc) echo "gnu" ;;
musl) echo "musl" ;;
auto)
if command -v ldd >/dev/null 2>&1; then
if ldd --version 2>&1 | grep -qi musl; then
echo "musl"
return 0
fi
fi
if [[ -e /lib/ld-musl-x86_64.so.1 || -e /lib/ld-musl-aarch64.so.1 ]]; then
echo "musl"
return 0
fi
if command -v getconf >/dev/null 2>&1 && getconf GNU_LIBC_VERSION >/dev/null 2>&1; then
echo "gnu"
return 0
fi
echo "gnu"
;;
*) die "invalid DCRUP_LIBC / --libc: $pref (use gnu|musl|auto)" ;;
esac
}
detect_triple() {
local os arch libc
os="$(uname -s)"
arch="$(uname -m)"
case "$os:$arch" in
Linux:x86_64)
libc="$(detect_linux_libc)"
if [[ "$libc" == "musl" ]]; then
echo "x86_64-unknown-linux-musl"
else
echo "x86_64-unknown-linux-gnu"
fi
;;
Linux:aarch64 | Linux:arm64)
libc="$(detect_linux_libc)"
if [[ "$libc" == "musl" ]]; then
echo "aarch64-unknown-linux-musl"
else
echo "aarch64-unknown-linux-gnu"
fi
;;
Linux:i686 | Linux:i386)
libc="$(detect_linux_libc)"
if [[ "$libc" == "musl" ]]; then
echo "i686-unknown-linux-musl"
else
echo "i686-unknown-linux-gnu"
fi
;;
Linux:armv7l | Linux:armv7)
libc="$(detect_linux_libc)"
if [[ "$libc" == "musl" ]]; then
echo "armv7-unknown-linux-musleabihf"
else
echo "armv7-unknown-linux-gnueabihf"
fi
;;
Linux:riscv64)
libc="$(detect_linux_libc)"
if [[ "$libc" == "musl" ]]; then
echo "riscv64gc-unknown-linux-musl"
else
echo "riscv64gc-unknown-linux-gnu"
fi
;;
Darwin:x86_64) echo "x86_64-apple-darwin" ;;
Darwin:arm64 | Darwin:aarch64) echo "aarch64-apple-darwin" ;;
FreeBSD:x86_64 | FreeBSD:amd64) echo "x86_64-unknown-freebsd" ;;
FreeBSD:aarch64 | FreeBSD:arm64) echo "aarch64-unknown-freebsd" ;;
OpenBSD:x86_64 | OpenBSD:amd64) echo "x86_64-unknown-openbsd" ;;
NetBSD:x86_64 | NetBSD:amd64) echo "x86_64-unknown-netbsd" ;;
MINGW* | MSYS* | CYGWIN*)
case "$arch" in
x86_64 | amd64) echo "x86_64-pc-windows-gnu" ;;
aarch64 | arm64) echo "aarch64-pc-windows-gnullvm" ;;
i686 | i386) echo "i686-pc-windows-gnu" ;;
*) die "unsupported Windows arch under MSYS: $arch" ;;
esac
;;
*) die "unsupported platform: $os/$arch" ;;
esac
}
normalize_version() {
local v="$1"
v="${v#v}"
printf '%s' "$v"
}
parse_spec() {
local raw="$1"
SPEC_RAW="$raw"
SPEC_CHANNEL=""
SPEC_VERSION=""
SPEC_FLOATING=0
case "$raw" in
"") die "missing version/channel spec" ;;
stable | dev | night)
SPEC_CHANNEL="$raw"
SPEC_VERSION=""
SPEC_FLOATING=1
;;
*@*)
SPEC_VERSION="$(normalize_version "${raw%@*}")"
SPEC_CHANNEL="${raw#*@}"
case "$SPEC_CHANNEL" in
stable | dev) ;;
night) die "cannot pin a version on night (use: dcrup install night)" ;;
*) die "unknown channel in spec: $SPEC_CHANNEL (use stable|dev)" ;;
esac
[[ -n "$SPEC_VERSION" ]] || die "empty version in spec: $raw"
;;
*)
SPEC_VERSION="$(normalize_version "$raw")"
SPEC_CHANNEL="stable"
[[ -n "$SPEC_VERSION" ]] || die "invalid spec: $raw"
;;
esac
}
toolchain_id() {
if [[ "$SPEC_CHANNEL" == "night" ]]; then
local sha="${1:-unknown}"
echo "night-${sha}"
elif [[ "$SPEC_FLOATING" -eq 1 ]]; then
local ver="${1:-latest}"
echo "${SPEC_CHANNEL}-${ver}"
else
echo "${SPEC_VERSION}-${SPEC_CHANNEL}"
fi
}
ensure_dirs() {
mkdir -p "$DCRUP_TC" "$DCRUP_BIN" "$DCRUP_META"
}
active_file() { echo "$DCRUP_META/active"; }
read_active() {
if [[ -f "$(active_file)" ]]; then
cat "$(active_file)"
fi
}
write_active() {
printf '%s\n' "$1" >"$(active_file)"
}
link_default() {
local id="$1"
local src="$DCRUP_TC/$id/dcr"
[[ -x "$src" ]] || die "toolchain not installed: $id"
# Resolve the source so a relative DCRUP_HOME cannot create a broken link.
src="$(cd "$(dirname "$src")" && pwd)/$(basename "$src")"
ln -sfn "$src" "$DCRUP_BIN/dcr"
write_active "$id"
ok "default → $id ($DCRUP_BIN/dcr)"
}
fetch_json() {
need_cmd curl
curl -fsSL "$1"
}
json_tag() {
printf '%s' "$1" | sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n1
}
set_mirror() {
case "$1" in
auto | cf | gh | sf | ya) DCRUP_MIRROR="$1" ;;
*) die "invalid --mirror: $1 (use auto|cf|gh|sf|ya)" ;;
esac
}
mirror_url() {
local mirror="$1" tag="$2" asset="$3"
case "$mirror" in
cf) printf 'https://cdn-global.dcr-tool.ru/%s/%s' "$tag" "$asset" ;;
gh) printf 'https://github.com/dexoron/dcr/releases/download/%s/%s' "$tag" "$asset" ;;
sf) printf 'https://sourceforge.net/projects/dcr-tool/files/%s/%s/download' "$tag" "$asset" ;;
ya) printf 'https://cdn-ru.dcr-tool.ru/%s/%s' "$tag" "$asset" ;;
*) return 1 ;;
esac
}
mirror_chain() { echo "cf gh sf ya"; }
mirrors_to_try() {
case "$DCRUP_MIRROR" in
auto) mirror_chain ;;
cf | gh | sf | ya) echo "$DCRUP_MIRROR" ;;
*) die "invalid mirror: $DCRUP_MIRROR (use auto|cf|gh|sf|ya)" ;;
esac
}
download_from_mirrors() {
local tag="$1" asset="$2" dest="$3"
local tmp="$dest/dcr.download" m url size
USED_MIRROR=""
for m in $(mirrors_to_try); do
url="$(mirror_url "$m" "$tag" "$asset")"
log "trying mirror $m …"
rm -f "$tmp"
if curl -fL --retry 2 --retry-delay 1 --connect-timeout 10 --max-time 180 \
-A "dcrup" "$url" -o "$tmp"; then
size="$(wc -c <"$tmp" | tr -d ' ')"
if [[ "${size:-0}" -gt 100000 ]]; then
mv "$tmp" "$dest/dcr"
USED_MIRROR="$m"
return 0
fi
warn "mirror $m returned a too-small file (${size:-0} bytes)"
else
warn "mirror $m failed"
fi
rm -f "$tmp"
done
return 1
}
latest_stable_json() {
fetch_json "$API_LATEST"
}
latest_dev_json() {
need_cmd curl
local json result
json="$(fetch_json "$API_ALL")"
if command -v jq >/dev/null 2>&1; then
result="$(printf '%s' "$json" | jq -e -c '[.[] | select(.prerelease == true)][0]')" || true
elif command -v python3 >/dev/null 2>&1; then
result="$(printf '%s' "$json" | python3 -c '
import sys, json
rels = json.load(sys.stdin)
pre = [r for r in rels if r.get("prerelease")]
print(json.dumps(pre[0]) if pre else "", end="")
')"
else
die "dev channel needs jq or python3 to parse GitHub API"
fi
[[ -n "$result" && "$result" != "null" ]] || die "no prerelease (dev) found"
printf '%s' "$result"
}
release_json_for_spec() {
if [[ "$SPEC_FLOATING" -eq 1 ]]; then
case "$SPEC_CHANNEL" in
stable) latest_stable_json ;;
dev) latest_dev_json ;;
night) die "night has no GitHub release binary" ;;
esac
else
fetch_json "https://api.github.com/repos/dexoron/dcr/releases/tags/v${SPEC_VERSION}"
fi
}
install_prebuilt() {
local triple asset tag version id dest mirror
need_cmd curl
triple="$(detect_triple)"
json="$(release_json_for_spec)"
tag="$(json_tag "$json")"
[[ -n "$tag" ]] || die "failed to parse release tag"
version="$(normalize_version "$tag")"
asset="dcr-${triple}-${version}"
case "$triple" in
*windows*) asset="${asset}.exe" ;;
esac
id="$(toolchain_id "$version")"
dest="$DCRUP_TC/$id"
if [[ -x "$dest/dcr" && "${FORCE:-0}" != "1" ]]; then
ok "already installed: $id"
link_default "$id"
return 0
fi
mkdir -p "$dest"
log "downloading $asset (mirror=$DCRUP_MIRROR) …"
download_from_mirrors "$tag" "$asset" "$dest" ||
die "no mirror reachable for $asset (try: --mirror cf|gh|sf|ya)"
mirror="$USED_MIRROR"
log "mirror → $mirror"
chmod +x "$dest/dcr"
printf '%s\n' \
"channel=$SPEC_CHANNEL" \
"version=$version" \
"tag=$tag" \
"source=release" \
"triple=$triple" \
"mirror=$mirror" \
"libc=${DCRUP_LIBC:-gnu}" \
>"$dest/dcrup-meta"
ok "installed prebuilt $id ($triple via $mirror)"
link_default "$id"
}
install_build() {
local tmp id dest sha version branch_or_tag
need_cmd git
need_cmd cargo
tmp="$(mktemp -d "${TMPDIR:-/tmp}/dcrup.XXXXXX")"
cleanup_tmp() { rm -rf "$tmp"; }
trap cleanup_tmp EXIT
if [[ "$SPEC_CHANNEL" == "night" ]]; then
log "cloning $REPO_URL (branch dev) for night …"
git clone --depth 1 --branch dev "$REPO_URL" "$tmp/src" 2>/dev/null ||
git clone --depth 1 "$REPO_URL" "$tmp/src"
sha="$(git -C "$tmp/src" rev-parse --short HEAD)"
version="night"
id="$(toolchain_id "$sha")"
elif [[ "$SPEC_FLOATING" -eq 1 ]]; then
local json tag
json="$(release_json_for_spec)"
tag="$(json_tag "$json")"
[[ -n "$tag" ]] || die "failed to resolve floating channel tag"
version="$(normalize_version "$tag")"
id="$(toolchain_id "$version")"
log "cloning $REPO_URL @ $tag …"
git clone --depth 1 --branch "$tag" "$REPO_URL" "$tmp/src" 2>/dev/null ||
{
git clone --depth 1 "$REPO_URL" "$tmp/src"
git -C "$tmp/src" fetch --depth 1 origin "refs/tags/${tag}:refs/tags/${tag}"
git -C "$tmp/src" checkout "$tag"
}
sha="$(git -C "$tmp/src" rev-parse --short HEAD)"
else
version="$SPEC_VERSION"
id="$(toolchain_id)"
local tag="v${SPEC_VERSION}"
log "cloning $REPO_URL @ $tag …"
git clone --depth 1 --branch "$tag" "$REPO_URL" "$tmp/src" 2>/dev/null ||
{
git clone --depth 1 "$REPO_URL" "$tmp/src"
git -C "$tmp/src" fetch --depth 1 origin "refs/tags/${tag}:refs/tags/${tag}"
git -C "$tmp/src" checkout "$tag"
}
sha="$(git -C "$tmp/src" rev-parse --short HEAD)"
fi
dest="$DCRUP_TC/$id"
if [[ -x "$dest/dcr" && "${FORCE:-0}" != "1" ]]; then
ok "already installed: $id"
link_default "$id"
return 0
fi
log "building release (features: $FEATURES) …"
(
cd "$tmp/src"
# shellcheck disable=SC2086
cargo build --release --features $FEATURES
)
mkdir -p "$dest"
cp "$tmp/src/target/release/dcr" "$dest/dcr"
chmod +x "$dest/dcr"
printf '%s\n' "channel=$SPEC_CHANNEL" "version=$version" "git=$sha" "source=build" "features=$FEATURES" >"$dest/dcrup-meta"
ok "installed build $id"
link_default "$id"
trap - EXIT
cleanup_tmp
}
cmd_install() {
local mode="release" FORCE=0
local spec=""
local libc_cli=""
while [[ $# -gt 0 ]]; do
case "$1" in
--build)
mode="build"
shift
;;
--release)
mode="release"
shift
;;
--force)
FORCE=1
shift
;;
--libc)
[[ $# -ge 2 ]] || die "--libc needs gnu|musl|auto"
libc_cli="$2"
shift 2
;;
--libc=*)
libc_cli="${1#--libc=}"
shift
;;
--mirror)
[[ $# -ge 2 ]] || die "--mirror needs auto|cf|gh|sf|ya"
set_mirror "$2"
shift 2
;;
--mirror=*)
set_mirror "${1#--mirror=}"
shift
;;
-h | --help)
usage
exit 0
;;
-*) die "unknown flag: $1" ;;
*)
[[ -z "$spec" ]] || die "unexpected argument: $1"
spec="$1"
shift
;;
esac
done
[[ -n "$spec" ]] || die "usage: dcrup install <spec> [--build|--release] [--force] [--libc gnu|musl|auto] [--mirror auto|cf|gh|sf|ya]"
parse_spec "$spec"
ensure_dirs
if [[ -n "$libc_cli" ]]; then
case "$libc_cli" in
gnu | glibc | musl | auto) DCRUP_LIBC="$libc_cli" ;;
*) die "invalid --libc: $libc_cli (use gnu|musl|auto)" ;;
esac
fi
export DCRUP_LIBC="${DCRUP_LIBC:-gnu}"
if [[ "$SPEC_CHANNEL" == "night" ]]; then
mode="build"
fi
export FORCE
log "install spec=$SPEC_RAW channel=$SPEC_CHANNEL version=${SPEC_VERSION:-∅} mode=$mode libc=$DCRUP_LIBC mirror=$DCRUP_MIRROR"
if [[ "$mode" == "build" ]]; then
install_build
else
install_prebuilt
fi
check_path
}
cmd_default() {
[[ $# -eq 1 ]] || die "usage: dcrup default <spec>"
parse_spec "$1"
ensure_dirs
local id
if [[ "$SPEC_CHANNEL" == "night" || "$SPEC_FLOATING" -eq 1 ]]; then
id="$(ls -1 "$DCRUP_TC" 2>/dev/null | grep -E "^${SPEC_CHANNEL}-" | sort | tail -n1 || true)"
[[ -n "$id" ]] || die "no installed toolchain for channel $SPEC_CHANNEL (run: dcrup install $SPEC_CHANNEL)"
else
id="$(toolchain_id)"
[[ -d "$DCRUP_TC/$id" ]] || die "not installed: $id (run: dcrup install $1)"
fi
link_default "$id"
}
cmd_update() {
ensure_dirs
local active
active="$(read_active)"
[[ -n "$active" ]] || die "no active toolchain (run: dcrup install stable)"
case "$active" in
night-*)
log "updating night (rebuild HEAD) …"
FORCE=1 cmd_install night --build --force
;;
stable-* | dev-*)
local ch="${active%%-*}"
log "updating floating channel $ch …"
FORCE=1 cmd_install "$ch" --force
;;
*-stable | *-dev)
ok "pinned toolchain $active — not floating; install a newer version explicitly"
;;
*)
warn "unknown active id $active; try: dcrup install stable"
;;
esac
}
cmd_list() {
ensure_dirs
local active
active="$(read_active)"
if [[ ! -d "$DCRUP_TC" ]] || [[ -z "$(ls -A "$DCRUP_TC" 2>/dev/null || true)" ]]; then
warn "no toolchains installed"
return 0
fi
local d base
for d in "$DCRUP_TC"/*; do
[[ -d "$d" ]] || continue
base="$(basename "$d")"
if [[ "$base" == "$active" ]]; then
printf ' * %s\n' "$base"
else
printf ' %s\n' "$base"
fi
done
}
cmd_show() {
ensure_dirs
local active
active="$(read_active)"
echo "DCRUP_HOME=$DCRUP_HOME"
echo "DCRUP_BIN=$DCRUP_BIN"
echo "active=${active:-none}"
if [[ -n "$active" && -f "$DCRUP_TC/$active/dcrup-meta" ]]; then
echo "--- meta ---"
cat "$DCRUP_TC/$active/dcrup-meta"
fi
if [[ -x "$DCRUP_BIN/dcr" ]]; then
echo "--- dcr --version ---"
"$DCRUP_BIN/dcr" --version 2>/dev/null || true
fi
}
cmd_which() {
if [[ -L "$DCRUP_BIN/dcr" || -e "$DCRUP_BIN/dcr" ]]; then
readlink -f "$DCRUP_BIN/dcr" 2>/dev/null || readlink "$DCRUP_BIN/dcr" 2>/dev/null || echo "$DCRUP_BIN/dcr"
else
die "dcr not linked (run: dcrup install stable)"
fi
}
cmd_uninstall() {
ensure_dirs
if [[ "${1:-}" == "--all" ]]; then
rm -rf "$DCRUP_TC"
rm -f "$DCRUP_BIN/dcr" "$(active_file)"
ok "removed all toolchains"
return 0
fi
[[ $# -eq 1 ]] || die "usage: dcrup uninstall <spec>|--all"
parse_spec "$1"
local id
if [[ "$SPEC_FLOATING" -eq 1 || "$SPEC_CHANNEL" == "night" ]]; then
id="$(ls -1 "$DCRUP_TC" 2>/dev/null | grep -E "^${SPEC_CHANNEL}-" | sort | tail -n1 || true)"
else
id="$(toolchain_id)"
fi
[[ -n "$id" && -d "$DCRUP_TC/$id" ]] || die "not installed: $1"
rm -rf "$DCRUP_TC/$id"
if [[ "$(read_active)" == "$id" ]]; then
rm -f "$DCRUP_BIN/dcr" "$(active_file)"
warn "removed active toolchain; run: dcrup install stable"
fi
ok "removed $id"
}
check_path() {
case ":$PATH:" in
*":$DCRUP_BIN:"*) ;;
*)
warn "$DCRUP_BIN is not in PATH"
echo "Add to ~/.bashrc / ~/.zshrc / ~/.profile:"
echo " export PATH=\"$DCRUP_BIN:\$PATH\""
;;
esac
}
cmd_self_install() {
local dest="$DCRUP_BIN"
while [[ $# -gt 0 ]]; do
case "$1" in
--to)
dest="$2"
shift 2
;;
*) die "usage: dcrup self-install [--to DIR]" ;;
esac
done
ensure_dirs
mkdir -p "$dest"
local self
self="$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || true)"
if [[ -z "$self" || ! -f "$self" ]]; then
# When invoked as `curl ... | sh`, the shell has no script file to copy.
# Fetch the same trusted installer URL and install that exact script.
need_cmd curl
self="$(mktemp "${TMPDIR:-/tmp}/dcrup.XXXXXX")"
curl -fsSL --proto '=https' --tlsv1.2 "$DCRUP_INSTALL_URL" -o "$self" || {
rm -f "$self"
die "unable to download installer for self-install"
}
trap 'rm -f "$self"' EXIT
fi
cp "$self" "$dest/dcrup"
chmod +x "$dest/dcrup"
ok "dcrup installed to $dest/dcrup"
check_path
echo "Then: dcrup install stable"
}
main() {
local cmd="${1:-}"
shift || true
case "$cmd" in
"" | -h | --help | help) usage ;;
install) cmd_install "$@" ;;
default) cmd_default "$@" ;;
update) cmd_update "$@" ;;
list) cmd_list "$@" ;;
show) cmd_show "$@" ;;
which) cmd_which "$@" ;;
uninstall) cmd_uninstall "$@" ;;
self-install) cmd_self_install "$@" ;;
*) die "unknown command: $cmd (try: dcrup help)" ;;
esac
}
main "$@"

View File

@@ -0,0 +1,66 @@
---
sidebar_label: Introduction
---
# DCR — C/C++ Build Tool & Package Manager
<details>
<summary>Quick reference</summary>
```bash
# Installation (dcrup)
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
# Create a project
dcr new my-app
cd my-app
# Build and run
dcr build
dcr run
# Run tests
dcr test
# Add a dependency
dcr add fmt
# Generate IDE files
dcr gen vscode
```
</details>
## Contents
| Section | Description |
| ----------------------------------------------------- | --------------------------------------------- |
| [Getting Started](/docs/getting-started/installation) | Installation and first steps |
| [Commands](/docs/commands/project-commands) | All CLI commands |
| [Reference](/docs/reference/dcr-toml) | Configuration, build, dependencies, platforms |
| [Testing](/docs/testing/test-framework) | Built-in test framework |
| [Recipes](/docs/recipes/cross-to-windows) | Common scenarios |
| [IDE Integration](/docs/ide-integration) | VS Code, CLion, compile_commands.json |
| [Self Update](/docs/self-update) | Auto-update |
| [FAQ](/docs/faq) | Frequently asked questions |
| [Changelog](/docs/changelog) | Version history |
| [License](/docs/license) | DCR and vendored library licenses |
| [Contributing](/docs/contributing) | DCR development |
## Features
* **Incremental builds** — mtime + `.d` headers + SHA256 fingerprint
* **Parallel compilation** — thread::scope, atomic task queue
* **7 backends** — gcc/clang (unix_cc), MSVC/clang-cl (msvc), GAS, NASM, MASM, FASM, LLVM IR
* **8 project kinds** — bin, staticlib, sharedlib, efi, elf, none, custom, flat-bin
* **Disk images** — optional `[archive]` packs FAT12/16/32 images after build
* **Cross-compilation** — short names and full triples
* **Profiles** — debug / release with field overrides
* **Workspaces** — multi-package projects with topological sort
* **Registry + Git + Path** — three dependency mechanisms
* **IDE generation** — VS Code, CLion, compile_commands.json, JSON metadata
* **pkg-config** — automatic system library discovery
* **Per-command `--help`** — `dcr build --help`, `dcr new --help`, etc.
* **Man pages** — `man dcr`, `man dcr-build`, `man dcr-new`

View File

@@ -0,0 +1,259 @@
---
sidebar_label: Changelog
---
# Changelog
## 0.8.4 (2026-08-04)
**Added:**
* **`.dcr/` directory** — shared machine-readable build facts for IDE integrations:
* `.dcr/compile_commands.json`
* `.dcr/build-info.json` (`schemaVersion`, `artifact_path`, `profile`, …)
* `.dcr/toolchain.json` (compiler/debugger paths, moc/uic/rcc)
* `.dcr/ide/` (placeholder for IDE lock files)
* **`dcr gen project-info`** — `target`, `target_dir`, `artifact_path`, `artifact_kind`, `source_roots`, `include_globs`, `exclude_globs`; absolute/canonical paths.
* **`dcr build --print-artifact-path`** — one absolute artifact path line on stdout after a successful build.
* **`dcr gen … --quiet` / `-q`** — suppress human success logs for gen subcommands.
* **`.clangd`** — created on first gen with `CompilationDatabase: .dcr` (`# managed by dcr gen`); custom `.clangd` is not overwritten.
* **Helpers** `canonicalize_path`, `atomic_write`, `ensure_dcr_dir`; pure `resolve_artifact_path` via `platform::*`.
* **`dcr new` / `dcr init`** — add `.dcr/` to `.gitignore`.
**Changed (breaking):**
* **`compile_commands.json` moved** from project root to **`.dcr/compile_commands.json`**.\
clangd discovers it via `.clangd` / `--compile-commands-dir=.dcr`.\
CLion and VSCode generators updated accordingly.
* **Atomic write** for compile_commands (tmp + rename).
* **`gen vscode` / `gen clion` launch/run** — use the same artifact path resolver as `project-info` / `build-info.json`.
**Fixed:**
* Launch configs no longer hardcode `target/\<profile>/\<name>` without the Linux triple segment.
* Symlink/mount roots: best-effort canonicalize for root and compile database paths.
## 0.8.3 (2026-08-03)
### Added
* **`dcr run -- \<args>...`** — cargo-style argument forwarding after a bare `--`\
(`dcr run --release -- --test_help`). Applies to direct binary runs and `[run].cmd`.
* **Tests** — host target section `ldflags` without CLI `--target`; run-arg forwarding; `split_double_dash` unit tests.
### Changed
* **Native builds resolve the host triple** — without `--target` / package `build.target`, host sections such as\
`[build.x86_64-unknown-linux-gnu]` apply again (`cflags` / `ldflags` / toolchain).\
Previously the target was empty and those sections were ignored while artifacts already used the host triple path.
* **Empty target** — no more `Unknown target ''` warning.
* **`dcr run --help` / man `dcr-run`** — document `--` forwarding.
### Fixed
* **Native artifact paths on Windows and macOS** — without an explicit `--target` / `build.target`, artifacts use `target/\<profile>`, so `dcr run` and flat-bin find the build output.
* Target-specific `ldflags` missing on native host builds (e.g. micro-lang + `libsct-elf`).
* Spurious empty-target warning.
## 0.8.2 (2026-07-22)
### Added
* **Compile progress `[N/M]`** — live TTY status line (`compile pkg v0.1.0 [12/41]`) so long mono-package builds do not look hung.
* **DCR status style** — fixed-width verbs: `project`, `compile`, `dep`, `ready`, `pack`, `done`, `run`.
* **Cargo feature `archive`** — optional FAT packing via `fatfs` (`cargo build --features archive`). Release CI builds with the feature; without it `[archive]` fails with a clear message.
* **Tests** — `flat_bin_nasm_build`, package `build.target` without CLI `--target`, stricter workspace `clean --all`.
* **CI expansion** — unit + integration on Linux/macOS/Windows, archive feature job, rust-cache, clippy default + all-features (see `.github/workflows/ci.yml`).
### Changed
* **No forced host triple from CLI** — without `--target`, package/member `build.target` is honored (bare-metal / ISO `post_steps` paths).
* **Relative include/lib flags** (`-I`, `-i`, `-isystem`, `-idirafter`, `-L`, `-T`) absolutized against the package root under workspace builds.
* **`dcr clean --all`** — no spam for members without a local `target/` (shared root `target/`).
* **`error` / `warn`** — red / yellow on stderr; CLI fully English (`Hint:`).
* **Help / man** — list `add`, `lint`, `setup`; unknown command exits with code 1.
* **Tool NotFound** — `linker not found: ld.lld …` / `{tool} not found …` instead of raw `os error 2`.
## 0.8.1 (2026-07-20)
### Added
* **`build.kind = "flat-bin"`** — raw binary (default `.bin`) for OS-dev payloads:
* **NASM** — `-f bin` → `\<stem>.bin`
* **FASM** — direct output (`format binary` in source)
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — FAT12/16/32 disk images after build (`output`, `format`, `size`, `offset`, `label`, `bootsector`, `layout`). From 0.8.2 requires feature `archive`.
* **Single-file `build.roots`** — a root may be a single source or header file, not only a directory.
### Changed
* **`--force`** also re-runs `build.steps` and `build.post_steps`.
* **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
## 0.8.0 (2026-07-18)
### Added
* **Dedicated Build Engine (`src/core/build/engine.rs`)** — decoupled the build orchestration logic completely from the CLI front-end wrapper in `src/cli/build.rs` to a reusable, decoupled core build engine.
* **Polymorphic Language Model (`Language` trait)** — introduced the abstract `Language` trait (`src/core/build/language/mod.rs`). File scanning, compiler resolution, and flags handling are now encapsulated in dedicated language modules for C, C++ (including Qt code generation), LLVM IR, and ASM (GAS, NASM, FASM, MASM).
* **Polymorphic Compilation Dispatch (`Builder` trait)** — introduced the `Builder` trait to generalize builder invocations (`src/core/build/builder/mod.rs`). Consolidated GCC/Clang logic into `builder/cc_common.rs` and Microsoft Visual C++ logic into `builder/msvc/`.
* **Per-Language Configuration overrides (`[build.\<lang>]`)** — introduced support for configuring language-specific compiler, standard, and flags (e.g. `[build.c]`, `[build.cxx]`, `[build.asm]`) independently in `dcr.toml`.
* **Automatic Workspace Dependency Injection** — during workspace builds, include/lib paths of dependent workspace members (including their source headers, local `include/` folders, and build target `target/include` / `target/lib` folders) are automatically resolved and injected.
* **`BuildReporter` Event System** — decoupled build orchestration output into a structured event-driven reporter model (`src/core/build/report.rs`), making DCR suitable for library embedding and IDE integrations without stderr capturing.
* **Build Cancellation Support** — introduced thread-safe cancellation tokens (`Arc\<AtomicBool>`) allowing clients to safely abort compile runs mid-execution.
* **TOML Formatting & Custom Keys Preservation** — migrated the config editor to `toml_edit`, preserving all unknown/user-defined TOML keys, structures, and comments during file write operations (e.g., in `dcr add`).
* **Path Dependencies Target Include Resolution** — local path dependencies configured via tables now correctly expose headers built and packaged into their `target/include` folder to consumer packages.
* **Modular Integration Test Suite** — refactored the monolith `tests/cli_basic.rs` file into clean, specialized integration tests: `cli_build.rs`, `cli_deps.rs`, `cli_lint.rs`, `cli_new.rs`, `cli_qt.rs`, `cli_test.rs`, `cli_workspace.rs`.
### Changed
* **Consolidated Linking and Archiving** — artifact generation (linking executables/shared libraries and archiving static libraries) consolidated into a single `src/core/build/builder/artifact.rs` module.
* **Workspace-Aware member execution** — `dcr run` executed at the workspace root of a `workspace_only` project now triggers the member build inside the workspace context using the `--workspace` parameter, preventing standalone build issues.
* **Elimination of Global State** — removed global variables and states from the build core, encapsulating build logic inside isolated `BuildContext` structs for thread safety.
* **Build Cache Separation** — relocated mtime tracking, incremental caching, and header-dependency checking logic to `src/core/build/cache.rs`.
* **Modularized Pre-build Steps** — decoupled generator scripts and pre-build commands parsing into `src/core/build/steps.rs`.
## 0.7.4 (2026-06-17)
### Added
* **Native Qt support** — automatic meta-object handling (MOC, UIC, RCC) added when `build.qt = true` is set in `dcr.toml`.
* **`dcr lint` command** — C/C++ static analysis via `clang-tidy`. Supports `--fix` for automatic fixes. Respects `build.roots` and `build.src_disable` from config.
* **Three new assembler backends**:
* **MASM** (`compiler = "ml"` / `"ml64"`) — Microsoft Macro Assembler.
* **FASM** (`compiler = "fasm"`) — Flat Assembler.
* **LLVM IR** (`compiler = "llc"`) — compiles `.ll` files via `llc -filetype=obj`.
* **Shared ASM pipeline** — linking and archiving logic consolidated into `core/builder/asm.rs`. Adding a new assembler backend now takes ~30 lines.
* **Filesystem utilities** — `to_hex()` and `home_dir()` extracted to `utils/fs.rs`.
* **Build utilities** — `normalize_target()`, `normalize_kind()`, `normalize_platform()`, `default_profile_flags()` extracted to `utils/build.rs`.
* **Backend helpers** — `asm_lang_flag()`, `source_extensions()`, `elapsed_secs()` added to `core/builder/common.rs`.
* **Full Bare-Metal / Freestanding Automation** — introduced the `build.freestanding = true` configuration option. When enabled (or when a bare-metal target is detected), DCR automatically injects `-ffreestanding` during compilation and both `-nostdlib` and `-static` during linking.
* **Artifact Optimization (LTO & Strip)** — added `build.lto` (auto-injects `-flto` for compiler and linker) and `build.strip` (automatically strips debug symbols via linker `-s` flag) options to `dcr.toml`.
* **Compilation Thread Control** — added the `build.codegen-units` option to strictly limit the maximum number of parallel jobs utilized by the custom `parallel_build` worker pool.
* **Panic Behavior Management** — added `build.panic = "abort"` support. For C++ targets, it automatically strips exception handling and unwind tables via `-fno-exceptions`, `-fno-unwind-tables`, and `-fno-asynchronous-unwind-tables`.
### Changed
* **Intelligent Default Flags Generation** — automated injection of fallback optimization (`-O3`/`-O0`), debug (`-g`), and warning (`-Wall -Wextra`) flags is now suppressed for bare-metal and freestanding builds if `build.cflags` are overridden.
* **Centralized Bare-Metal Detection** — relocated the `is_bare_metal_target` helper to common build utilities (`src/utils/build.rs`) for unified access across the building core.
* **Architectural Refactoring**:
* Renamed `src/config.rs` to `src/templates.rs`.
* Started consolidation of configuration and build orchestration logic.
## 0.7.3 (2026-06-13)
### Added
* **`--vcs` option for `new` and `init` commands** — introduced explicit version control system selection via `--vcs \<git|none>`.
* **Git metadata integration in `--version`** — the CLI now appends the current short commit hash and a `-dirty` suffix if there are uncommitted changes in the DCR repository.
* **Automatic `.gitignore` generation** — Git repository initialization now automatically writes a `.gitignore` file excluding the `/target` directory.
* **Nested repository prevention** — automatic Git initialization is now skipped if `dcr new` or `dcr init` is executed inside an already existing Git repository.
* **VCS verification tests** — added `new_vcs_options_work` and `init_vcs_options_work` integration tests to ensure reliable repository behavior.
### Changed
* **Complete removal of `git2` dependency** — all Git actions (dependency fetching, VCS setup, status checks) are now delegated to the system `git` executable via `Command`. This simplifies compilation and drops the need for `vendored` and `openssl` features.
* **Migrated from `reqwest` to `ureq`** — replaced the heavy `reqwest` crate in `flag_update.rs` with the lightweight synchronous `ureq 2.10` client, reducing overhead and the final binary size.
## 0.7.2 (2026-06-07)
### Added
* `default_target_triple()` now respects `target_env` — Linux (gnu/musl) and Windows (msvc/gnu) use the correct environment instead of hardcoded values.
### Fixed
* **macOS Apple Silicon builds failed with `_main` undefined** — `--target=` is now passed to ldflags, not just cflags. `default_target_triple()` uses `std::env::consts::ARCH` on macOS instead of hardcoded `x86_64`.
* **GitHub Stars and GPL-3.0 badges not rendering in README** — badge block converted to pure HTML.
### Changed
* Default target resolution extracted into shared `default_target_triple()` — removed duplication across build, run, clean.
## 0.7.1 (2026-06-02)
### Added
* **`--help` for all commands** — `dcr build --help`, `dcr run --help`, `dcr new --help`,
`dcr init --help`, `dcr clean --help`, `dcr add --help`, `dcr fmt --help`,
`dcr setup --help`, `dcr tree --help`, `dcr gen --help`, `dcr --update --help`,
`dcr test --help`. All output uses styled headers (green) and usage lines (cyan).
* **Man pages** — 12 troff pages in `man/man1/`: `dcr.1`, `dcr-build.1`,
`dcr-run.1`, `dcr-new.1`, `dcr-init.1`, `dcr-clean.1`, `dcr-add.1`, `dcr-test.1`,
`dcr-gen.1`, `dcr-fmt.1`, `dcr-tree.1`, `dcr-setup.1`.
* **Man pages in all packaging** — install.sh, install_bsd.sh, AUR PKGBUILD,
Debian (cargo-deb), RPM (cargo-generate-rpm), Nix (postInstall), Homebrew
(resource), Snap, GitHub Release assets.
* **Project name validation** — `dcr init` and `dcr new` now validate names before
creating files. Only ASCII letters, digits, `_` and `-` are allowed.
* **`documentation` and `homepage` fields** — added to `Cargo.toml`.
* **Release profile optimizations** — `opt-level = "z"`, LTO, `codegen-units = 1`,
`panic = "abort"`, `strip = true` for smaller binaries.
* **Linux i686, armv7, riscv64 targets** — added to release workflow and install scripts.
* **Linux musl i686, armv7 targets** — cross-compiled via zigbuild in CI.
* **AUR packages** — `dcr-dev`, `dcr-dev-bin` publishing workflow.
* **Snap publishing** — automated Snapcraft publishing in CI.
* **Snap badge** — in README.
### Changed
* **`validate_package_name` made public** — callable from CLI commands.
* **README platform table** — reorganized: libc variants as separate OS rows,
removed extra columns. Linux architecture list updated.
* **`gen.rs` no-args output** — now uses styled output instead of raw `eprintln!`.
* **`tree.rs`, `fmt.rs`, and `setup.rs`** — now accept arguments for `--help`.
* **README install commands** — `| bash` → `| sh` for POSIX compatibility.
### Fixed
* **`dcr new \<invalid-name>` creates directory then fails** — validation now
happens before any file operations.
* **`dcr init` on invalid directory name** — same fix.
* **Man pages missing in installed packages** — now shipped in all formats.
* **Windows drive letter false positive** — in dependency file parser.
* **CRLF (`\r\n`) breaks dependency parser** — now handles mixed line endings.
* **Newline after backslash not consumed** — in `parse_d_file` escape handling.
## 0.7.0 (2026-06-01)
### Added
* **OpenBSD and NetBSD target support** — full platform routing with dynamic target triples using `std::env::consts::ARCH` and `std::env::consts::OS`. Affects `build`, `run`, `clean` commands and the platform module.
* **`src/platform/bsd.rs`** — new BSD platform module (shared by FreeBSD, OpenBSD, NetBSD) providing `bin_path`, `lib_path`, `elf_path`, `efi_path`, `shared_lib_path`.
* **`build.out_dir` config option** — custom output directory that overrides the default `target/\<triple>/\<profile>` path for final artifacts. Supported in `build`, `run`, and config validation.
* **`dcr fmt` command** — new CLI command that formats all C/C++ source files (`*.c`, `*.cpp`, `*.h`, `*.hpp`) in `src/` and `tests/` using `clang-format`.
* **Incremental linking** — `needs_link()` in `common.rs` checks if any object file is newer than the linked output, skipping unnecessary relinking. Implemented for all backends (`unix_cc`, `msvc`, `gas`, `nasm`).
* **`build.kind = "none"` and `"custom"`** — two new project kinds for special build scenarios that don't produce standard artifacts.
* **`install_bsd.sh`** — POSIX-compliant installation script for BSD systems (FreeBSD, OpenBSD, NetBSD) with binary download and source build modes.
* **Linux ARM64 support in `install.sh`** — added `Linux:aarch64|Linux:arm64` target detection for pre-built binary downloads.
* **BSD OS detection in `install.sh`** — detects FreeBSD, OpenBSD, NetBSD and determines target triple.
* **`rust-toolchain.toml`** — explicit toolchain pinning to `stable` channel.
* **Integration tests** — `build_with_target_config` (verifies `build.target = "linux"`) and `build_with_out_dir` (validates custom output directory).
* **`get_build_string_with_profile` made `pub`** — so `run.rs` can determine custom output directory configuration.
### Changed
* **`build.target` semantics changed** — now strictly contains a target triple (e.g., `x86_64-unknown-linux-gnu`) or short name (`linux`, `macos`, `windows`). No longer used as custom output directory — this functionality moved to `build.out_dir`.
* **`build.standard` made optional** — changed from `String` to `Option\<String>`. Validation only enforces non-empty for non-ASM languages. Skipped in `dcr.toml` output if empty.
* **`dcr run` with `out_dir`** — now determines target directory respecting `build.out_dir` via `get_build_string_with_profile()` from `build.rs`.
* **`collect_sources()` returns empty vector** instead of error when no sources are found, allowing `kind = "none"` or `kind = "custom"` projects with no source files.
* **CI/CD release workflow refactored** — `git2` made target-specific (no vendored-openssl on Windows), Zig-based cross-compilation for non-x86_64 Linux targets, Arch Linux package version cleanup (dashes → dots), `gmake` symlink for NetBSD.
* **README compatibility table** — FreeBSD, OpenBSD, NetBSD build/run status upgraded from "community/best-effort" to "officially supported".
* **Documentation updated** — `build-section.md` describes new `build.target` and `build.out_dir` fields. `target-directory.md` rewritten to clarify the distinction.
### Fixed
* **stdout/stderr not inherited in `dcr run`** — child process output was captured and manually printed, breaking interactive programs. Fixed by switching to `Command::status()`.
* **Race condition in release CI** — matrix build jobs could upload assets to a release that didn't exist yet. Fixed by adding a dedicated `create-release` job.
* **Release GHA — stable toolchain override** — fixed Rust toolchain override issues in CI.
* **Arch Linux package version sanitization** — version strings with dashes (e.g., `0.7.0-dev`) are invalid for `pkgver`. Fixed by replacing dashes with dots.
* **GPG permissions after Docker** — Docker operations changed GPG directory ownership. Fixed by running `chown` after Docker commands.
* **RPM artifact paths** — RPM artifacts were placed in `rpm/x86_64/` instead of `fedora/x86_64/`. Fixed in Dexoron Packages Index workflow.
* **JSON parsing reliability in `install.sh`** — added `jq` as primary parser with `python3` fallback for dev channel release lookup.
### Removed
* **`format_roots()` helper function** — removed from `common.rs`. Was only used by the old error handling path in `collect_sources()`.
* **Per-distribution artifact download steps** — three separate `actions/download-artifact` steps replaced with unified `gh release download --clobber`.

View File

@@ -0,0 +1,47 @@
---
sidebar_label: Build commands (build, run, clean)
---
# Build Commands
## `dcr build`
Builds the project according to `dcr.toml`.
```bash
dcr build # debug profile
dcr build --release # release build
dcr build --debug # explicit debug
dcr build --target aarch64-unknown-linux-gnu
dcr build --force # full rebuild (also re-runs build.steps / post_steps)
dcr build --clean # clean + build
dcr build --verbose # show compilation commands
dcr build --workspace pkg-a # build specific workspace package
```
Artifacts: `target/\<triple>/\<profile>/\<binary-name>` (Linux with explicit target).
With `[archive]` in `dcr.toml`, a FAT disk image is packed after a successful build.
## `dcr run`
Builds (if sources are newer than artifacts) and runs the binary.
```bash
dcr run
dcr run --release
dcr run --force # force rebuild then run
```
On a **workspace-only** root: if `[run].cmd` is set, that command is used after build; otherwise DCR delegates to a workspace member.
## `dcr clean`
Removes `target/` directory (or `target/\<target>/\<profile>`).
```bash
dcr clean
dcr clean --release # target/release/ only
dcr clean --target windows # target/x86_64-pc-windows-msvc/
dcr clean --all # clean all workspace packages
```

View File

@@ -0,0 +1,53 @@
---
sidebar_label: Dependency commands (add, tree)
---
# Dependency Commands
## `dcr add \<name> [source]`
Adds a dependency to `dcr.toml`.
```bash
dcr add fmt # registry lookup
dcr add mylib ../path/to/lib # path as source
dcr add mylib path:./lib # explicit path prefix
dcr add mylib git:https://github.com/user/repo # explicit git prefix
dcr add mylib github:user/repo # GitHub shorthand
dcr add mylib gitlab:user/repo # GitLab shorthand
```
Source prefixes:
* `path:` — local path
* `git:` — generic git URL
* `github:` — expands to `https://github.com/\<user>/\<repo>`
* `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>`
* `http://` / `https://` / `git@` — full URL
Flags:
* `--branch \<name>` — git branch
* `--tag \<name>` — git tag
* `--rev \<hash>` — git commit
If source is omitted — DCR searches connected registries.
## `dcr tree`
Displays the project dependency tree.
```bash
dcr tree
```
Example output:
```
my-app v0.1.0
├── fmt (registry)
│ └── spdlog (registry)
└── catch2 (registry)
```
For path dependencies, recursively shows their own dependencies (from their `dcr.toml`).

View File

@@ -0,0 +1,73 @@
---
sidebar_label: Gen commands (vscode, clion, ...)
---
# Gen Commands
## `dcr gen \<target>`
Generates IDE integration files.
### vscode
```bash
dcr gen vscode
```
Creates:
* `.vscode/tasks.json` — `build` task (dcr build)
* `.vscode/launch.json` — debug launch configuration
* `.vscode/settings.json` — C/C++ settings (clangd paths, includes)
* `.vscode/extensions.json` — recommended extensions (vscode-clangd, vscode-lldb)
### clion
```bash
dcr gen clion
```
Creates:
* `.idea/externalTools.xml` — external tools (build, run, clean, test)
* `.idea/customTargets.xml` — custom build targets
* `.idea/misc.xml` — C/C++ project settings
* `.idea/runConfigurations/\<name>.xml` — per-binary run configurations
### compile-commands
```bash
dcr gen compile-commands
```
Generates `compile_commands.json` — standard format for clangd, cpptools, static analyzers.
### project-info
```bash
dcr gen project-info
```
Outputs JSON array with project metadata:
```json
[
{
"name": "my-app",
"version": "0.1.0",
"root": "/path/to/project",
"profile": "debug",
"language": "c",
"standard": "c17",
"cxx_standard": null,
"compiler": "/usr/bin/clang",
"kind": "bin",
"sources": ["src/main.c"],
"include_dirs": ["src"],
"lib_dirs": [],
"libs": [],
"cflags": ["-std=c17", "-O0", "-g"],
"ldflags": []
}
]
```

View File

@@ -0,0 +1,40 @@
---
sidebar_label: Project commands (new, init)
---
# Project Commands
## `dcr new \<name>`
Creates a new project with a standard structure and `dcr.toml`. The `name` argument is required.
Only ASCII letters, digits, underscores `_` and hyphens `-` are allowed in the project name.
```bash
dcr new my-app
dcr new my-app --vcs none
```
Flags:
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
Generates:
* `dcr.toml` with basic fields
* `src/main.c` with a `main` template
## `dcr init`
Initializes a DCR project in the current (empty) directory.
```bash
dcr init
dcr init --vcs none
```
Flags:
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.

View File

@@ -0,0 +1,60 @@
---
sidebar_label: Quality commands (test, fmt)
---
# Quality Commands
## `dcr test`
Runs tests.
```bash
dcr test # debug profile
dcr test --release # release profile
dcr test --debug # explicit debug
dcr test --help # detailed help
```
Before first use, initialize tests:
```bash
dcr test --init
```
This creates `tests/dcr_test.h` (framework) and `tests/test.c` (template).
What `dcr test` does:
1. Builds the project
2. Collects `tests/*.c` files (`.c` only, not `.cpp`)
3. Compiles and links each test file
4. Runs each test binary
5. Prints summary: TOTAL, PASS, SKIP, FAIL
6. Returns non-zero exit code on any FAIL
## `dcr fmt`
Formats C/C++ source files using `clang-format`.
```bash
dcr fmt
```
Processes: `src/**/*.{c,cpp,cxx,cc,h,hpp,hxx,hh}` and `tests/**/*.{c,cpp,cxx,cc,h,hpp,hxx,hh}`.
Uses `.clang-format` at the project root (if present), otherwise default clang-format style.
## `dcr lint`
Runs `clang-tidy` on C/C++ source files for static analysis.
```bash
dcr lint # show diagnostics
dcr lint --fix # apply fixes automatically
dcr lint --help # detailed help
```
Processes: `src/**/*.{c,cpp,cxx,cc}` and `tests/**/*.{c,cpp,cxx,cc}`.
Without `--fix`, clang-tidy reports warnings and errors without modifying files.
With `--fix`, clang-tidy applies automatic suggestions in place.

View File

@@ -0,0 +1,51 @@
---
sidebar_label: System commands (setup, --help, ...)
---
# System Commands
## `dcr setup`
Shows configured registries from `~/.dcr/config.toml`.
```bash
dcr setup
```
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
## `dcr --help`
Shows help for all commands.
```bash
dcr --help
```
## `dcr --version`
Shows version and target triple.
```bash
dcr --version # dcr 0.7.0 (x86_64-unknown-linux-gnu)
```
## `dcr --update`
Self-update. Downloads the latest release binary from GitHub Releases and replaces the current one.
```bash
dcr --update
```
Features:
* Auto-detects platform and architecture
* Warns if installed via AUR (use package manager instead)
* Works on Linux, macOS, Windows

View File

@@ -0,0 +1,52 @@
---
sidebar_label: Contributing
---
# Contributing
## Setup
```bash
git clone https://github.com/dexoron/dcr
cd dcr
cargo build
```
## Code style
All code must be formatted with `cargo fmt`:
```bash
cargo fmt
```
## Linting
```bash
cargo clippy --all-targets -- -D warnings
```
## Tests
```bash
cargo test --all-targets
```
## PR process
1. Fork the repository
2. Create a branch: `git checkout -b feature/description`
3. Make changes
4. Run `cargo fmt && cargo clippy && cargo test`
5. Open a Pull Request
## CI
CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check`
* `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features`
* Unit + integration tests on Linux, macOS, Windows
* Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -0,0 +1,66 @@
---
sidebar_label: FAQ
---
# FAQ
## Registry not found
```
error: registry not found
```
**Solution:** Make sure `~/.dcr/config.toml` exists:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
And check `DCR_INDEX_PATH`:
```bash
echo $DCR_INDEX_PATH
```
## Compiler not found
```
error: compiler not found
```
**Solution:** Ensure a compiler is installed and available in PATH.
```bash
which gcc
which clang
```
Or specify explicitly via `[toolchain]` in `dcr.toml`.
## Ctrl+C during build
DCR handles SIGINT: interrupts the current compilation and exits with non-zero code.
## How to create a library?
See [Library Recipe](/docs/recipes/library-project).
## How to cross-compile to Windows?
See [Cross-Compile Recipe](/docs/recipes/cross-to-windows).
## How to create a multi-package project?
See [Workspace Recipe](/docs/recipes/multi-package-workspace).
## Bootloader / pure NASM OS image
Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk image.
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## Lock file
`dcr.lock` is created during builds (`dcr build`) when registry dependencies are present. To force an update — delete `dcr.lock` and run `dcr build`.

View File

@@ -0,0 +1,79 @@
---
sidebar_label: First steps
---
# First Steps
## Create a project
```bash
dcr new my-app
cd my-app
```
Structure:
```
my-app/
├── dcr.toml
└── src/
└── main.c
```
`dcr.toml`:
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
compiler = "clang"
kind = "bin"
```
## Build
```bash
dcr build
```
Output — `target/\<triple>/debug/my-app` (Linux) or `target/debug/my-app.exe` (Windows).
Build profiles:
```bash
dcr build --release # release build
dcr build --debug # debug (default)
```
## Run
```bash
dcr run
```
Builds (if needed) and runs the binary.
## First test
```bash
dcr test --init # create test template
dcr test # run tests
```
## Formatting
```bash
dcr fmt # clang-format with .clang-format
```
## Linting
```bash
dcr lint # clang-tidy checks
dcr lint --fix # apply fixes automatically
```

View File

@@ -0,0 +1,135 @@
---
sidebar_label: Installation
---
# Installation
## dcrup (recommended)
Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
### Linux / macOS / BSD / Windows (bash)
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
```
Non-interactive install of DCR in one shot:
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
```
### Windows (PowerShell)
```powershell
irm https://ps1.dcr-tool.ru | iex
# or download then run:
# irm https://ps1.dcr-tool.ru -OutFile dcrup.ps1
# powershell -File .\dcrup.ps1 self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
Optional cmd bootstrap (if you prefer `curl` of the cmd shim):
```bat
curl -fsSL -o dcrup.cmd https://cmd.dcr-tool.ru
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`): shims live in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows `dcrup.cmd`).
### Common dcrup commands
```sh
dcrup install stable # latest stable prebuilt
dcrup install 0.8.2 # pin → 0.8.2@stable
dcrup install 0.8.2@dev
dcrup install stable --libc musl # Linux: musl asset (default: gnu)
dcrup install stable --build # cargo build --features archive
dcrup install night # always build from branch dev HEAD
dcrup default 0.8.2
dcrup update
dcrup list
dcrup show
dcrup which
```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
---
## Arch Linux (AUR)
```sh
yay -S dcr
```
## macOS / Linux (Homebrew)
```sh
brew tap dexoron/dexoron
brew install dcr
```
## Snap (Linux)
```sh
sudo snap install dcrup
```
> If classic Snap Store publishing is unavailable, install the `.snap` from [GitHub Releases](https://github.com/dexoron/dcr/releases/latest) with `--dangerous`.
## Nix (flake)
```sh
nix run github:dexoron/dcr
nix profile install github:dexoron/dcr
```
## Cargo (crates.io)
```sh
cargo install dcr
```
Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh
cargo install dcr --features archive
```
## From source
```sh
git clone https://github.com/dexoron/dcr.git
cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
```
## Post-install
```bash
dcr --version
dcrup show # if installed via dcrup
```
Man pages (package installs / release assets):
```bash
man dcr
man dcr-build
```
Registry (optional) — `~/.dcr/config.toml`:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```

View File

@@ -0,0 +1,51 @@
---
sidebar_label: IDE Integration
---
# IDE Integration
## VS Code
```bash
dcr gen vscode
```
Generates in `.vscode/`:
| File | Purpose |
| ----------------- | -------------------------------------------- |
| `tasks.json` | `build` task (dcr build) |
| `launch.json` | Debug launch configuration |
| `settings.json` | clangd/IntelliSense: include paths, standard |
| `extensions.json` | Recommends vscode-clangd, vscode-lldb |
## CLion
```bash
dcr gen clion
```
Generates in `.idea/`:
| File | Purpose |
| ------------------------------------------------ | ----------------------------------------- |
| `externalTools.xml` | Build, Run, Clean, Test as external tools |
| `customTargets.xml` | Custom build targets |
| `misc.xml` | C/C++ project settings |
| `runConfigurations/\<name>.xml` | Per-binary run configurations |
## compile_commands.json
```bash
dcr gen compile-commands
```
Generates `compile_commands.json` at project root. Standard format for clangd, C/C++ IntelliSense, static analyzers.
## project-info
```bash
dcr gen project-info
```
Outputs JSON array with project metadata (see [gen-commands](/docs/commands/gen-commands)).

View File

@@ -0,0 +1,33 @@
---
sidebar_label: License
---
# License
## DCR
DCR itself is [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) licensed.
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
## Rust dependencies
DCR is written in Rust. The following notable Rust crates are statically linked:
| Crate | License |
| ------------------------------------------------------- | ----------------- |
| [`ureq`](https://crates.io/crates/ureq) | MIT OR Apache-2.0 |
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
| [`serde_json`](https://crates.io/crates/serde_json) | MIT OR Apache-2.0 |
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
| [`glob`](https://crates.io/crates/glob) | MIT OR Apache-2.0 |
| [`self-replace`](https://crates.io/crates/self-replace) | MIT OR Apache-2.0 |
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
## Additional credits
* DCR's CLI design and project model are inspired by [Cargo](https://doc.rust-lang.org/cargo/).

View File

@@ -0,0 +1,49 @@
---
sidebar_label: Cross-compile to Windows
---
# Cross-Compile to Windows from Linux
Building a Windows binary on Linux using mingw-w64.
## Install toolchain
```bash
# Ubuntu/Debian
sudo apt install mingw-w64
# Fedora
sudo dnf install mingw64-gcc mingw64-binutils
```
## Configuration
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
compiler = "clang"
kind = "bin"
target = "x86_64-pc-windows-gnu" # explicit mingw, not msvc
```
## Build
```bash
dcr build --target x86_64-pc-windows-gnu --release
```
Artifact: `target/x86_64-pc-windows-gnu/release/my-app.exe`.
## Custom toolchain
```toml
[toolchain]
cc = "x86_64-w64-mingw32-gcc"
cxx = "x86_64-w64-mingw32-g++"
```

View File

@@ -0,0 +1,70 @@
---
sidebar_label: Library project
---
# Library Project
Creating a static library and using it in another project.
## Step 1: Create the library
```bash
dcr new my-lib
cd my-lib
```
`dcr.toml`:
```toml
[package]
name = "my-lib"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
kind = "staticlib"
```
`src/my_lib.h`:
```c
#ifndef MY_LIB_H
#define MY_LIB_H
int add(int a, int b);
#endif
```
`src/my_lib.c`:
```c
#include "my_lib.h"
int add(int a, int b) { return a + b; }
```
## Step 2: Build
```bash
dcr build --release
```
Artifacts:
* `target/\<triple>/release/libmy-lib.a` (Linux)
* `target/release/my-lib.lib` (Windows)
* `target/include/` — header files
## Step 3: Use in another project
```bash
dcr new my-app
cd my-app
dcr add my-lib ../my-lib
```
Automatically:
* Adds include path to `target/include/` of the library
* Adds lib path to `target/\<triple>/release/`
* Links `libmy-lib.a` / `my-lib.lib`

View File

@@ -0,0 +1,103 @@
---
sidebar_label: Multi-package workspace
---
# Multi-Package Workspace
A project with three packages: two libraries and a binary.
## Structure
```
workspace/
├── dcr.toml # root workspace
├── lib-core/
│ ├── dcr.toml
│ └── src/core.c
├── lib-utils/
│ ├── dcr.toml
│ └── src/utils.c
└── app/
├── dcr.toml
└── src/main.c
```
## Root dcr.toml
```toml
[package]
name = "my-workspace"
version = "0.1.0"
type = "none"
[build]
inherit = true
language = "c"
standard = "c11"
workspace_only = true
[workspace.lib-core]
path = "lib-core"
[workspace.lib-utils]
path = "lib-utils"
deps = ["lib-core"]
[workspace.app]
path = "app"
deps = ["lib-core", "lib-utils"]
main = true
```
## Packages
`lib-core/dcr.toml`:
```toml
[package]
name = "lib-core"
version = "0.1.0"
type = "none"
[build]
kind = "staticlib"
```
`lib-utils/dcr.toml`:
```toml
[package]
name = "lib-utils"
version = "0.1.0"
type = "none"
[build]
kind = "staticlib"
```
`app/dcr.toml`:
```toml
[package]
name = "app"
version = "0.1.0"
type = "none"
[build]
kind = "bin"
```
## Build
```bash
cd workspace
dcr build # builds everything in correct order
dcr build --workspace app # only app (lib-core and lib-utils built as deps)
dcr run # builds and runs main package
```
Build order (topological sort):
1. `lib-core`
2. `lib-utils` (depends on lib-core)
3. `app` (depends on lib-core, lib-utils)

View File

@@ -53,10 +53,10 @@ from = "target/{profile}/kernel.bin"
to = "KERNEL.BIN"
```
- `format`: `fat12`, `fat16`, or `fat32`
- `size`: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default ~1.44 MiB)
- `bootsector`: written only when `offset` is omitted or `0`
- `from` may be a glob; `{profile}` is substituted in paths
* `format`: `fat12`, `fat16`, or `fat32`
* `size`: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default ~1.44 MiB)
* `bootsector`: written only when `offset` is omitted or `0`
* `from` may be a glob; `{profile}` is substituted in paths
## C kernel → flat binary
@@ -75,15 +75,15 @@ Pipeline: objects → temporary linked ELF → `objcopy -O binary` → `kernel.b
## Other assemblers
| Tool | Notes |
|------|--------|
| **FASM** | Write `format binary` in the source; DCR writes `<stem>.bin` directly |
| **GAS** | Assemble `.s` → obj → `objcopy -O binary` |
| **LLC** | `language = "llvm_ir"` → obj → objcopy |
| **MASM** | COFF obj → objcopy (needs binutils/LLVM objcopy) |
| Tool | Notes |
| -------- | --------------------------------------------------------------------------------------- |
| **FASM** | Write `format binary` in the source; DCR writes `\<stem>.bin` directly |
| **GAS** | Assemble `.s` → obj → `objcopy -O binary` |
| **LLC** | `language = "llvm_ir"` → obj → objcopy |
| **MASM** | COFF obj → objcopy (needs binutils/LLVM objcopy) |
## Notes
- Single-file `roots` are supported: `roots = ["src/boot.asm"]`.
- `--force` re-runs `build.steps` / `build.post_steps` as well as recompilation.
- Prefer `kind = "elf"` if you need a relocatable ELF kernel without stripping to raw binary.
* Single-file `roots` are supported: `roots = ["src/boot.asm"]`.
* `--force` re-runs `build.steps` / `build.post_steps` as well as recompilation.
* Prefer `kind = "elf"` if you need a relocatable ELF kernel without stripping to raw binary.

View File

@@ -0,0 +1,82 @@
---
sidebar_label: Build profiles
---
# Build Profiles
Profiles allow overriding `[build]` fields for specific build modes.
## Configuration
```toml
[build]
language = "c"
standard = "c17"
cflags = ["-Wall"]
[build.debug]
cflags = ["-O0", "-g"]
[build.release]
cflags = ["-O3", "-DNDEBUG"]
```
## Merge rules
Fields from `[build.\<profile>]` are merged on top of `[build]`:
* **Scalar fields** (strings, numbers, bools) — replaced
* **Arrays** (`cflags`, `ldflags`, ...) — **appended** (extend the `[build]` array)
Set `inherit = false` to disable array inheritance (only profile's own arrays are used).
## Built-in profiles
The default flags for each profile are composed from three config fields:
| Field | debug default | release default |
| ----------- | ------------------ | --------------- |
| `opt_level` | `"0"` | `"3"` |
| `debug` | `true` | `false` |
| `warnings` | `["all", "extra"]` | `[]` |
Which produce the equivalent compiler flags:
| Profile | Effective flags |
| --------- | ---------------------------------------------------------- |
| `debug` | `-O0 -g -Wall -Wextra -fno-omit-frame-pointer -DDCR_DEBUG` |
| `release` | `-O3 -DNDEBUG` |
Additional build options can be toggled per-profile:
```toml
[build.release]
opt_level = "z"
lto = true
strip = true
panic = "abort"
codegen-units = "1"
[build.debug]
opt_level = "1"
debug = false
warnings = ["all", "error"]
```
## Target-specific profiles
```toml
[build.linux]
cflags = ["-DLINUX"]
[build.windows.debug]
cflags = ["-DWIN32", "-O0", "-g"]
```
Application order (highest priority first):
1. `[build.\<target>.\<profile>]`
2. `[build.\<profile>.\<target>]`
3. `[build.\<target>]`
4. `[build.\<profile>]`
5. `[build]`

View File

@@ -0,0 +1,136 @@
---
sidebar_label: Build system
---
# Build System
## Compiler Backends
DCR supports 7 compilation backends. Selection is automatic based on file extension and `build.compiler` value.
| Backend | Files | When used |
| --------- | --------------------------------- | ------------------------------------- |
| `unix_cc` | `.c`, `.cpp`, `.cxx`, `.cc`, `.S` | gcc/clang on Linux/macOS/BSD |
| `msvc` | `.c`, `.cpp`, `.cxx`, `.cc` | Windows (cl, clang-cl) |
| `gas` | `.s` | ARM/ARM64 assembler (no preprocessor) |
| `nasm` | `.asm`, `.s` | x86/x86_64 NASM assembler |
| `masm` | `.asm` | MASM (ml/ml64) on Windows |
| `fasm` | `.asm`, `.fasm` | Flat Assembler |
| `llvm_ir` | `.ll` | LLVM IR via `llc -filetype=obj` |
## Qt Support
DCR provides native Qt support for automatic meta-object handling (MOC, UIC, RCC).
Enable it by setting `build.qt = true` in `dcr.toml`. DCR will automatically detect Qt-related files (`.ui`, `.qrc`, `.h` with `Q_OBJECT`) and process them.
```toml
[build]
qt = true
```
*Note: Requires `qt6` modules (Core, Widgets, Gui, Svg) installed via `pkg-config`.*
Advanced customization is still possible via `build.steps` if special handling is needed:
```toml
[build.steps]
moc = "moc {in} -o {out}"
```
### Unix CC
* Compiler resolved via `resolve_compiler()`: `DCR_COMPILER` > `DCR_CC` > `[toolchain]` > `build.compiler` > `PATH`
* Supports `.d` files for header dependency tracking
* Flags: `-std=`, `-MMD -MF`, `-c -o`, `-I`, `-L`, `-l`
* Conditional flags based on config:
* `freestanding` or bare-metal target: `-ffreestanding` (compile), `-nostdlib -static` (link)
* `lto`: `-flto` (compile + link)
* `panic = "abort"`: `-fno-exceptions` (C++ only), `-fno-unwind-tables`, `-fno-asynchronous-unwind-tables`
### MSVC
* Supports cl.exe and clang-cl.exe
* Flags: `/std:`, `/Fo:`, `/Fe:`, `/I`, `/link`
### GAS / NASM / MASM / FASM / LLVM-IR
* GAS: `-I`, `-c -o`, `--defsym`
* NASM: `-I`, `-o`, `-D`, `-f` (format: win64/elf64/macho64/macho32/elf32; **`bin` when `kind = "flat-bin"`**)
* MASM: `/nologo /c /Fo\<obj> <source>`
* FASM: `<source> \<output>` (output path is the object file)
* LLVM IR: `-filetype=obj <source> -o \<output>`
## Incremental Builds
Three levels of incrementality:
1. **mtime** — if output is newer than all inputs, skip
2. **`.d` files** — header change tracking (including transitive)
3. **SHA256 fingerprint** — recompile if compiler flags changed (stored in `.dcr_fingerprint`)
## Parallel Compilation
* `thread::scope` for thread pool
* Atomic task queue (`AtomicU64`)
* Mutex on stdout (`OUTPUT_MUTEX`)
* Thread count = `available_parallelism()`, capped by `build.codegen-units` if set
## Build Kinds
| Kind | Type | Path (Linux example) |
| ----------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `bin` | Executable | `target/\<triple>/\<profile>/\<name>` (.exe on Windows) |
| `staticlib` | Static library | `target/\<triple>/\<profile>/lib\<name>.a` (.lib) |
| `sharedlib` | Dynamic library | `target/\<triple>/\<profile>/lib\<name>.so` (.dll/.dylib) |
| `efi` | UEFI application | `target/\<triple>/\<profile>/\<name>.efi` |
| `elf` | ELF without stdlib | `target/\<triple>/\<profile>/\<name>` |
| `none` | Compile only, no link | — |
| `custom` | Full filename+extension control | `target/\<triple>/\<profile>/\<filename>.\<extension>` |
| `flat-bin` | Raw binary | ASM: `\<stem>.bin` (NASM `-f bin` / FASM / GAS·MASM·LLC via objcopy); C/C++: `\<name>.bin` (link + objcopy) |
## Disk images (`[archive]`)
After a successful build, if `[archive]` is present in `dcr.toml`, DCR formats a FAT volume and copies files from `layout` into the image. See [dcr.toml → archive](/docs/reference/dcr-toml#archive).
## Build Steps
DCR supports pre-build and post-build steps:
* `build.steps` — commands before compilation
* `build.post_steps` — commands after compilation
Substitutions: `{stem}`, `{in}`, `{out}`, `{profile}`, `{version}`, `{name}`.
Example Qt codegen via build steps:
```toml
[build.steps]
moc = "moc {in} -o {out}"
```
## pkg-config
Automatic lookup (read from raw config):
```toml
[build]
pkg_config = ["sdl2", "gl"]
```
DCR runs `pkg-config --cflags sdl2 gl` and `pkg-config --libs sdl2 gl` and adds results to compiler/linker flags.
## Variable Substitution
Supported variables:
| Variable | Description |
| ----------------------- | ---------------------------- |
| `{version}` | Package version |
| `{version_major}` | Major version part |
| `{version_minor}` | Minor version part |
| `{version_patch}` | Patch version |
| `{version_suffix}` | Suffix (e.g., `-rc1`) |
| `{version_suffix_dash}` | Suffix with dash |
| `{profile}` | Profile name (debug/release) |
| `{name}` | Package name |

View File

@@ -0,0 +1,64 @@
---
sidebar_label: Cross-compilation
---
# Cross-Compilation
## Short Names
DCR supports short platform names:
| Short Name | Full Triple |
| ---------- | -------------------------- |
| `linux` | `x86_64-unknown-linux-gnu` |
| `macos` | `x86_64-apple-darwin` |
| `windows` | `x86_64-pc-windows-msvc` |
```bash
dcr build --target windows
```
## Full Triples
```bash
dcr build --target aarch64-unknown-linux-gnu
dcr build --target x86_64-pc-windows-gnu # mingw
dcr build --target armv7-unknown-linux-gnueabihf
```
## clang --target
When using clang, DCR injects `--target=\<triple>` into CFLAGS.
```toml
[build]
compiler = "clang"
target = "aarch64-unknown-linux-gnu"
# Auto: cflags += ["--target=aarch64-unknown-linux-gnu"]
```
## Bare-Metal / Freestanding
For targets containing `none`, `-elf`, `eabi`, or `baremetal`, DCR automatically:
1. **Disables default flags** — no system include paths, no `-l` libc
2. **Injects `-ffreestanding`** at compile time and `-nostdlib -static` at link time
You can also enable freestanding mode explicitly:
```toml
[build]
freestanding = true
```
```bash
dcr build --target aarch64-none-elf
```
## Target Directory
By default, the compilation output directories are structured as follows:
* **Linux and BSD**: Always output to `target/\<triple>/\<profile>/` (using host triple if no target is specified).
* **macOS and Windows (without target)**: Output to `target/\<profile>/`.
* **macOS and Windows (with explicit target)**: Output to `target/\<triple>/\<profile>/`.

View File

@@ -0,0 +1,263 @@
---
sidebar_label: dcr.toml overview
---
# dcr.toml
Main project configuration file. Located at the project root.
## Structure
```toml
[package]
# required fields
[build]
# build settings
[build.debug] # optional: debug override
[build.release] # optional: release override
[build.linux] # optional: Linux override
[build.windows] # optional: Windows override
[build.windows.debug] # target + profile combination
[toolchain]
# compiler/linker paths
[dependencies]
# project dependencies
[workspace]
# multi-package configuration
[run]
# run settings
[archive]
# optional: pack FAT disk image after build
```
## [package]
| Field | Required | Description |
| --------- | -------- | ------------------------------------------- |
| `name` | yes | Project name |
| `version` | yes | Semantic version |
| `type` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `license` | no | SPDX license identifier |
| `author` | no | Author |
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "app"
license = "MIT"
author = "John Doe"
```
## [build]
...
* `build.qt` — (bool) Enable automatic Qt meta-object handling (MOC, UIC, RCC). Requires `qt6` modules installed via `pkg-config`.
| Field | Default | Description |
| ---------------- | ------------- | --------------------------------------------------------------------------------------------------------- |
| `language` | `"c"` | `"c"`, `"c++"`, `"cpp"`, `"cxx"`, `"asm"`, `"llvm_ir"`, `"llvm-ir"`, `"ll"` (optional, defaults to `"c"`) |
| `standard` | `"c11"` | C standard (`c11`, `c17`, `c23`) |
| `cxx_standard` | — | C++ standard (`c++17`, `c++20`, `c++23`) |
| `compiler` | `"clang"` | Preferred compiler (optional, defaults to `"clang"`) |
| `kind` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom`, `flat-bin` |
| `target` | host | Target triple for cross-compilation |
| `platform` | `"native"` | `native`, `efi` |
| `cflags` | `[]` | Additional C/C++/ASM flags |
| `ldflags` | `[]` | Additional linker flags |
| `filename` | `""` | Custom output file name |
| `extension` | `""` | Custom file extension (for `flat-bin`, default is `bin`) |
| `roots` | `["src"]` | Source roots: directories and/or individual source/header files |
| `exclude` | `[]` | Exclude patterns |
| `include` | `[]` | Additional include directories |
| `src_disable` | `false` | Disable auto source discovery |
| `inherit` | `false` | Inherit build from workspace root |
| `clean` | `[]` | Glob patterns for custom clean paths |
| `out_dir` | `""` | Custom output directory |
| `workspace_only` | `false` | Workspace-only, not built standalone (no `language`/`compiler` required) |
| `freestanding` | `false` | Compile in freestanding mode (`-ffreestanding` + `-nostdlib -static`) |
| `opt_level` | — | Optimization level: `0`-`3`, `"s"`, `"z"` (derived from profile if omitted) |
| `debug` | profile-based | Emit debug symbols (`-g`): `true` in debug, `false` in release |
| `lto` | `false` | Link-time optimization (`-flto` for both compiler and linker) |
| `strip` | `false` | Strip symbols from output (`-s` in ldflags) |
| `warnings` | `[]` | Warning flags (e.g. `"all"`, `"extra"`, `"pedantic"`); engine adds `-Wall -Wextra` in debug if empty |
| `panic` | `""` | Panic strategy: `"abort"` disables exceptions and unwind tables |
| `codegen-units` | `""` | Max parallel compilation jobs (`"0"` = auto) |
| `qt` | `false` | Enable automatic Qt meta-object handling (MOC, UIC, RCC) |
Settings from raw config (not in typed struct):
* `pkg_config` — list of pkg-config packages
* `ldscript` — linker script path
* `build.steps` / `build.post_steps` — codegen steps
## Per-language overrides: `[build.c]`, `[build.cxx]`, `[build.asm]`, `[build.llvm_ir]`
Each language can have its own table that overrides the flat `[build]` settings:
```toml
[build]
compiler = "clang"
standard = "c11"
[build.c]
standard = "c23"
compiler = "gcc"
[build.cxx]
standard = "c++23"
compiler = "g++"
[build.asm]
compiler = "nasm"
flags = ["-felf64"]
[build.llvm_ir]
compiler = "llc"
```
The flat `[build]` acts as fallback; per-language tables take precedence for their language.
Example:
```toml
[build]
language = "c++"
standard = "c23"
cxx_standard = "c++23"
compiler = "clang"
kind = "sharedlib"
cflags = ["-Wall", "-Wextra"]
opt_level = "z"
lto = true
strip = true
panic = "abort"
codegen-units = "2"
```
## [toolchain]
```toml
[toolchain]
cc = "/usr/bin/clang"
cxx = "/usr/bin/clang++"
as = "/usr/bin/as"
ar = "/usr/bin/ar"
ld = "/usr/bin/ld.lld"
```
Raw config also supports `uic`, `moc`, `rcc` for Qt codegen.
## [dependencies]
See [dependencies](/docs/reference/dependencies).
## [run]
```toml
[run]
cmd = "./target/{profile}/{name}"
```
Substitutions:
* `{version}` — package version
* `{version_major}`, `{version_minor}`, `{version_patch}`, `{version_suffix}`, `{version_suffix_dash}` — version parts
* `{profile}` — debug / release
* `{name}` — package name
Default `cmd` = `./target/{profile}/{name}` (macOS/Windows) or `./target/\<triple>/\<profile>/\<name>` (Linux).
## [workspace]
See [workspaces](/docs/reference/workspaces).
## [archive]
Optional post-build step: format a FAT volume and copy built artifacts into a disk image. Runs after a successful package build (and after workspace member builds that define `[archive]`).
Requires DCR built with the `archive` Cargo feature (`cargo build --features archive`). Release binaries include this feature.
| Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) |
| `format` | yes | `fat12`, `fat16`, or `fat32` |
| `size` | no | Image size: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default `1474560` ≈ 1.44 MiB) |
| `offset` | no | Byte offset of the FAT volume inside the image (default `0`) |
| `label` | no | Volume label (max 11 chars, default `VOLUME`) |
| `bootsector` | no | Path to a 512-byte boot sector written at offset 0 when `offset` is 0 (`{profile}` allowed) |
| `layout` | no | List of `{ from, to }` entries (files or globs → path inside the volume) |
```toml
[archive]
output = "target/{profile}/disk.img"
format = "fat12"
size = "1440K"
label = "MYOS"
bootsector = "target/{profile}/boot.bin"
[[archive.layout]]
from = "target/{profile}/kernel.bin"
to = "KERNEL.BIN"
[[archive.layout]]
from = "assets/*"
to = "/"
```
Typical pairing with `kind = "flat-bin"` (NASM `-f bin`) for bootloaders and pure-ASM OS images.
## `flat-bin` (kind)
Produces a raw binary (default extension `bin`) for boot sectors, kernels, and freestanding payloads.
### Assemblers
| Tool | Language / compiler | How flat-bin is produced |
| ---- | ------------------------------------------ | -------------------------------------------- |
| NASM | `language = "asm"`, `compiler = "nasm"` | `-f bin` → `\<stem>.bin` |
| FASM | `compiler = "fasm"` | direct write (use `format binary` in source) |
| GAS | `compiler = "as"` / `"gas"` | assemble → `objcopy -O binary` |
| MASM | `compiler = "ml"` / `"ml64"` | assemble → `objcopy -O binary` |
| LLC | `language = "llvm_ir"`, `compiler = "llc"` | `-filetype=obj` → `objcopy -O binary` |
```toml
[build]
language = "asm"
compiler = "nasm"
kind = "flat-bin"
extension = "bin"
roots = ["src/boot.asm"]
```
### C / C++
Compile all sources, link with `-nostdlib -static` (plus your `ldflags` / `ldscript`), then convert the intermediate ELF/PE with `objcopy -O binary` to `\<filename|name>.bin`.
```toml
[build]
language = "c"
compiler = "clang"
kind = "flat-bin"
freestanding = true
filename = "kernel"
extension = "bin"
ldscript = "linker.ld"
ldflags = ["-T", "linker.ld"]
```
Notes:
* Multi-file **ASM** packages emit one `\<stem>.bin` per source; **C/C++** emit a single project binary.
* `objcopy` tools tried in order: `llvm-objcopy`, `objcopy`, `gobjcopy`.
* Incompatible with `build.qt = true`.
* `dcr run` rejects `flat-bin` (not a host executable).

View File

@@ -0,0 +1,84 @@
---
sidebar_label: Dependencies
---
# Dependencies
## Formats
The `[dependencies]` section supports three formats:
### String (registry)
```toml
[dependencies]
fmt = "10.1.1"
spdlog = "1.12"
catch2 = "3.4.0"
```
The version string is used as-is for registry lookup.
### Table (git)
```toml
[dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" }
```
Fields: `git`, `branch`, `tag`, `rev`.
### Table (path)
```toml
[dependencies]
mylib = { path = "../mylib" }
```
## Registry
DCR uses a package registry for dependency lookup by name.
```toml
# ~/.dcr/config.toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
## Git dependencies
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
* `branch` — switch to a branch
* `tag` — switch to a tag
* `rev` — switch to a specific commit
* `features` — feature flags (parsed, but does not affect build)
## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
```toml
[dependencies]
mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" }
```
*Note: Header resolution automatically checks the packaged `target/include` directory of path dependencies, ensuring consumer packages can find headers from compiled static or dynamic libraries.*
## dcr.lock
Dependency lock file. Contains package names and sources.
Created during `dcr build` when registry dependencies are present. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process
1. Load all dependencies (registry → git → path)
2. For path deps: recursively read their `dcr.toml`
3. For registry deps: search `index.json`
4. For git deps: clone to cache
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -0,0 +1,60 @@
---
sidebar_label: Environment variables
---
# Environment Variables
## DCR_COMPILER
Overrides the compiler for all languages. **Highest priority.**
```bash
export DCR_COMPILER=clang
dcr build
```
Compiler resolution priority:
1. `DCR_COMPILER` (env)
2. `DCR_CC` / `DCR_CXX` / `DCR_AS` (env)
3. `[toolchain]` (dcr.toml)
4. `build.compiler` (dcr.toml)
5. `PATH`
## DCR_CC / DCR_CXX / DCR_AS
Per-language override (lower priority than `DCR_COMPILER`, higher than `[toolchain]`).
```bash
export DCR_CC=gcc-14
export DCR_CXX=g++-14
export DCR_AS=arm-linux-gnueabihf-as
```
## DCR_LD / DCR_AR
Override linker and archiver.
```bash
export DCR_LD=ld.lld
export DCR_AR=llvm-ar
```
## DCR_DEBUG
Enables debug mode — prints all compilation commands to stderr before execution.
```bash
export DCR_DEBUG=1
dcr build
```
## DCR_INDEX_PATH
Overrides the path to the registry `index.json`.
```bash
export DCR_INDEX_PATH=/custom/path/index.json
```
Default: `~/.dcr/index.json`.

View File

@@ -0,0 +1,53 @@
---
sidebar_label: Platform support
---
# Platform Support
## Target Triples
DCR normalizes target triples. Short platform names are expanded to full triples.
### Linux
```
target/<arch>-unknown-linux-<env>/<profile>/
```
Architectures: `x86_64`, `aarch64`, `i686`, `armv7`, `riscv64` (host-detected).
Environments: `gnu` (default), `musl`.
Artifact type: ELF. Extensions: `.so` (sharedlib), `.a` (staticlib).
### macOS
```
target/<profile>/ (default) or target/<triple>/<profile>/ (with target)
```
Architectures: `x86_64`, `aarch64` (host-detected).
Extensions: `.dylib` (sharedlib), `.a` (staticlib).
### Windows
```
target/<profile>/ (default) or target/<triple>/<profile>/ (with target)
```
Architectures: `x86_64`, `aarch64`.
Environments: `msvc` (default), `gnu` (MinGW).
Extensions: `.exe` (bin), `.lib` (staticlib), `.dll` (sharedlib), `.efi` (UEFI).
### BSD
```
target/<arch>-unknown-<os>/<profile>/
```
Supported systems: `freebsd`, `openbsd`, `netbsd`, `dragonfly`.
## Host Detection
DCR uses `std::env::consts::ARCH` and `std::env::consts::OS` for host platform detection. Used as fallback when `target` is not specified.

View File

@@ -0,0 +1,88 @@
---
sidebar_label: Workspaces
---
# Workspaces
Workspaces allow managing multiple packages in a single repository.
## Configuration
```toml
[workspace.lib-core]
path = "lib-core"
[workspace.lib-utils]
path = "lib-utils"
deps = ["lib-core"]
[workspace.app]
path = "app"
deps = ["lib-core", "lib-utils"]
main = true
```
### Member fields
| Field | Description |
| ------ | ------------------------------------------------ |
| `path` | Path to the package (relative to workspace root) |
| `deps` | Dependencies on other members |
| `main` | Mark as the main package |
## Topological sort
DCR automatically sorts packages by dependencies: package A is built before B if B depends on A.
Cyclic dependencies are detected and cause an error.
## Build
```bash
dcr build # build all packages in dependency order
dcr build --workspace app # build only app (dependencies built automatically)
```
When building a workspace, DCR automatically injects include and library paths of dependent workspace members:
* **Include Paths**: Automatically resolves and injects header directories of dependencies, including the member's `src/` directory, local `include/` directory, and the packaged `target/include` directory.
* **Library Paths**: Injects compiled library search paths (`target/lib` as well as target-specific build folders) to allow automatic linking with member libraries.
## Clean
```bash
dcr clean # clean only root target/
dcr clean --all # clean target/ of all packages
```
## Inheritance
If a member has `inherit = true` in its `[build]` section, fields from the root `[build]` are merged into the member:
```toml
# root dcr.toml
[build]
inherit = true
language = "c"
standard = "c17"
# member inherits language and standard
```
## Workspace-only root (no build of its own)
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
```toml
[package]
name = "my-workspace"
version = "0.1.0"
[build]
workspace_only = true
kind = "bin"
[workspace]
lib-core = { path = "lib-core" }
app = { path = "app", deps = ["lib-core"] }
```

View File

@@ -0,0 +1,46 @@
---
sidebar_label: Self Update
---
# Self Update
## dcr --update
Automatic update to the latest version. Downloads a binary (not an archive) from GitHub Releases and replaces the current executable.
```bash
dcr --update
```
## How it works
1. DCR detects the current platform and architecture
2. Fetches the latest release from `api.github.com/repos/dexoron/dcr/releases/latest`
3. Compares versions
4. Downloads the matching asset (direct binary URL, not archive)
5. Replaces the current executable via `self_replace`
## Asset naming
Pattern: `dcr-\<triple>` or `dcr-\<triple>.exe`
| Platform | Asset name |
| -------------- | -------------------------------- |
| Linux x86_64 | `dcr-x86_64-unknown-linux-gnu` |
| macOS x86_64 | `dcr-x86_64-apple-darwin` |
| macOS ARM64 | `dcr-aarch64-apple-darwin` |
| Windows x86_64 | `dcr-x86_64-pc-windows-msvc.exe` |
## AUR
If DCR was installed via AUR, `--update` shows a warning:
```
Update via package manager: yay/paru -Syu {package_name} or sudo pacman -Syu {package_name}
```
## Errors
* Cannot detect platform — error
* Cannot fetch release — error with URL
* No write permission — error (use `sudo` or manual install)

View File

@@ -0,0 +1,45 @@
---
sidebar_label: Running tests
---
# Running Tests
## Execution
```bash
dcr test
```
Builds the project, then compiles and runs test files from `tests/`.
## Profiles
```bash
dcr test # debug (default)
dcr test --release # release
dcr test --debug # explicit debug
```
## Output
```
=====================
Testsuite summary
=====================
TOTAL: 5
PASS: 3
SKIP: 1
FAIL: 1
=====================
```
## Exit code
* 0 — all tests passed (FAIL = 0)
* 1 — test failures or build error
## What gets built
* All `.c` files from `tests/` (`.cpp` not supported)
* Include path: `tests/` (for `dcr_test.h`)
* Linked with project if `package.type = "lib"` or `kind = "staticlib"`/`"sharedlib"`

View File

@@ -0,0 +1,69 @@
---
sidebar_label: Test framework (EXPECT, TEST, ...)
---
# Test Framework
DCR has a built-in minimal test framework for C.
## Macros
### `EXPECT(expr)`
Asserts that an expression is true.
```c
EXPECT(1 + 1 == 2);
EXPECT(ptr != NULL);
```
### `SKIP(reason)`
Skips a test with a message.
```c
SKIP("not implemented on Windows");
```
### `TEST(name)`
Defines a test.
```c
TEST(addition) {
EXPECT(1 + 1 == 2);
EXPECT(2 + 2 == 4);
}
```
### `TEST_CASE(name)`
Registers a test case.
```c
TEST_CASE(math) {
EXPECT(1 + 1 == 2);
}
```
## Initialization
```bash
dcr test --init
```
Creates:
* `tests/dcr_test.h` — framework header (do not edit)
* `tests/test.c` — template with example test
## Structure
```
tests/
├── dcr_test.h # framework (do not edit)
├── test.c # main tests
└── ... # additional .c test files
```
Only `.c` files are compiled (`.cpp` is not supported).

View File

@@ -0,0 +1,66 @@
---
sidebar_label: Introduction
---
# DCR — C/C++ Build Tool & Package Manager
<details>
<summary>Quick reference</summary>
```bash
# Installation (dcrup)
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
# Create a project
dcr new my-app
cd my-app
# Build and run
dcr build
dcr run
# Run tests
dcr test
# Add a dependency
dcr add fmt
# Generate IDE files
dcr gen vscode
```
</details>
## Contents
| Section | Description |
| ----------------------------------------------------- | --------------------------------------------- |
| [Getting Started](/docs/getting-started/installation) | Installation and first steps |
| [Commands](/docs/commands/project-commands) | All CLI commands |
| [Reference](/docs/reference/dcr-toml) | Configuration, build, dependencies, platforms |
| [Testing](/docs/testing/test-framework) | Built-in test framework |
| [Recipes](/docs/recipes/cross-to-windows) | Common scenarios |
| [IDE Integration](/docs/ide-integration) | VS Code, CLion, compile_commands.json |
| [Self Update](/docs/self-update) | Auto-update |
| [FAQ](/docs/faq) | Frequently asked questions |
| [Changelog](/docs/changelog) | Version history |
| [License](/docs/license) | DCR and vendored library licenses |
| [Contributing](/docs/contributing) | DCR development |
## Features
* **Incremental builds** — mtime + `.d` headers + SHA256 fingerprint
* **Parallel compilation** — thread::scope, atomic task queue
* **7 backends** — gcc/clang (unix_cc), MSVC/clang-cl (msvc), GAS, NASM, MASM, FASM, LLVM IR
* **8 project kinds** — bin, staticlib, sharedlib, efi, elf, none, custom, flat-bin
* **Disk images** — optional `[archive]` packs FAT12/16/32 images after build
* **Cross-compilation** — short names and full triples
* **Profiles** — debug / release with field overrides
* **Workspaces** — multi-package projects with topological sort
* **Registry + Git + Path** — three dependency mechanisms
* **IDE generation** — VS Code, CLion, compile_commands.json, JSON metadata
* **pkg-config** — automatic system library discovery
* **Per-command `--help`** — `dcr build --help`, `dcr new --help`, etc.
* **Man pages** — `man dcr`, `man dcr-build`, `man dcr-new`

View File

@@ -0,0 +1,259 @@
---
sidebar_label: Changelog
---
# Changelog
## 0.8.4 (2026-08-04)
**Added:**
* **`.dcr/` directory** — shared machine-readable build facts for IDE integrations:
* `.dcr/compile_commands.json`
* `.dcr/build-info.json` (`schemaVersion`, `artifact_path`, `profile`, …)
* `.dcr/toolchain.json` (compiler/debugger paths, moc/uic/rcc)
* `.dcr/ide/` (placeholder for IDE lock files)
* **`dcr gen project-info`** — `target`, `target_dir`, `artifact_path`, `artifact_kind`, `source_roots`, `include_globs`, `exclude_globs`; absolute/canonical paths.
* **`dcr build --print-artifact-path`** — one absolute artifact path line on stdout after a successful build.
* **`dcr gen … --quiet` / `-q`** — suppress human success logs for gen subcommands.
* **`.clangd`** — created on first gen with `CompilationDatabase: .dcr` (`# managed by dcr gen`); custom `.clangd` is not overwritten.
* **Helpers** `canonicalize_path`, `atomic_write`, `ensure_dcr_dir`; pure `resolve_artifact_path` via `platform::*`.
* **`dcr new` / `dcr init`** — add `.dcr/` to `.gitignore`.
**Changed (breaking):**
* **`compile_commands.json` moved** from project root to **`.dcr/compile_commands.json`**.\
clangd discovers it via `.clangd` / `--compile-commands-dir=.dcr`.\
CLion and VSCode generators updated accordingly.
* **Atomic write** for compile_commands (tmp + rename).
* **`gen vscode` / `gen clion` launch/run** — use the same artifact path resolver as `project-info` / `build-info.json`.
**Fixed:**
* Launch configs no longer hardcode `target/\<profile>/\<name>` without the Linux triple segment.
* Symlink/mount roots: best-effort canonicalize for root and compile database paths.
## 0.8.3 (2026-08-03)
### Added
* **`dcr run -- \<args>...`** — cargo-style argument forwarding after a bare `--`\
(`dcr run --release -- --test_help`). Applies to direct binary runs and `[run].cmd`.
* **Tests** — host target section `ldflags` without CLI `--target`; run-arg forwarding; `split_double_dash` unit tests.
### Changed
* **Native builds resolve the host triple** — without `--target` / package `build.target`, host sections such as\
`[build.x86_64-unknown-linux-gnu]` apply again (`cflags` / `ldflags` / toolchain).\
Previously the target was empty and those sections were ignored while artifacts already used the host triple path.
* **Empty target** — no more `Unknown target ''` warning.
* **`dcr run --help` / man `dcr-run`** — document `--` forwarding.
### Fixed
* **Native artifact paths on Windows and macOS** — without an explicit `--target` / `build.target`, artifacts use `target/\<profile>`, so `dcr run` and flat-bin find the build output.
* Target-specific `ldflags` missing on native host builds (e.g. micro-lang + `libsct-elf`).
* Spurious empty-target warning.
## 0.8.2 (2026-07-22)
### Added
* **Compile progress `[N/M]`** — live TTY status line (`compile pkg v0.1.0 [12/41]`) so long mono-package builds do not look hung.
* **DCR status style** — fixed-width verbs: `project`, `compile`, `dep`, `ready`, `pack`, `done`, `run`.
* **Cargo feature `archive`** — optional FAT packing via `fatfs` (`cargo build --features archive`). Release CI builds with the feature; without it `[archive]` fails with a clear message.
* **Tests** — `flat_bin_nasm_build`, package `build.target` without CLI `--target`, stricter workspace `clean --all`.
* **CI expansion** — unit + integration on Linux/macOS/Windows, archive feature job, rust-cache, clippy default + all-features (see `.github/workflows/ci.yml`).
### Changed
* **No forced host triple from CLI** — without `--target`, package/member `build.target` is honored (bare-metal / ISO `post_steps` paths).
* **Relative include/lib flags** (`-I`, `-i`, `-isystem`, `-idirafter`, `-L`, `-T`) absolutized against the package root under workspace builds.
* **`dcr clean --all`** — no spam for members without a local `target/` (shared root `target/`).
* **`error` / `warn`** — red / yellow on stderr; CLI fully English (`Hint:`).
* **Help / man** — list `add`, `lint`, `setup`; unknown command exits with code 1.
* **Tool NotFound** — `linker not found: ld.lld …` / `{tool} not found …` instead of raw `os error 2`.
## 0.8.1 (2026-07-20)
### Added
* **`build.kind = "flat-bin"`** — raw binary (default `.bin`) for OS-dev payloads:
* **NASM** — `-f bin` → `\<stem>.bin`
* **FASM** — direct output (`format binary` in source)
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — FAT12/16/32 disk images after build (`output`, `format`, `size`, `offset`, `label`, `bootsector`, `layout`). From 0.8.2 requires feature `archive`.
* **Single-file `build.roots`** — a root may be a single source or header file, not only a directory.
### Changed
* **`--force`** also re-runs `build.steps` and `build.post_steps`.
* **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
## 0.8.0 (2026-07-18)
### Added
* **Dedicated Build Engine (`src/core/build/engine.rs`)** — decoupled the build orchestration logic completely from the CLI front-end wrapper in `src/cli/build.rs` to a reusable, decoupled core build engine.
* **Polymorphic Language Model (`Language` trait)** — introduced the abstract `Language` trait (`src/core/build/language/mod.rs`). File scanning, compiler resolution, and flags handling are now encapsulated in dedicated language modules for C, C++ (including Qt code generation), LLVM IR, and ASM (GAS, NASM, FASM, MASM).
* **Polymorphic Compilation Dispatch (`Builder` trait)** — introduced the `Builder` trait to generalize builder invocations (`src/core/build/builder/mod.rs`). Consolidated GCC/Clang logic into `builder/cc_common.rs` and Microsoft Visual C++ logic into `builder/msvc/`.
* **Per-Language Configuration overrides (`[build.\<lang>]`)** — introduced support for configuring language-specific compiler, standard, and flags (e.g. `[build.c]`, `[build.cxx]`, `[build.asm]`) independently in `dcr.toml`.
* **Automatic Workspace Dependency Injection** — during workspace builds, include/lib paths of dependent workspace members (including their source headers, local `include/` folders, and build target `target/include` / `target/lib` folders) are automatically resolved and injected.
* **`BuildReporter` Event System** — decoupled build orchestration output into a structured event-driven reporter model (`src/core/build/report.rs`), making DCR suitable for library embedding and IDE integrations without stderr capturing.
* **Build Cancellation Support** — introduced thread-safe cancellation tokens (`Arc\<AtomicBool>`) allowing clients to safely abort compile runs mid-execution.
* **TOML Formatting & Custom Keys Preservation** — migrated the config editor to `toml_edit`, preserving all unknown/user-defined TOML keys, structures, and comments during file write operations (e.g., in `dcr add`).
* **Path Dependencies Target Include Resolution** — local path dependencies configured via tables now correctly expose headers built and packaged into their `target/include` folder to consumer packages.
* **Modular Integration Test Suite** — refactored the monolith `tests/cli_basic.rs` file into clean, specialized integration tests: `cli_build.rs`, `cli_deps.rs`, `cli_lint.rs`, `cli_new.rs`, `cli_qt.rs`, `cli_test.rs`, `cli_workspace.rs`.
### Changed
* **Consolidated Linking and Archiving** — artifact generation (linking executables/shared libraries and archiving static libraries) consolidated into a single `src/core/build/builder/artifact.rs` module.
* **Workspace-Aware member execution** — `dcr run` executed at the workspace root of a `workspace_only` project now triggers the member build inside the workspace context using the `--workspace` parameter, preventing standalone build issues.
* **Elimination of Global State** — removed global variables and states from the build core, encapsulating build logic inside isolated `BuildContext` structs for thread safety.
* **Build Cache Separation** — relocated mtime tracking, incremental caching, and header-dependency checking logic to `src/core/build/cache.rs`.
* **Modularized Pre-build Steps** — decoupled generator scripts and pre-build commands parsing into `src/core/build/steps.rs`.
## 0.7.4 (2026-06-17)
### Added
* **Native Qt support** — automatic meta-object handling (MOC, UIC, RCC) added when `build.qt = true` is set in `dcr.toml`.
* **`dcr lint` command** — C/C++ static analysis via `clang-tidy`. Supports `--fix` for automatic fixes. Respects `build.roots` and `build.src_disable` from config.
* **Three new assembler backends**:
* **MASM** (`compiler = "ml"` / `"ml64"`) — Microsoft Macro Assembler.
* **FASM** (`compiler = "fasm"`) — Flat Assembler.
* **LLVM IR** (`compiler = "llc"`) — compiles `.ll` files via `llc -filetype=obj`.
* **Shared ASM pipeline** — linking and archiving logic consolidated into `core/builder/asm.rs`. Adding a new assembler backend now takes ~30 lines.
* **Filesystem utilities** — `to_hex()` and `home_dir()` extracted to `utils/fs.rs`.
* **Build utilities** — `normalize_target()`, `normalize_kind()`, `normalize_platform()`, `default_profile_flags()` extracted to `utils/build.rs`.
* **Backend helpers** — `asm_lang_flag()`, `source_extensions()`, `elapsed_secs()` added to `core/builder/common.rs`.
* **Full Bare-Metal / Freestanding Automation** — introduced the `build.freestanding = true` configuration option. When enabled (or when a bare-metal target is detected), DCR automatically injects `-ffreestanding` during compilation and both `-nostdlib` and `-static` during linking.
* **Artifact Optimization (LTO & Strip)** — added `build.lto` (auto-injects `-flto` for compiler and linker) and `build.strip` (automatically strips debug symbols via linker `-s` flag) options to `dcr.toml`.
* **Compilation Thread Control** — added the `build.codegen-units` option to strictly limit the maximum number of parallel jobs utilized by the custom `parallel_build` worker pool.
* **Panic Behavior Management** — added `build.panic = "abort"` support. For C++ targets, it automatically strips exception handling and unwind tables via `-fno-exceptions`, `-fno-unwind-tables`, and `-fno-asynchronous-unwind-tables`.
### Changed
* **Intelligent Default Flags Generation** — automated injection of fallback optimization (`-O3`/`-O0`), debug (`-g`), and warning (`-Wall -Wextra`) flags is now suppressed for bare-metal and freestanding builds if `build.cflags` are overridden.
* **Centralized Bare-Metal Detection** — relocated the `is_bare_metal_target` helper to common build utilities (`src/utils/build.rs`) for unified access across the building core.
* **Architectural Refactoring**:
* Renamed `src/config.rs` to `src/templates.rs`.
* Started consolidation of configuration and build orchestration logic.
## 0.7.3 (2026-06-13)
### Added
* **`--vcs` option for `new` and `init` commands** — introduced explicit version control system selection via `--vcs \<git|none>`.
* **Git metadata integration in `--version`** — the CLI now appends the current short commit hash and a `-dirty` suffix if there are uncommitted changes in the DCR repository.
* **Automatic `.gitignore` generation** — Git repository initialization now automatically writes a `.gitignore` file excluding the `/target` directory.
* **Nested repository prevention** — automatic Git initialization is now skipped if `dcr new` or `dcr init` is executed inside an already existing Git repository.
* **VCS verification tests** — added `new_vcs_options_work` and `init_vcs_options_work` integration tests to ensure reliable repository behavior.
### Changed
* **Complete removal of `git2` dependency** — all Git actions (dependency fetching, VCS setup, status checks) are now delegated to the system `git` executable via `Command`. This simplifies compilation and drops the need for `vendored` and `openssl` features.
* **Migrated from `reqwest` to `ureq`** — replaced the heavy `reqwest` crate in `flag_update.rs` with the lightweight synchronous `ureq 2.10` client, reducing overhead and the final binary size.
## 0.7.2 (2026-06-07)
### Added
* `default_target_triple()` now respects `target_env` — Linux (gnu/musl) and Windows (msvc/gnu) use the correct environment instead of hardcoded values.
### Fixed
* **macOS Apple Silicon builds failed with `_main` undefined** — `--target=` is now passed to ldflags, not just cflags. `default_target_triple()` uses `std::env::consts::ARCH` on macOS instead of hardcoded `x86_64`.
* **GitHub Stars and GPL-3.0 badges not rendering in README** — badge block converted to pure HTML.
### Changed
* Default target resolution extracted into shared `default_target_triple()` — removed duplication across build, run, clean.
## 0.7.1 (2026-06-02)
### Added
* **`--help` for all commands** — `dcr build --help`, `dcr run --help`, `dcr new --help`,
`dcr init --help`, `dcr clean --help`, `dcr add --help`, `dcr fmt --help`,
`dcr setup --help`, `dcr tree --help`, `dcr gen --help`, `dcr --update --help`,
`dcr test --help`. All output uses styled headers (green) and usage lines (cyan).
* **Man pages** — 12 troff pages in `man/man1/`: `dcr.1`, `dcr-build.1`,
`dcr-run.1`, `dcr-new.1`, `dcr-init.1`, `dcr-clean.1`, `dcr-add.1`, `dcr-test.1`,
`dcr-gen.1`, `dcr-fmt.1`, `dcr-tree.1`, `dcr-setup.1`.
* **Man pages in all packaging** — install.sh, install_bsd.sh, AUR PKGBUILD,
Debian (cargo-deb), RPM (cargo-generate-rpm), Nix (postInstall), Homebrew
(resource), Snap, GitHub Release assets.
* **Project name validation** — `dcr init` and `dcr new` now validate names before
creating files. Only ASCII letters, digits, `_` and `-` are allowed.
* **`documentation` and `homepage` fields** — added to `Cargo.toml`.
* **Release profile optimizations** — `opt-level = "z"`, LTO, `codegen-units = 1`,
`panic = "abort"`, `strip = true` for smaller binaries.
* **Linux i686, armv7, riscv64 targets** — added to release workflow and install scripts.
* **Linux musl i686, armv7 targets** — cross-compiled via zigbuild in CI.
* **AUR packages** — `dcr-dev`, `dcr-dev-bin` publishing workflow.
* **Snap publishing** — automated Snapcraft publishing in CI.
* **Snap badge** — in README.
### Changed
* **`validate_package_name` made public** — callable from CLI commands.
* **README platform table** — reorganized: libc variants as separate OS rows,
removed extra columns. Linux architecture list updated.
* **`gen.rs` no-args output** — now uses styled output instead of raw `eprintln!`.
* **`tree.rs`, `fmt.rs`, and `setup.rs`** — now accept arguments for `--help`.
* **README install commands** — `| bash` → `| sh` for POSIX compatibility.
### Fixed
* **`dcr new \<invalid-name>` creates directory then fails** — validation now
happens before any file operations.
* **`dcr init` on invalid directory name** — same fix.
* **Man pages missing in installed packages** — now shipped in all formats.
* **Windows drive letter false positive** — in dependency file parser.
* **CRLF (`\r\n`) breaks dependency parser** — now handles mixed line endings.
* **Newline after backslash not consumed** — in `parse_d_file` escape handling.
## 0.7.0 (2026-06-01)
### Added
* **OpenBSD and NetBSD target support** — full platform routing with dynamic target triples using `std::env::consts::ARCH` and `std::env::consts::OS`. Affects `build`, `run`, `clean` commands and the platform module.
* **`src/platform/bsd.rs`** — new BSD platform module (shared by FreeBSD, OpenBSD, NetBSD) providing `bin_path`, `lib_path`, `elf_path`, `efi_path`, `shared_lib_path`.
* **`build.out_dir` config option** — custom output directory that overrides the default `target/\<triple>/\<profile>` path for final artifacts. Supported in `build`, `run`, and config validation.
* **`dcr fmt` command** — new CLI command that formats all C/C++ source files (`*.c`, `*.cpp`, `*.h`, `*.hpp`) in `src/` and `tests/` using `clang-format`.
* **Incremental linking** — `needs_link()` in `common.rs` checks if any object file is newer than the linked output, skipping unnecessary relinking. Implemented for all backends (`unix_cc`, `msvc`, `gas`, `nasm`).
* **`build.kind = "none"` and `"custom"`** — two new project kinds for special build scenarios that don't produce standard artifacts.
* **`install_bsd.sh`** — POSIX-compliant installation script for BSD systems (FreeBSD, OpenBSD, NetBSD) with binary download and source build modes.
* **Linux ARM64 support in `install.sh`** — added `Linux:aarch64|Linux:arm64` target detection for pre-built binary downloads.
* **BSD OS detection in `install.sh`** — detects FreeBSD, OpenBSD, NetBSD and determines target triple.
* **`rust-toolchain.toml`** — explicit toolchain pinning to `stable` channel.
* **Integration tests** — `build_with_target_config` (verifies `build.target = "linux"`) and `build_with_out_dir` (validates custom output directory).
* **`get_build_string_with_profile` made `pub`** — so `run.rs` can determine custom output directory configuration.
### Changed
* **`build.target` semantics changed** — now strictly contains a target triple (e.g., `x86_64-unknown-linux-gnu`) or short name (`linux`, `macos`, `windows`). No longer used as custom output directory — this functionality moved to `build.out_dir`.
* **`build.standard` made optional** — changed from `String` to `Option\<String>`. Validation only enforces non-empty for non-ASM languages. Skipped in `dcr.toml` output if empty.
* **`dcr run` with `out_dir`** — now determines target directory respecting `build.out_dir` via `get_build_string_with_profile()` from `build.rs`.
* **`collect_sources()` returns empty vector** instead of error when no sources are found, allowing `kind = "none"` or `kind = "custom"` projects with no source files.
* **CI/CD release workflow refactored** — `git2` made target-specific (no vendored-openssl on Windows), Zig-based cross-compilation for non-x86_64 Linux targets, Arch Linux package version cleanup (dashes → dots), `gmake` symlink for NetBSD.
* **README compatibility table** — FreeBSD, OpenBSD, NetBSD build/run status upgraded from "community/best-effort" to "officially supported".
* **Documentation updated** — `build-section.md` describes new `build.target` and `build.out_dir` fields. `target-directory.md` rewritten to clarify the distinction.
### Fixed
* **stdout/stderr not inherited in `dcr run`** — child process output was captured and manually printed, breaking interactive programs. Fixed by switching to `Command::status()`.
* **Race condition in release CI** — matrix build jobs could upload assets to a release that didn't exist yet. Fixed by adding a dedicated `create-release` job.
* **Release GHA — stable toolchain override** — fixed Rust toolchain override issues in CI.
* **Arch Linux package version sanitization** — version strings with dashes (e.g., `0.7.0-dev`) are invalid for `pkgver`. Fixed by replacing dashes with dots.
* **GPG permissions after Docker** — Docker operations changed GPG directory ownership. Fixed by running `chown` after Docker commands.
* **RPM artifact paths** — RPM artifacts were placed in `rpm/x86_64/` instead of `fedora/x86_64/`. Fixed in Dexoron Packages Index workflow.
* **JSON parsing reliability in `install.sh`** — added `jq` as primary parser with `python3` fallback for dev channel release lookup.
### Removed
* **`format_roots()` helper function** — removed from `common.rs`. Was only used by the old error handling path in `collect_sources()`.
* **Per-distribution artifact download steps** — three separate `actions/download-artifact` steps replaced with unified `gh release download --clobber`.

View File

@@ -0,0 +1,47 @@
---
sidebar_label: Build commands (build, run, clean)
---
# Build Commands
## `dcr build`
Builds the project according to `dcr.toml`.
```bash
dcr build # debug profile
dcr build --release # release build
dcr build --debug # explicit debug
dcr build --target aarch64-unknown-linux-gnu
dcr build --force # full rebuild (also re-runs build.steps / post_steps)
dcr build --clean # clean + build
dcr build --verbose # show compilation commands
dcr build --workspace pkg-a # build specific workspace package
```
Artifacts: `target/\<triple>/\<profile>/\<binary-name>` (Linux with explicit target).
With `[archive]` in `dcr.toml`, a FAT disk image is packed after a successful build.
## `dcr run`
Builds (if sources are newer than artifacts) and runs the binary.
```bash
dcr run
dcr run --release
dcr run --force # force rebuild then run
```
On a **workspace-only** root: if `[run].cmd` is set, that command is used after build; otherwise DCR delegates to a workspace member.
## `dcr clean`
Removes `target/` directory (or `target/\<target>/\<profile>`).
```bash
dcr clean
dcr clean --release # target/release/ only
dcr clean --target windows # target/x86_64-pc-windows-msvc/
dcr clean --all # clean all workspace packages
```

View File

@@ -0,0 +1,53 @@
---
sidebar_label: Dependency commands (add, tree)
---
# Dependency Commands
## `dcr add \<name> [source]`
Adds a dependency to `dcr.toml`.
```bash
dcr add fmt # registry lookup
dcr add mylib ../path/to/lib # path as source
dcr add mylib path:./lib # explicit path prefix
dcr add mylib git:https://github.com/user/repo # explicit git prefix
dcr add mylib github:user/repo # GitHub shorthand
dcr add mylib gitlab:user/repo # GitLab shorthand
```
Source prefixes:
* `path:` — local path
* `git:` — generic git URL
* `github:` — expands to `https://github.com/\<user>/\<repo>`
* `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>`
* `http://` / `https://` / `git@` — full URL
Flags:
* `--branch \<name>` — git branch
* `--tag \<name>` — git tag
* `--rev \<hash>` — git commit
If source is omitted — DCR searches connected registries.
## `dcr tree`
Displays the project dependency tree.
```bash
dcr tree
```
Example output:
```
my-app v0.1.0
├── fmt (registry)
│ └── spdlog (registry)
└── catch2 (registry)
```
For path dependencies, recursively shows their own dependencies (from their `dcr.toml`).

View File

@@ -0,0 +1,73 @@
---
sidebar_label: Gen commands (vscode, clion, ...)
---
# Gen Commands
## `dcr gen \<target>`
Generates IDE integration files.
### vscode
```bash
dcr gen vscode
```
Creates:
* `.vscode/tasks.json` — `build` task (dcr build)
* `.vscode/launch.json` — debug launch configuration
* `.vscode/settings.json` — C/C++ settings (clangd paths, includes)
* `.vscode/extensions.json` — recommended extensions (vscode-clangd, vscode-lldb)
### clion
```bash
dcr gen clion
```
Creates:
* `.idea/externalTools.xml` — external tools (build, run, clean, test)
* `.idea/customTargets.xml` — custom build targets
* `.idea/misc.xml` — C/C++ project settings
* `.idea/runConfigurations/\<name>.xml` — per-binary run configurations
### compile-commands
```bash
dcr gen compile-commands
```
Generates `compile_commands.json` — standard format for clangd, cpptools, static analyzers.
### project-info
```bash
dcr gen project-info
```
Outputs JSON array with project metadata:
```json
[
{
"name": "my-app",
"version": "0.1.0",
"root": "/path/to/project",
"profile": "debug",
"language": "c",
"standard": "c17",
"cxx_standard": null,
"compiler": "/usr/bin/clang",
"kind": "bin",
"sources": ["src/main.c"],
"include_dirs": ["src"],
"lib_dirs": [],
"libs": [],
"cflags": ["-std=c17", "-O0", "-g"],
"ldflags": []
}
]
```

View File

@@ -0,0 +1,40 @@
---
sidebar_label: Project commands (new, init)
---
# Project Commands
## `dcr new \<name>`
Creates a new project with a standard structure and `dcr.toml`. The `name` argument is required.
Only ASCII letters, digits, underscores `_` and hyphens `-` are allowed in the project name.
```bash
dcr new my-app
dcr new my-app --vcs none
```
Flags:
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
Generates:
* `dcr.toml` with basic fields
* `src/main.c` with a `main` template
## `dcr init`
Initializes a DCR project in the current (empty) directory.
```bash
dcr init
dcr init --vcs none
```
Flags:
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
The project name is taken from the current directory name. The directory name must follow the same naming rules as `dcr new`.

View File

@@ -0,0 +1,60 @@
---
sidebar_label: Quality commands (test, fmt)
---
# Quality Commands
## `dcr test`
Runs tests.
```bash
dcr test # debug profile
dcr test --release # release profile
dcr test --debug # explicit debug
dcr test --help # detailed help
```
Before first use, initialize tests:
```bash
dcr test --init
```
This creates `tests/dcr_test.h` (framework) and `tests/test.c` (template).
What `dcr test` does:
1. Builds the project
2. Collects `tests/*.c` files (`.c` only, not `.cpp`)
3. Compiles and links each test file
4. Runs each test binary
5. Prints summary: TOTAL, PASS, SKIP, FAIL
6. Returns non-zero exit code on any FAIL
## `dcr fmt`
Formats C/C++ source files using `clang-format`.
```bash
dcr fmt
```
Processes: `src/**/*.{c,cpp,cxx,cc,h,hpp,hxx,hh}` and `tests/**/*.{c,cpp,cxx,cc,h,hpp,hxx,hh}`.
Uses `.clang-format` at the project root (if present), otherwise default clang-format style.
## `dcr lint`
Runs `clang-tidy` on C/C++ source files for static analysis.
```bash
dcr lint # show diagnostics
dcr lint --fix # apply fixes automatically
dcr lint --help # detailed help
```
Processes: `src/**/*.{c,cpp,cxx,cc}` and `tests/**/*.{c,cpp,cxx,cc}`.
Without `--fix`, clang-tidy reports warnings and errors without modifying files.
With `--fix`, clang-tidy applies automatic suggestions in place.

View File

@@ -0,0 +1,51 @@
---
sidebar_label: System commands (setup, --help, ...)
---
# System Commands
## `dcr setup`
Shows configured registries from `~/.dcr/config.toml`.
```bash
dcr setup
```
If `~/.dcr/config.toml` is not found, DCR returns an error. Create it manually:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
## `dcr --help`
Shows help for all commands.
```bash
dcr --help
```
## `dcr --version`
Shows version and target triple.
```bash
dcr --version # dcr 0.7.0 (x86_64-unknown-linux-gnu)
```
## `dcr --update`
Self-update. Downloads the latest release binary from GitHub Releases and replaces the current one.
```bash
dcr --update
```
Features:
* Auto-detects platform and architecture
* Warns if installed via AUR (use package manager instead)
* Works on Linux, macOS, Windows

View File

@@ -0,0 +1,52 @@
---
sidebar_label: Contributing
---
# Contributing
## Setup
```bash
git clone https://github.com/dexoron/dcr
cd dcr
cargo build
```
## Code style
All code must be formatted with `cargo fmt`:
```bash
cargo fmt
```
## Linting
```bash
cargo clippy --all-targets -- -D warnings
```
## Tests
```bash
cargo test --all-targets
```
## PR process
1. Fork the repository
2. Create a branch: `git checkout -b feature/description`
3. Make changes
4. Run `cargo fmt && cargo clippy && cargo test`
5. Open a Pull Request
## CI
CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check`
* `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features`
* Unit + integration tests on Linux, macOS, Windows
* Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -0,0 +1,66 @@
---
sidebar_label: FAQ
---
# FAQ
## Registry not found
```
error: registry not found
```
**Solution:** Make sure `~/.dcr/config.toml` exists:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
And check `DCR_INDEX_PATH`:
```bash
echo $DCR_INDEX_PATH
```
## Compiler not found
```
error: compiler not found
```
**Solution:** Ensure a compiler is installed and available in PATH.
```bash
which gcc
which clang
```
Or specify explicitly via `[toolchain]` in `dcr.toml`.
## Ctrl+C during build
DCR handles SIGINT: interrupts the current compilation and exits with non-zero code.
## How to create a library?
See [Library Recipe](/docs/recipes/library-project).
## How to cross-compile to Windows?
See [Cross-Compile Recipe](/docs/recipes/cross-to-windows).
## How to create a multi-package project?
See [Workspace Recipe](/docs/recipes/multi-package-workspace).
## Bootloader / pure NASM OS image
Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk image.
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## Lock file
`dcr.lock` is created during builds (`dcr build`) when registry dependencies are present. To force an update — delete `dcr.lock` and run `dcr build`.

View File

@@ -0,0 +1,79 @@
---
sidebar_label: First steps
---
# First Steps
## Create a project
```bash
dcr new my-app
cd my-app
```
Structure:
```
my-app/
├── dcr.toml
└── src/
└── main.c
```
`dcr.toml`:
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
compiler = "clang"
kind = "bin"
```
## Build
```bash
dcr build
```
Output — `target/\<triple>/debug/my-app` (Linux) or `target/debug/my-app.exe` (Windows).
Build profiles:
```bash
dcr build --release # release build
dcr build --debug # debug (default)
```
## Run
```bash
dcr run
```
Builds (if needed) and runs the binary.
## First test
```bash
dcr test --init # create test template
dcr test # run tests
```
## Formatting
```bash
dcr fmt # clang-format with .clang-format
```
## Linting
```bash
dcr lint # clang-tidy checks
dcr lint --fix # apply fixes automatically
```

View File

@@ -0,0 +1,135 @@
---
sidebar_label: Installation
---
# Installation
## dcrup (recommended)
Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
### Linux / macOS / BSD / Windows (bash)
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
```
Non-interactive install of DCR in one shot:
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
```
### Windows (PowerShell)
```powershell
irm https://ps1.dcr-tool.ru | iex
# or download then run:
# irm https://ps1.dcr-tool.ru -OutFile dcrup.ps1
# powershell -File .\dcrup.ps1 self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
Optional cmd bootstrap (if you prefer `curl` of the cmd shim):
```bat
curl -fsSL -o dcrup.cmd https://cmd.dcr-tool.ru
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`): shims live in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows `dcrup.cmd`).
### Common dcrup commands
```sh
dcrup install stable # latest stable prebuilt
dcrup install 0.8.2 # pin → 0.8.2@stable
dcrup install 0.8.2@dev
dcrup install stable --libc musl # Linux: musl asset (default: gnu)
dcrup install stable --build # cargo build --features archive
dcrup install night # always build from branch dev HEAD
dcrup default 0.8.2
dcrup update
dcrup list
dcrup show
dcrup which
```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
---
## Arch Linux (AUR)
```sh
yay -S dcr
```
## macOS / Linux (Homebrew)
```sh
brew tap dexoron/dexoron
brew install dcr
```
## Snap (Linux)
```sh
sudo snap install dcrup
```
> If classic Snap Store publishing is unavailable, install the `.snap` from [GitHub Releases](https://github.com/dexoron/dcr/releases/latest) with `--dangerous`.
## Nix (flake)
```sh
nix run github:dexoron/dcr
nix profile install github:dexoron/dcr
```
## Cargo (crates.io)
```sh
cargo install dcr
```
Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh
cargo install dcr --features archive
```
## From source
```sh
git clone https://github.com/dexoron/dcr.git
cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
```
## Post-install
```bash
dcr --version
dcrup show # if installed via dcrup
```
Man pages (package installs / release assets):
```bash
man dcr
man dcr-build
```
Registry (optional) — `~/.dcr/config.toml`:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```

View File

@@ -0,0 +1,51 @@
---
sidebar_label: IDE Integration
---
# IDE Integration
## VS Code
```bash
dcr gen vscode
```
Generates in `.vscode/`:
| File | Purpose |
| ----------------- | -------------------------------------------- |
| `tasks.json` | `build` task (dcr build) |
| `launch.json` | Debug launch configuration |
| `settings.json` | clangd/IntelliSense: include paths, standard |
| `extensions.json` | Recommends vscode-clangd, vscode-lldb |
## CLion
```bash
dcr gen clion
```
Generates in `.idea/`:
| File | Purpose |
| ------------------------------------------------ | ----------------------------------------- |
| `externalTools.xml` | Build, Run, Clean, Test as external tools |
| `customTargets.xml` | Custom build targets |
| `misc.xml` | C/C++ project settings |
| `runConfigurations/\<name>.xml` | Per-binary run configurations |
## compile_commands.json
```bash
dcr gen compile-commands
```
Generates `compile_commands.json` at project root. Standard format for clangd, C/C++ IntelliSense, static analyzers.
## project-info
```bash
dcr gen project-info
```
Outputs JSON array with project metadata (see [gen-commands](/docs/commands/gen-commands)).

View File

@@ -0,0 +1,33 @@
---
sidebar_label: License
---
# License
## DCR
DCR itself is [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) licensed.
> **Note:** DCR is a build tool, not a library. The GPL applies only to DCR's own source code. Projects built with DCR are not subject to DCR's license — their licensing is determined solely by their own code and dependencies.
## Rust dependencies
DCR is written in Rust. The following notable Rust crates are statically linked:
| Crate | License |
| ------------------------------------------------------- | ----------------- |
| [`ureq`](https://crates.io/crates/ureq) | MIT OR Apache-2.0 |
| [`serde`](https://crates.io/crates/serde) | MIT OR Apache-2.0 |
| [`toml`](https://crates.io/crates/toml) | MIT OR Apache-2.0 |
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
| [`serde_json`](https://crates.io/crates/serde_json) | MIT OR Apache-2.0 |
| [`sha2`](https://crates.io/crates/sha2) | MIT OR Apache-2.0 |
| [`glob`](https://crates.io/crates/glob) | MIT OR Apache-2.0 |
| [`self-replace`](https://crates.io/crates/self-replace) | MIT OR Apache-2.0 |
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT OR Apache-2.0 |
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). The overwhelming majority are dual-licensed under MIT OR Apache-2.0.
## Additional credits
* DCR's CLI design and project model are inspired by [Cargo](https://doc.rust-lang.org/cargo/).

View File

@@ -0,0 +1,49 @@
---
sidebar_label: Cross-compile to Windows
---
# Cross-Compile to Windows from Linux
Building a Windows binary on Linux using mingw-w64.
## Install toolchain
```bash
# Ubuntu/Debian
sudo apt install mingw-w64
# Fedora
sudo dnf install mingw64-gcc mingw64-binutils
```
## Configuration
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
compiler = "clang"
kind = "bin"
target = "x86_64-pc-windows-gnu" # explicit mingw, not msvc
```
## Build
```bash
dcr build --target x86_64-pc-windows-gnu --release
```
Artifact: `target/x86_64-pc-windows-gnu/release/my-app.exe`.
## Custom toolchain
```toml
[toolchain]
cc = "x86_64-w64-mingw32-gcc"
cxx = "x86_64-w64-mingw32-g++"
```

View File

@@ -0,0 +1,70 @@
---
sidebar_label: Library project
---
# Library Project
Creating a static library and using it in another project.
## Step 1: Create the library
```bash
dcr new my-lib
cd my-lib
```
`dcr.toml`:
```toml
[package]
name = "my-lib"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
kind = "staticlib"
```
`src/my_lib.h`:
```c
#ifndef MY_LIB_H
#define MY_LIB_H
int add(int a, int b);
#endif
```
`src/my_lib.c`:
```c
#include "my_lib.h"
int add(int a, int b) { return a + b; }
```
## Step 2: Build
```bash
dcr build --release
```
Artifacts:
* `target/\<triple>/release/libmy-lib.a` (Linux)
* `target/release/my-lib.lib` (Windows)
* `target/include/` — header files
## Step 3: Use in another project
```bash
dcr new my-app
cd my-app
dcr add my-lib ../my-lib
```
Automatically:
* Adds include path to `target/include/` of the library
* Adds lib path to `target/\<triple>/release/`
* Links `libmy-lib.a` / `my-lib.lib`

View File

@@ -0,0 +1,103 @@
---
sidebar_label: Multi-package workspace
---
# Multi-Package Workspace
A project with three packages: two libraries and a binary.
## Structure
```
workspace/
├── dcr.toml # root workspace
├── lib-core/
│ ├── dcr.toml
│ └── src/core.c
├── lib-utils/
│ ├── dcr.toml
│ └── src/utils.c
└── app/
├── dcr.toml
└── src/main.c
```
## Root dcr.toml
```toml
[package]
name = "my-workspace"
version = "0.1.0"
type = "none"
[build]
inherit = true
language = "c"
standard = "c11"
workspace_only = true
[workspace.lib-core]
path = "lib-core"
[workspace.lib-utils]
path = "lib-utils"
deps = ["lib-core"]
[workspace.app]
path = "app"
deps = ["lib-core", "lib-utils"]
main = true
```
## Packages
`lib-core/dcr.toml`:
```toml
[package]
name = "lib-core"
version = "0.1.0"
type = "none"
[build]
kind = "staticlib"
```
`lib-utils/dcr.toml`:
```toml
[package]
name = "lib-utils"
version = "0.1.0"
type = "none"
[build]
kind = "staticlib"
```
`app/dcr.toml`:
```toml
[package]
name = "app"
version = "0.1.0"
type = "none"
[build]
kind = "bin"
```
## Build
```bash
cd workspace
dcr build # builds everything in correct order
dcr build --workspace app # only app (lib-core and lib-utils built as deps)
dcr run # builds and runs main package
```
Build order (topological sort):
1. `lib-core`
2. `lib-utils` (depends on lib-core)
3. `app` (depends on lib-core, lib-utils)

View File

@@ -0,0 +1,89 @@
---
sidebar_label: OS-dev (flat-bin + archive)
---
# Pure ASM / boot image (flat-bin + archive)
Minimal OS-dev style pipeline: assemble raw binaries with NASM, then pack a FAT floppy/image with an optional boot sector.
## Project layout
```
myos/
dcr.toml
src/
boot.asm # boot sector (512 bytes)
kernel.asm # payload
```
For multiple flat artifacts, use a **workspace** (one member per binary) or separate packages; a single `flat-bin` package produces one binary per source stem.
## Boot package (`flat-bin`)
```toml
[package]
name = "boot"
version = "0.1.0"
[build]
language = "asm"
compiler = "nasm"
kind = "flat-bin"
extension = "bin"
roots = ["src/boot.asm"]
```
```bash
dcr build
# → target/<…>/debug/boot.bin (NASM -f bin, no link)
```
## Disk image after build
```toml
[archive]
output = "target/{profile}/disk.img"
format = "fat12"
size = "1440K"
label = "MYOS"
bootsector = "target/{profile}/boot.bin"
[[archive.layout]]
from = "target/{profile}/kernel.bin"
to = "KERNEL.BIN"
```
* `format`: `fat12`, `fat16`, or `fat32`
* `size`: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default ~1.44 MiB)
* `bootsector`: written only when `offset` is omitted or `0`
* `from` may be a glob; `{profile}` is substituted in paths
## C kernel → flat binary
```toml
[build]
language = "c"
compiler = "clang"
kind = "flat-bin"
freestanding = true
filename = "kernel"
extension = "bin"
ldflags = ["-T", "linker.ld"]
```
Pipeline: objects → temporary linked ELF → `objcopy -O binary` → `kernel.bin`. Requires `objcopy` / `llvm-objcopy` in PATH.
## Other assemblers
| Tool | Notes |
| -------- | --------------------------------------------------------------------------------------- |
| **FASM** | Write `format binary` in the source; DCR writes `\<stem>.bin` directly |
| **GAS** | Assemble `.s` → obj → `objcopy -O binary` |
| **LLC** | `language = "llvm_ir"` → obj → objcopy |
| **MASM** | COFF obj → objcopy (needs binutils/LLVM objcopy) |
## Notes
* Single-file `roots` are supported: `roots = ["src/boot.asm"]`.
* `--force` re-runs `build.steps` / `build.post_steps` as well as recompilation.
* Prefer `kind = "elf"` if you need a relocatable ELF kernel without stripping to raw binary.

View File

@@ -0,0 +1,82 @@
---
sidebar_label: Build profiles
---
# Build Profiles
Profiles allow overriding `[build]` fields for specific build modes.
## Configuration
```toml
[build]
language = "c"
standard = "c17"
cflags = ["-Wall"]
[build.debug]
cflags = ["-O0", "-g"]
[build.release]
cflags = ["-O3", "-DNDEBUG"]
```
## Merge rules
Fields from `[build.\<profile>]` are merged on top of `[build]`:
* **Scalar fields** (strings, numbers, bools) — replaced
* **Arrays** (`cflags`, `ldflags`, ...) — **appended** (extend the `[build]` array)
Set `inherit = false` to disable array inheritance (only profile's own arrays are used).
## Built-in profiles
The default flags for each profile are composed from three config fields:
| Field | debug default | release default |
| ----------- | ------------------ | --------------- |
| `opt_level` | `"0"` | `"3"` |
| `debug` | `true` | `false` |
| `warnings` | `["all", "extra"]` | `[]` |
Which produce the equivalent compiler flags:
| Profile | Effective flags |
| --------- | ---------------------------------------------------------- |
| `debug` | `-O0 -g -Wall -Wextra -fno-omit-frame-pointer -DDCR_DEBUG` |
| `release` | `-O3 -DNDEBUG` |
Additional build options can be toggled per-profile:
```toml
[build.release]
opt_level = "z"
lto = true
strip = true
panic = "abort"
codegen-units = "1"
[build.debug]
opt_level = "1"
debug = false
warnings = ["all", "error"]
```
## Target-specific profiles
```toml
[build.linux]
cflags = ["-DLINUX"]
[build.windows.debug]
cflags = ["-DWIN32", "-O0", "-g"]
```
Application order (highest priority first):
1. `[build.\<target>.\<profile>]`
2. `[build.\<profile>.\<target>]`
3. `[build.\<target>]`
4. `[build.\<profile>]`
5. `[build]`

View File

@@ -0,0 +1,136 @@
---
sidebar_label: Build system
---
# Build System
## Compiler Backends
DCR supports 7 compilation backends. Selection is automatic based on file extension and `build.compiler` value.
| Backend | Files | When used |
| --------- | --------------------------------- | ------------------------------------- |
| `unix_cc` | `.c`, `.cpp`, `.cxx`, `.cc`, `.S` | gcc/clang on Linux/macOS/BSD |
| `msvc` | `.c`, `.cpp`, `.cxx`, `.cc` | Windows (cl, clang-cl) |
| `gas` | `.s` | ARM/ARM64 assembler (no preprocessor) |
| `nasm` | `.asm`, `.s` | x86/x86_64 NASM assembler |
| `masm` | `.asm` | MASM (ml/ml64) on Windows |
| `fasm` | `.asm`, `.fasm` | Flat Assembler |
| `llvm_ir` | `.ll` | LLVM IR via `llc -filetype=obj` |
## Qt Support
DCR provides native Qt support for automatic meta-object handling (MOC, UIC, RCC).
Enable it by setting `build.qt = true` in `dcr.toml`. DCR will automatically detect Qt-related files (`.ui`, `.qrc`, `.h` with `Q_OBJECT`) and process them.
```toml
[build]
qt = true
```
*Note: Requires `qt6` modules (Core, Widgets, Gui, Svg) installed via `pkg-config`.*
Advanced customization is still possible via `build.steps` if special handling is needed:
```toml
[build.steps]
moc = "moc {in} -o {out}"
```
### Unix CC
* Compiler resolved via `resolve_compiler()`: `DCR_COMPILER` > `DCR_CC` > `[toolchain]` > `build.compiler` > `PATH`
* Supports `.d` files for header dependency tracking
* Flags: `-std=`, `-MMD -MF`, `-c -o`, `-I`, `-L`, `-l`
* Conditional flags based on config:
* `freestanding` or bare-metal target: `-ffreestanding` (compile), `-nostdlib -static` (link)
* `lto`: `-flto` (compile + link)
* `panic = "abort"`: `-fno-exceptions` (C++ only), `-fno-unwind-tables`, `-fno-asynchronous-unwind-tables`
### MSVC
* Supports cl.exe and clang-cl.exe
* Flags: `/std:`, `/Fo:`, `/Fe:`, `/I`, `/link`
### GAS / NASM / MASM / FASM / LLVM-IR
* GAS: `-I`, `-c -o`, `--defsym`
* NASM: `-I`, `-o`, `-D`, `-f` (format: win64/elf64/macho64/macho32/elf32; **`bin` when `kind = "flat-bin"`**)
* MASM: `/nologo /c /Fo\<obj> <source>`
* FASM: `<source> \<output>` (output path is the object file)
* LLVM IR: `-filetype=obj <source> -o \<output>`
## Incremental Builds
Three levels of incrementality:
1. **mtime** — if output is newer than all inputs, skip
2. **`.d` files** — header change tracking (including transitive)
3. **SHA256 fingerprint** — recompile if compiler flags changed (stored in `.dcr_fingerprint`)
## Parallel Compilation
* `thread::scope` for thread pool
* Atomic task queue (`AtomicU64`)
* Mutex on stdout (`OUTPUT_MUTEX`)
* Thread count = `available_parallelism()`, capped by `build.codegen-units` if set
## Build Kinds
| Kind | Type | Path (Linux example) |
| ----------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `bin` | Executable | `target/\<triple>/\<profile>/\<name>` (.exe on Windows) |
| `staticlib` | Static library | `target/\<triple>/\<profile>/lib\<name>.a` (.lib) |
| `sharedlib` | Dynamic library | `target/\<triple>/\<profile>/lib\<name>.so` (.dll/.dylib) |
| `efi` | UEFI application | `target/\<triple>/\<profile>/\<name>.efi` |
| `elf` | ELF without stdlib | `target/\<triple>/\<profile>/\<name>` |
| `none` | Compile only, no link | — |
| `custom` | Full filename+extension control | `target/\<triple>/\<profile>/\<filename>.\<extension>` |
| `flat-bin` | Raw binary | ASM: `\<stem>.bin` (NASM `-f bin` / FASM / GAS·MASM·LLC via objcopy); C/C++: `\<name>.bin` (link + objcopy) |
## Disk images (`[archive]`)
After a successful build, if `[archive]` is present in `dcr.toml`, DCR formats a FAT volume and copies files from `layout` into the image. See [dcr.toml → archive](/docs/reference/dcr-toml#archive).
## Build Steps
DCR supports pre-build and post-build steps:
* `build.steps` — commands before compilation
* `build.post_steps` — commands after compilation
Substitutions: `{stem}`, `{in}`, `{out}`, `{profile}`, `{version}`, `{name}`.
Example Qt codegen via build steps:
```toml
[build.steps]
moc = "moc {in} -o {out}"
```
## pkg-config
Automatic lookup (read from raw config):
```toml
[build]
pkg_config = ["sdl2", "gl"]
```
DCR runs `pkg-config --cflags sdl2 gl` and `pkg-config --libs sdl2 gl` and adds results to compiler/linker flags.
## Variable Substitution
Supported variables:
| Variable | Description |
| ----------------------- | ---------------------------- |
| `{version}` | Package version |
| `{version_major}` | Major version part |
| `{version_minor}` | Minor version part |
| `{version_patch}` | Patch version |
| `{version_suffix}` | Suffix (e.g., `-rc1`) |
| `{version_suffix_dash}` | Suffix with dash |
| `{profile}` | Profile name (debug/release) |
| `{name}` | Package name |

View File

@@ -0,0 +1,64 @@
---
sidebar_label: Cross-compilation
---
# Cross-Compilation
## Short Names
DCR supports short platform names:
| Short Name | Full Triple |
| ---------- | -------------------------- |
| `linux` | `x86_64-unknown-linux-gnu` |
| `macos` | `x86_64-apple-darwin` |
| `windows` | `x86_64-pc-windows-msvc` |
```bash
dcr build --target windows
```
## Full Triples
```bash
dcr build --target aarch64-unknown-linux-gnu
dcr build --target x86_64-pc-windows-gnu # mingw
dcr build --target armv7-unknown-linux-gnueabihf
```
## clang --target
When using clang, DCR injects `--target=\<triple>` into CFLAGS.
```toml
[build]
compiler = "clang"
target = "aarch64-unknown-linux-gnu"
# Auto: cflags += ["--target=aarch64-unknown-linux-gnu"]
```
## Bare-Metal / Freestanding
For targets containing `none`, `-elf`, `eabi`, or `baremetal`, DCR automatically:
1. **Disables default flags** — no system include paths, no `-l` libc
2. **Injects `-ffreestanding`** at compile time and `-nostdlib -static` at link time
You can also enable freestanding mode explicitly:
```toml
[build]
freestanding = true
```
```bash
dcr build --target aarch64-none-elf
```
## Target Directory
By default, the compilation output directories are structured as follows:
* **Linux and BSD**: Always output to `target/\<triple>/\<profile>/` (using host triple if no target is specified).
* **macOS and Windows (without target)**: Output to `target/\<profile>/`.
* **macOS and Windows (with explicit target)**: Output to `target/\<triple>/\<profile>/`.

View File

@@ -0,0 +1,263 @@
---
sidebar_label: dcr.toml overview
---
# dcr.toml
Main project configuration file. Located at the project root.
## Structure
```toml
[package]
# required fields
[build]
# build settings
[build.debug] # optional: debug override
[build.release] # optional: release override
[build.linux] # optional: Linux override
[build.windows] # optional: Windows override
[build.windows.debug] # target + profile combination
[toolchain]
# compiler/linker paths
[dependencies]
# project dependencies
[workspace]
# multi-package configuration
[run]
# run settings
[archive]
# optional: pack FAT disk image after build
```
## [package]
| Field | Required | Description |
| --------- | -------- | ------------------------------------------- |
| `name` | yes | Project name |
| `version` | yes | Semantic version |
| `type` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `license` | no | SPDX license identifier |
| `author` | no | Author |
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "app"
license = "MIT"
author = "John Doe"
```
## [build]
...
* `build.qt` — (bool) Enable automatic Qt meta-object handling (MOC, UIC, RCC). Requires `qt6` modules installed via `pkg-config`.
| Field | Default | Description |
| ---------------- | ------------- | --------------------------------------------------------------------------------------------------------- |
| `language` | `"c"` | `"c"`, `"c++"`, `"cpp"`, `"cxx"`, `"asm"`, `"llvm_ir"`, `"llvm-ir"`, `"ll"` (optional, defaults to `"c"`) |
| `standard` | `"c11"` | C standard (`c11`, `c17`, `c23`) |
| `cxx_standard` | — | C++ standard (`c++17`, `c++20`, `c++23`) |
| `compiler` | `"clang"` | Preferred compiler (optional, defaults to `"clang"`) |
| `kind` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom`, `flat-bin` |
| `target` | host | Target triple for cross-compilation |
| `platform` | `"native"` | `native`, `efi` |
| `cflags` | `[]` | Additional C/C++/ASM flags |
| `ldflags` | `[]` | Additional linker flags |
| `filename` | `""` | Custom output file name |
| `extension` | `""` | Custom file extension (for `flat-bin`, default is `bin`) |
| `roots` | `["src"]` | Source roots: directories and/or individual source/header files |
| `exclude` | `[]` | Exclude patterns |
| `include` | `[]` | Additional include directories |
| `src_disable` | `false` | Disable auto source discovery |
| `inherit` | `false` | Inherit build from workspace root |
| `clean` | `[]` | Glob patterns for custom clean paths |
| `out_dir` | `""` | Custom output directory |
| `workspace_only` | `false` | Workspace-only, not built standalone (no `language`/`compiler` required) |
| `freestanding` | `false` | Compile in freestanding mode (`-ffreestanding` + `-nostdlib -static`) |
| `opt_level` | — | Optimization level: `0`-`3`, `"s"`, `"z"` (derived from profile if omitted) |
| `debug` | profile-based | Emit debug symbols (`-g`): `true` in debug, `false` in release |
| `lto` | `false` | Link-time optimization (`-flto` for both compiler and linker) |
| `strip` | `false` | Strip symbols from output (`-s` in ldflags) |
| `warnings` | `[]` | Warning flags (e.g. `"all"`, `"extra"`, `"pedantic"`); engine adds `-Wall -Wextra` in debug if empty |
| `panic` | `""` | Panic strategy: `"abort"` disables exceptions and unwind tables |
| `codegen-units` | `""` | Max parallel compilation jobs (`"0"` = auto) |
| `qt` | `false` | Enable automatic Qt meta-object handling (MOC, UIC, RCC) |
Settings from raw config (not in typed struct):
* `pkg_config` — list of pkg-config packages
* `ldscript` — linker script path
* `build.steps` / `build.post_steps` — codegen steps
## Per-language overrides: `[build.c]`, `[build.cxx]`, `[build.asm]`, `[build.llvm_ir]`
Each language can have its own table that overrides the flat `[build]` settings:
```toml
[build]
compiler = "clang"
standard = "c11"
[build.c]
standard = "c23"
compiler = "gcc"
[build.cxx]
standard = "c++23"
compiler = "g++"
[build.asm]
compiler = "nasm"
flags = ["-felf64"]
[build.llvm_ir]
compiler = "llc"
```
The flat `[build]` acts as fallback; per-language tables take precedence for their language.
Example:
```toml
[build]
language = "c++"
standard = "c23"
cxx_standard = "c++23"
compiler = "clang"
kind = "sharedlib"
cflags = ["-Wall", "-Wextra"]
opt_level = "z"
lto = true
strip = true
panic = "abort"
codegen-units = "2"
```
## [toolchain]
```toml
[toolchain]
cc = "/usr/bin/clang"
cxx = "/usr/bin/clang++"
as = "/usr/bin/as"
ar = "/usr/bin/ar"
ld = "/usr/bin/ld.lld"
```
Raw config also supports `uic`, `moc`, `rcc` for Qt codegen.
## [dependencies]
See [dependencies](/docs/reference/dependencies).
## [run]
```toml
[run]
cmd = "./target/{profile}/{name}"
```
Substitutions:
* `{version}` — package version
* `{version_major}`, `{version_minor}`, `{version_patch}`, `{version_suffix}`, `{version_suffix_dash}` — version parts
* `{profile}` — debug / release
* `{name}` — package name
Default `cmd` = `./target/{profile}/{name}` (macOS/Windows) or `./target/\<triple>/\<profile>/\<name>` (Linux).
## [workspace]
See [workspaces](/docs/reference/workspaces).
## [archive]
Optional post-build step: format a FAT volume and copy built artifacts into a disk image. Runs after a successful package build (and after workspace member builds that define `[archive]`).
Requires DCR built with the `archive` Cargo feature (`cargo build --features archive`). Release binaries include this feature.
| Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) |
| `format` | yes | `fat12`, `fat16`, or `fat32` |
| `size` | no | Image size: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default `1474560` ≈ 1.44 MiB) |
| `offset` | no | Byte offset of the FAT volume inside the image (default `0`) |
| `label` | no | Volume label (max 11 chars, default `VOLUME`) |
| `bootsector` | no | Path to a 512-byte boot sector written at offset 0 when `offset` is 0 (`{profile}` allowed) |
| `layout` | no | List of `{ from, to }` entries (files or globs → path inside the volume) |
```toml
[archive]
output = "target/{profile}/disk.img"
format = "fat12"
size = "1440K"
label = "MYOS"
bootsector = "target/{profile}/boot.bin"
[[archive.layout]]
from = "target/{profile}/kernel.bin"
to = "KERNEL.BIN"
[[archive.layout]]
from = "assets/*"
to = "/"
```
Typical pairing with `kind = "flat-bin"` (NASM `-f bin`) for bootloaders and pure-ASM OS images.
## `flat-bin` (kind)
Produces a raw binary (default extension `bin`) for boot sectors, kernels, and freestanding payloads.
### Assemblers
| Tool | Language / compiler | How flat-bin is produced |
| ---- | ------------------------------------------ | -------------------------------------------- |
| NASM | `language = "asm"`, `compiler = "nasm"` | `-f bin` → `\<stem>.bin` |
| FASM | `compiler = "fasm"` | direct write (use `format binary` in source) |
| GAS | `compiler = "as"` / `"gas"` | assemble → `objcopy -O binary` |
| MASM | `compiler = "ml"` / `"ml64"` | assemble → `objcopy -O binary` |
| LLC | `language = "llvm_ir"`, `compiler = "llc"` | `-filetype=obj` → `objcopy -O binary` |
```toml
[build]
language = "asm"
compiler = "nasm"
kind = "flat-bin"
extension = "bin"
roots = ["src/boot.asm"]
```
### C / C++
Compile all sources, link with `-nostdlib -static` (plus your `ldflags` / `ldscript`), then convert the intermediate ELF/PE with `objcopy -O binary` to `\<filename|name>.bin`.
```toml
[build]
language = "c"
compiler = "clang"
kind = "flat-bin"
freestanding = true
filename = "kernel"
extension = "bin"
ldscript = "linker.ld"
ldflags = ["-T", "linker.ld"]
```
Notes:
* Multi-file **ASM** packages emit one `\<stem>.bin` per source; **C/C++** emit a single project binary.
* `objcopy` tools tried in order: `llvm-objcopy`, `objcopy`, `gobjcopy`.
* Incompatible with `build.qt = true`.
* `dcr run` rejects `flat-bin` (not a host executable).

View File

@@ -0,0 +1,84 @@
---
sidebar_label: Dependencies
---
# Dependencies
## Formats
The `[dependencies]` section supports three formats:
### String (registry)
```toml
[dependencies]
fmt = "10.1.1"
spdlog = "1.12"
catch2 = "3.4.0"
```
The version string is used as-is for registry lookup.
### Table (git)
```toml
[dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" }
```
Fields: `git`, `branch`, `tag`, `rev`.
### Table (path)
```toml
[dependencies]
mylib = { path = "../mylib" }
```
## Registry
DCR uses a package registry for dependency lookup by name.
```toml
# ~/.dcr/config.toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrides the path to `index.json`.
## Git dependencies
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
* `branch` — switch to a branch
* `tag` — switch to a tag
* `rev` — switch to a specific commit
* `features` — feature flags (parsed, but does not affect build)
## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
```toml
[dependencies]
mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" }
```
*Note: Header resolution automatically checks the packaged `target/include` directory of path dependencies, ensuring consumer packages can find headers from compiled static or dynamic libraries.*
## dcr.lock
Dependency lock file. Contains package names and sources.
Created during `dcr build` when registry dependencies are present. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process
1. Load all dependencies (registry → git → path)
2. For path deps: recursively read their `dcr.toml`
3. For registry deps: search `index.json`
4. For git deps: clone to cache
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -0,0 +1,60 @@
---
sidebar_label: Environment variables
---
# Environment Variables
## DCR_COMPILER
Overrides the compiler for all languages. **Highest priority.**
```bash
export DCR_COMPILER=clang
dcr build
```
Compiler resolution priority:
1. `DCR_COMPILER` (env)
2. `DCR_CC` / `DCR_CXX` / `DCR_AS` (env)
3. `[toolchain]` (dcr.toml)
4. `build.compiler` (dcr.toml)
5. `PATH`
## DCR_CC / DCR_CXX / DCR_AS
Per-language override (lower priority than `DCR_COMPILER`, higher than `[toolchain]`).
```bash
export DCR_CC=gcc-14
export DCR_CXX=g++-14
export DCR_AS=arm-linux-gnueabihf-as
```
## DCR_LD / DCR_AR
Override linker and archiver.
```bash
export DCR_LD=ld.lld
export DCR_AR=llvm-ar
```
## DCR_DEBUG
Enables debug mode — prints all compilation commands to stderr before execution.
```bash
export DCR_DEBUG=1
dcr build
```
## DCR_INDEX_PATH
Overrides the path to the registry `index.json`.
```bash
export DCR_INDEX_PATH=/custom/path/index.json
```
Default: `~/.dcr/index.json`.

View File

@@ -0,0 +1,53 @@
---
sidebar_label: Platform support
---
# Platform Support
## Target Triples
DCR normalizes target triples. Short platform names are expanded to full triples.
### Linux
```
target/<arch>-unknown-linux-<env>/<profile>/
```
Architectures: `x86_64`, `aarch64`, `i686`, `armv7`, `riscv64` (host-detected).
Environments: `gnu` (default), `musl`.
Artifact type: ELF. Extensions: `.so` (sharedlib), `.a` (staticlib).
### macOS
```
target/<profile>/ (default) or target/<triple>/<profile>/ (with target)
```
Architectures: `x86_64`, `aarch64` (host-detected).
Extensions: `.dylib` (sharedlib), `.a` (staticlib).
### Windows
```
target/<profile>/ (default) or target/<triple>/<profile>/ (with target)
```
Architectures: `x86_64`, `aarch64`.
Environments: `msvc` (default), `gnu` (MinGW).
Extensions: `.exe` (bin), `.lib` (staticlib), `.dll` (sharedlib), `.efi` (UEFI).
### BSD
```
target/<arch>-unknown-<os>/<profile>/
```
Supported systems: `freebsd`, `openbsd`, `netbsd`, `dragonfly`.
## Host Detection
DCR uses `std::env::consts::ARCH` and `std::env::consts::OS` for host platform detection. Used as fallback when `target` is not specified.

View File

@@ -0,0 +1,88 @@
---
sidebar_label: Workspaces
---
# Workspaces
Workspaces allow managing multiple packages in a single repository.
## Configuration
```toml
[workspace.lib-core]
path = "lib-core"
[workspace.lib-utils]
path = "lib-utils"
deps = ["lib-core"]
[workspace.app]
path = "app"
deps = ["lib-core", "lib-utils"]
main = true
```
### Member fields
| Field | Description |
| ------ | ------------------------------------------------ |
| `path` | Path to the package (relative to workspace root) |
| `deps` | Dependencies on other members |
| `main` | Mark as the main package |
## Topological sort
DCR automatically sorts packages by dependencies: package A is built before B if B depends on A.
Cyclic dependencies are detected and cause an error.
## Build
```bash
dcr build # build all packages in dependency order
dcr build --workspace app # build only app (dependencies built automatically)
```
When building a workspace, DCR automatically injects include and library paths of dependent workspace members:
* **Include Paths**: Automatically resolves and injects header directories of dependencies, including the member's `src/` directory, local `include/` directory, and the packaged `target/include` directory.
* **Library Paths**: Injects compiled library search paths (`target/lib` as well as target-specific build folders) to allow automatic linking with member libraries.
## Clean
```bash
dcr clean # clean only root target/
dcr clean --all # clean target/ of all packages
```
## Inheritance
If a member has `inherit = true` in its `[build]` section, fields from the root `[build]` are merged into the member:
```toml
# root dcr.toml
[build]
inherit = true
language = "c"
standard = "c17"
# member inherits language and standard
```
## Workspace-only root (no build of its own)
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
```toml
[package]
name = "my-workspace"
version = "0.1.0"
[build]
workspace_only = true
kind = "bin"
[workspace]
lib-core = { path = "lib-core" }
app = { path = "app", deps = ["lib-core"] }
```

View File

@@ -0,0 +1,46 @@
---
sidebar_label: Self Update
---
# Self Update
## dcr --update
Automatic update to the latest version. Downloads a binary (not an archive) from GitHub Releases and replaces the current executable.
```bash
dcr --update
```
## How it works
1. DCR detects the current platform and architecture
2. Fetches the latest release from `api.github.com/repos/dexoron/dcr/releases/latest`
3. Compares versions
4. Downloads the matching asset (direct binary URL, not archive)
5. Replaces the current executable via `self_replace`
## Asset naming
Pattern: `dcr-\<triple>` or `dcr-\<triple>.exe`
| Platform | Asset name |
| -------------- | -------------------------------- |
| Linux x86_64 | `dcr-x86_64-unknown-linux-gnu` |
| macOS x86_64 | `dcr-x86_64-apple-darwin` |
| macOS ARM64 | `dcr-aarch64-apple-darwin` |
| Windows x86_64 | `dcr-x86_64-pc-windows-msvc.exe` |
## AUR
If DCR was installed via AUR, `--update` shows a warning:
```
Update via package manager: yay/paru -Syu {package_name} or sudo pacman -Syu {package_name}
```
## Errors
* Cannot detect platform — error
* Cannot fetch release — error with URL
* No write permission — error (use `sudo` or manual install)

View File

@@ -0,0 +1,45 @@
---
sidebar_label: Running tests
---
# Running Tests
## Execution
```bash
dcr test
```
Builds the project, then compiles and runs test files from `tests/`.
## Profiles
```bash
dcr test # debug (default)
dcr test --release # release
dcr test --debug # explicit debug
```
## Output
```
=====================
Testsuite summary
=====================
TOTAL: 5
PASS: 3
SKIP: 1
FAIL: 1
=====================
```
## Exit code
* 0 — all tests passed (FAIL = 0)
* 1 — test failures or build error
## What gets built
* All `.c` files from `tests/` (`.cpp` not supported)
* Include path: `tests/` (for `dcr_test.h`)
* Linked with project if `package.type = "lib"` or `kind = "staticlib"`/`"sharedlib"`

View File

@@ -0,0 +1,69 @@
---
sidebar_label: Test framework (EXPECT, TEST, ...)
---
# Test Framework
DCR has a built-in minimal test framework for C.
## Macros
### `EXPECT(expr)`
Asserts that an expression is true.
```c
EXPECT(1 + 1 == 2);
EXPECT(ptr != NULL);
```
### `SKIP(reason)`
Skips a test with a message.
```c
SKIP("not implemented on Windows");
```
### `TEST(name)`
Defines a test.
```c
TEST(addition) {
EXPECT(1 + 1 == 2);
EXPECT(2 + 2 == 4);
}
```
### `TEST_CASE(name)`
Registers a test case.
```c
TEST_CASE(math) {
EXPECT(1 + 1 == 2);
}
```
## Initialization
```bash
dcr test --init
```
Creates:
* `tests/dcr_test.h` — framework header (do not edit)
* `tests/test.c` — template with example test
## Structure
```
tests/
├── dcr_test.h # framework (do not edit)
├── test.c # main tests
└── ... # additional .c test files
```
Only `.c` files are compiled (`.cpp` is not supported).

View File

@@ -0,0 +1,66 @@
---
sidebar_label: Введение
---
# DCR — Инструмент сборки C/C++ & Пакетный менеджер
<details>
<summary>Быстрая справка</summary>
```bash
# Installation (dcrup)
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
# Create a project
dcr new my-app
cd my-app
# Build and run
dcr build
dcr run
# Run tests
dcr test
# Add a dependency
dcr add fmt
# Generate IDE files
dcr gen vscode
```
</details>
## Содержание
| Раздел | Описание |
| --------------------------------------------------- | -------------------------------------------- |
| [Начало работы](/docs/getting-started/installation) | Установка и первые шаги |
| [Команды](/docs/commands/project-commands) | Все CLI-команды DCR |
| [Ссылка](/docs/reference/dcr-toml) | Конфигурация, сборка, зависимости, платформы |
| [Тестирование](/docs/testing/test-framework) | Встроенный фреймворк тестирования |
| [Рецепты](/docs/recipes/cross-to-windows) | Типовые сценарии |
| [Интеграция с IDE](/docs/ide-integration) | VS Code, CLion, compile_commands.json |
| [Автоматическое обновление](/docs/self-update) | Автообновление |
| [Часто задаваемые вопросы](/docs/faq) | Частые вопросы |
| [Журнал изменений](/docs/changelog) | История версий |
| [Лицензия](/docs/license) | Лицензии DCR и вендорных библиотек |
| [Внести свой вклад](/docs/contributing) | Разработка DCR |
## Особенности
* **Инкрементальная сборка** — mtime + `.d` headers + SHA256 fingerprint
* **Параллельная компиляция** — thread::scope, атомарная очередь задач
* **7 backends** — gcc/clang (unix_cc), MSVC/clang-cl (msvc), GAS, NASM, MASM, FASM, LLVM IR
* **8 project kinds** — bin, staticlib, sharedlib, efi, elf, none, custom, flat-bin
* **Disk images** — optional `[archive]` packs FAT12/16/32 images after build
* **Cross-compilation** — short names (linux, windows, macos) и полные triples
* **Профили** — debug / release с переопределением любого поля
* **Workspaces** — мультипакетные проекты с топологической сортировкой
* **Registry + Git + Path** — три механизма зависимостей
* **Генерация IDE** — VS Code, CLion, compile_commands.json, JSON metadata
* **pkg-config** — автоматический поиск системных библиотек
* **Команда `--help` для каждой команды** — `dcr build --help`, `dcr new --help` и т. д.
* **Справочные страницы** — `man dcr`, `man dcr-build`, `man dcr-new`

View File

@@ -0,0 +1,259 @@
---
sidebar_label: Список изменений
---
# Список изменений
## 0.8.4 (2026-08-04)
**Added:**
* **`.dcr/` directory** — shared machine-readable build facts for IDE integrations:
* `.dcr/compile_commands.json`
* `.dcr/build-info.json` (`schemaVersion`, `artifact_path`, `profile`, …)
* `.dcr/toolchain.json` (compiler/debugger paths, moc/uic/rcc)
* `.dcr/ide/` (placeholder for IDE lock files)
* **`dcr gen project-info`** — `target`, `target_dir`, `artifact_path`, `artifact_kind`, `source_roots`, `include_globs`, `exclude_globs`; absolute/canonical paths.
* **`dcr build --print-artifact-path`** — one absolute artifact path line on stdout after a successful build.
* **`dcr gen … --quiet` / `-q`** — suppress human success logs for gen subcommands.
* **`.clangd`** — created on first gen with `CompilationDatabase: .dcr` (`# managed by dcr gen`); custom `.clangd` is not overwritten.
* **Helpers** `canonicalize_path`, `atomic_write`, `ensure_dcr_dir`; pure `resolve_artifact_path` via `platform::*`.
* **`dcr new` / `dcr init`** — add `.dcr/` to `.gitignore`.
**Changed (breaking):**
* **`compile_commands.json` moved** from project root to **`.dcr/compile_commands.json`**.\
clangd discovers it via `.clangd` / `--compile-commands-dir=.dcr`.\
CLion and VSCode generators updated accordingly.
* **Atomic write** for compile_commands (tmp + rename).
* **`gen vscode` / `gen clion` launch/run** — use the same artifact path resolver as `project-info` / `build-info.json`.
**Fixed:**
* Launch configs no longer hardcode `target/\<profile>/\<name>` without the Linux triple segment.
* Symlink/mount roots: best-effort canonicalize for root and compile database paths.
## 0.8.3 (2026-08-03)
### Добавлено:
* **`dcr run -- \<args>...`** — cargo-style argument forwarding after a bare `--`\
(`dcr run --release -- --test_help`). Applies to direct binary runs and `[run].cmd`.
* **Tests** — host target section `ldflags` without CLI `--target`; run-arg forwarding; `split_double_dash` unit tests.
### Изменено:
* **Native builds resolve the host triple** — without `--target` / package `build.target`, host sections such as\
`[build.x86_64-unknown-linux-gnu]` apply again (`cflags` / `ldflags` / toolchain).\
Previously the target was empty and those sections were ignored while artifacts already used the host triple path.
* **Empty target** — no more `Unknown target ''` warning.
* **`dcr run --help` / man `dcr-run`** — document `--` forwarding.
### Исправлено:
* **Native artifact paths on Windows and macOS** — without an explicit `--target` / `build.target`, artifacts use `target/\<profile>`, so `dcr run` and flat-bin find the build output.
* Target-specific `ldflags` missing on native host builds (e.g. micro-lang + `libsct-elf`).
* Spurious empty-target warning.
## 0.8.2 (2026-07-22)
### Добавлено
* **Compile progress `[N/M]`** — live TTY status line (`compile pkg v0.1.0 [12/41]`) so long mono-package builds do not look hung.
* **DCR status style** — fixed-width verbs: `project`, `compile`, `dep`, `ready`, `pack`, `done`, `run`.
* **Cargo feature `archive`** — optional FAT packing via `fatfs` (`cargo build --features archive`). Release CI builds with the feature; without it `[archive]` fails with a clear message.
* **Tests** — `flat_bin_nasm_build`, package `build.target` without CLI `--target`, stricter workspace `clean --all`.
* **CI expansion** — unit + integration on Linux/macOS/Windows, archive feature job, rust-cache, clippy default + all-features (see `.github/workflows/ci.yml`).
### Изменено
* **No forced host triple from CLI** — without `--target`, package/member `build.target` is honored (bare-metal / ISO `post_steps` paths).
* **Relative include/lib flags** (`-I`, `-i`, `-isystem`, `-idirafter`, `-L`, `-T`) absolutized against the package root under workspace builds.
* **`dcr clean --all`** — no spam for members without a local `target/` (shared root `target/`).
* **`error` / `warn`** — red / yellow on stderr; CLI fully English (`Hint:`).
* **Help / man** — list `add`, `lint`, `setup`; unknown command exits with code 1.
* **Tool NotFound** — `linker not found: ld.lld …` / `{tool} not found …` instead of raw `os error 2`.
## 0.8.1 (2026-07-20)
### Added
* **`build.kind = "flat-bin"`** — raw binary (default `.bin`) for OS-dev payloads:
* **NASM** — `-f bin` → `\<stem>.bin`
* **FASM** — direct output (`format binary` in source)
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — FAT12/16/32 disk images after build (`output`, `format`, `size`, `offset`, `label`, `bootsector`, `layout`). From 0.8.2 requires feature `archive`.
* **Single-file `build.roots`** — a root may be a single source or header file, not only a directory.
### Changed
* **`--force`** also re-runs `build.steps` and `build.post_steps`.
* **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
## 0.8.0 (2026-07-18)
### Added
* **Dedicated Build Engine (`src/core/build/engine.rs`)** — decoupled the build orchestration logic completely from the CLI front-end wrapper in `src/cli/build.rs` to a reusable, decoupled core build engine.
* **Polymorphic Language Model (`Language` trait)** — introduced the abstract `Language` trait (`src/core/build/language/mod.rs`). File scanning, compiler resolution, and flags handling are now encapsulated in dedicated language modules for C, C++ (including Qt code generation), LLVM IR, and ASM (GAS, NASM, FASM, MASM).
* **Polymorphic Compilation Dispatch (`Builder` trait)** — introduced the `Builder` trait to generalize builder invocations (`src/core/build/builder/mod.rs`). Consolidated GCC/Clang logic into `builder/cc_common.rs` and Microsoft Visual C++ logic into `builder/msvc/`.
* **Per-Language Configuration overrides (`[build.\<lang>]`)** — introduced support for configuring language-specific compiler, standard, and flags (e.g. `[build.c]`, `[build.cxx]`, `[build.asm]`) independently in `dcr.toml`.
* **Automatic Workspace Dependency Injection** — during workspace builds, include/lib paths of dependent workspace members (including their source headers, local `include/` folders, and build target `target/include` / `target/lib` folders) are automatically resolved and injected.
* **`BuildReporter` Event System** — decoupled build orchestration output into a structured event-driven reporter model (`src/core/build/report.rs`), making DCR suitable for library embedding and IDE integrations without stderr capturing.
* **Build Cancellation Support** — introduced thread-safe cancellation tokens (`Arc\<AtomicBool>`) allowing clients to safely abort compile runs mid-execution.
* **TOML Formatting & Custom Keys Preservation** — migrated the config editor to `toml_edit`, preserving all unknown/user-defined TOML keys, structures, and comments during file write operations (e.g., in `dcr add`).
* **Path Dependencies Target Include Resolution** — local path dependencies configured via tables now correctly expose headers built and packaged into their `target/include` folder to consumer packages.
* **Modular Integration Test Suite** — refactored the monolith `tests/cli_basic.rs` file into clean, specialized integration tests: `cli_build.rs`, `cli_deps.rs`, `cli_lint.rs`, `cli_new.rs`, `cli_qt.rs`, `cli_test.rs`, `cli_workspace.rs`.
### Changed
* **Consolidated Linking and Archiving** — artifact generation (linking executables/shared libraries and archiving static libraries) consolidated into a single `src/core/build/builder/artifact.rs` module.
* **Workspace-Aware member execution** — `dcr run` executed at the workspace root of a `workspace_only` project now triggers the member build inside the workspace context using the `--workspace` parameter, preventing standalone build issues.
* **Elimination of Global State** — removed global variables and states from the build core, encapsulating build logic inside isolated `BuildContext` structs for thread safety.
* **Build Cache Separation** — relocated mtime tracking, incremental caching, and header-dependency checking logic to `src/core/build/cache.rs`.
* **Modularized Pre-build Steps** — decoupled generator scripts and pre-build commands parsing into `src/core/build/steps.rs`.
## 0.7.4 (2026-06-17)
### Added
* **Native Qt support** — automatic meta-object handling (MOC, UIC, RCC) added when `build.qt = true` is set in `dcr.toml`.
* **`dcr lint` command** — C/C++ static analysis via `clang-tidy`. Supports `--fix` for automatic fixes. Respects `build.roots` and `build.src_disable` from config.
* **Three new assembler backends**:
* **MASM** (`compiler = "ml"` / `"ml64"`) — Microsoft Macro Assembler.
* **FASM** (`compiler = "fasm"`) — Flat Assembler.
* **LLVM IR** (`compiler = "llc"`) — compiles `.ll` files via `llc -filetype=obj`.
* **Shared ASM pipeline** — linking and archiving logic consolidated into `core/builder/asm.rs`. Adding a new assembler backend now takes ~30 lines.
* **Filesystem utilities** — `to_hex()` and `home_dir()` extracted to `utils/fs.rs`.
* **Build utilities** — `normalize_target()`, `normalize_kind()`, `normalize_platform()`, `default_profile_flags()` extracted to `utils/build.rs`.
* **Backend helpers** — `asm_lang_flag()`, `source_extensions()`, `elapsed_secs()` added to `core/builder/common.rs`.
* **Full Bare-Metal / Freestanding Automation** — introduced the `build.freestanding = true` configuration option. When enabled (or when a bare-metal target is detected), DCR automatically injects `-ffreestanding` during compilation and both `-nostdlib` and `-static` during linking.
* **Artifact Optimization (LTO & Strip)** — added `build.lto` (auto-injects `-flto` for compiler and linker) and `build.strip` (automatically strips debug symbols via linker `-s` flag) options to `dcr.toml`.
* **Compilation Thread Control** — added the `build.codegen-units` option to strictly limit the maximum number of parallel jobs utilized by the custom `parallel_build` worker pool.
* **Panic Behavior Management** — added `build.panic = "abort"` support. For C++ targets, it automatically strips exception handling and unwind tables via `-fno-exceptions`, `-fno-unwind-tables`, and `-fno-asynchronous-unwind-tables`.
### Changed
* **Intelligent Default Flags Generation** — automated injection of fallback optimization (`-O3`/`-O0`), debug (`-g`), and warning (`-Wall -Wextra`) flags is now suppressed for bare-metal and freestanding builds if `build.cflags` are overridden.
* **Centralized Bare-Metal Detection** — relocated the `is_bare_metal_target` helper to common build utilities (`src/utils/build.rs`) for unified access across the building core.
* **Architectural Refactoring**:
* Renamed `src/config.rs` to `src/templates.rs`.
* Started consolidation of configuration and build orchestration logic.
## 0.7.3 (2026-06-13)
### Added
* **`--vcs` option for `new` and `init` commands** — introduced explicit version control system selection via `--vcs \<git|none>`.
* **Git metadata integration in `--version`** — the CLI now appends the current short commit hash and a `-dirty` suffix if there are uncommitted changes in the DCR repository.
* **Automatic `.gitignore` generation** — Git repository initialization now automatically writes a `.gitignore` file excluding the `/target` directory.
* **Nested repository prevention** — automatic Git initialization is now skipped if `dcr new` or `dcr init` is executed inside an already existing Git repository.
* **VCS verification tests** — added `new_vcs_options_work` and `init_vcs_options_work` integration tests to ensure reliable repository behavior.
### Changed
* **Complete removal of `git2` dependency** — all Git actions (dependency fetching, VCS setup, status checks) are now delegated to the system `git` executable via `Command`. This simplifies compilation and drops the need for `vendored` and `openssl` features.
* **Migrated from `reqwest` to `ureq`** — replaced the heavy `reqwest` crate in `flag_update.rs` with the lightweight synchronous `ureq 2.10` client, reducing overhead and the final binary size.
## 0.7.2 (2026-06-07)
### Added
* `default_target_triple()` now respects `target_env` — Linux (gnu/musl) and Windows (msvc/gnu) use the correct environment instead of hardcoded values.
### Исправлено
* **macOS Apple Silicon builds failed with `_main` undefined** — `--target=` is now passed to ldflags, not just cflags. `default_target_triple()` uses `std::env::consts::ARCH` on macOS instead of hardcoded `x86_64`.
* **GitHub Stars and GPL-3.0 badges not rendering in README** — badge block converted to pure HTML.
### Changed
* Default target resolution extracted into shared `default_target_triple()` — removed duplication across build, run, clean.
## 0.7.1 (02.06.2026)
### Added
* **`--help` для всех команд** — `dcr build --help`, `dcr run --help`, `dcr new --help`,
`dcr init --help`, `dcr clean --help`, `dcr add --help`, `dcr fmt --help`,
`dcr setup --help`, `dcr tree --help`, `dcr gen --help`, `dcr --update --help`,
`dcr test --help`. Во всех результатах вывода используются стилизованные заголовки (зелёного цвета) и строки с информацией об использовании (голубого цвета).
* **Справочные страницы** — 12 страниц в формате troff в каталоге `man/man1/`: `dcr.1`, `dcr-build.1`,
`dcr-run.1`, `dcr-new.1`, `dcr-init.1`, `dcr-clean.1`, `dcr-add.1`, `dcr-test.1`,
`dcr-gen.1`, `dcr-fmt.1`, `dcr-tree.1`, `dcr-setup.1`.
* **Справочные страницы во всех пакетах** — install.sh, install_bsd.sh, PKGBUILD из AUR,
Debian (cargo-deb), RPM (cargo-generate-rpm), Nix (postInstall), Homebrew
(ресурс), Snap, ресурсы релизов GitHub.
* **Проверка имени проекта** — команды `dcr init` и `dcr new` теперь проверяют имена перед созданием файлов
. Допускаются только буквы ASCII, цифры, символы `_` и `-`.
* **Поля `documentation` и `homepage`** — добавлены в файл `Cargo.toml`.
* **Оптимизации профиля релиза** — `opt-level = "z"`, LTO, `codegen-units = 1`,
`panic = "abort"`, `strip = true` для уменьшения размера бинарных файлов.
* **Платформы Linux i686, armv7, riscv64** — добавлены в рабочий процесс выпуска и скрипты установки.
* **Платформы Linux musl i686 и armv7** — скомпилированы с помощью zigbuild в системе непрерывной интеграции (CI).
* **Пакеты AUR** — рабочий процесс публикации `dcr-dev`, `dcr-dev-bin`.
* **Публикация Snap** — автоматическая публикация Snapcraft в рамках непрерывной интеграции (CI).
* **Значок Snap** — в файле README.
### Changed
* **`validate_package_name` стал общедоступным** — его можно вызывать из команд CLI.
* **Таблица платформы README** — реорганизована: варианты libc вынесены в отдельные строки по ОС,
удалены лишние столбцы. Обновлен список архитектур Linux.
* **Вывод `gen.rs` без аргументов** — теперь используется стилизованный вывод вместо необработанного `eprintln!`.
* **`tree.rs`, `fmt.rs` и `setup.rs`** — теперь поддерживают аргументы для опции `--help`.
* **Команды установки из файла README** — `| bash` → `| sh` для обеспечения совместимости с POSIX.
### Fixed
* **`dcr new \<invalid-name>` создает каталог, а затем завершается с ошибкой** — теперь проверка
выполняется до начала любых операций с файлами.
* **`dcr init` при указании недопустимого имени каталога** — то же исправление.
* **Отсутствующие справочные страницы в установленных пакетах** — теперь поставляются во всех форматах.
* **Ложное срабатывание по букве диска Windows** — в модуле анализа файлов зависимостей.
* **CRLF (`\r\n`) вызывает сбой в работе парсера зависимостей** — теперь поддерживается обработка смешанных символов окончания строк.
* **Новая строка после обратного слеша не обработана** — при обработке экранирующих символов в функции `parse_d_file`.
## 0.7.0 (01.06.2026)
### Added
* **Поддержка целевых платформ OpenBSD и NetBSD** — полная маршрутизация по платформам с динамически генерируемыми тройками целевых параметров с использованием `std::env::consts::ARCH` и `std::env::consts::OS`. Затрагивает команды `build`, `run`, `clean` и модуль платформы.
* **`src/platform/bsd.rs`** — новый специальный модуль платформы BSD, общий для FreeBSD, OpenBSD и NetBSD, предоставляющий `bin_path`, `lib_path`, `elf_path`, `efi_path` и `shared_lib_path`.
* **`Параметр конфигурации build.out_dir`** — настраиваемый каталог вывода, который переопределяет путь по умолчанию `target/\<triple>/\<profile>` для конечных артефактов. Поддерживается в `build`, `run` и при проверке конфигурации.
* **Команда `dcr fmt`** — новая команда CLI, которая форматирует все исходные файлы C/C++ (`*.c`, `*.cpp`, `*.h`, `*.hpp`) в `src/` и `tests/` с помощью `clang-format`.
* **Инкрементальная компоновка** — функция `needs_link()` в `common.rs`, которая проверяет, не является ли какой-либо объектный файл более новым, чем скомпонованный результат, пропуская ненужную повторную компоновку. Реализовано для всех бэкэндов (`unix_cc`, `msvc`, `gas`, `nasm`).
* **`build.kind = «none»` и `«custom»`** — два новых типа проектов для специальных сценариев сборки, при которых не создается стандартный артефакт.
* **`install_bsd.sh`** — специальный скрипт установки, совместимый с POSIX, для систем BSD (FreeBSD, OpenBSD, NetBSD) с режимами загрузки бинарных файлов и сборки из исходного кода.
* **Поддержка Linux ARM64 в `install.sh`** — добавлено определение целевой тройки `Linux:aarch64|Linux:arm64` для загрузки готовых бинарных файлов.
* **Обнаружение ОС BSD в `install.sh`** — обнаружение FreeBSD, OpenBSD, NetBSD и определение целевой тройки.
* **`rust-toolchain.toml`** — явное привязывание инструментария к каналу `stable`.
* **Интеграционные тесты** — `build_with_target_config` (проверяет `build.target = «linux»`) и `build_with_out_dir` (проверяет настраиваемый каталог вывода).
* **`get_build_string_with_profile` стал `pub`** — чтобы `run.rs` мог определять конфигурацию настраиваемого каталога вывода.
### Changed
* **Изменена семантика `build.target`** — теперь строго содержит тройку целей (например, `x86_64-unknown-linux-gnu`) или короткое имя (`linux`, `macos`, `windows`). Больше не используется в качестве пользовательского каталога вывода — эта функциональность перенесена в `build.out_dir`.
* **`build.standard` стал опциональным** — изменен с `String` на `Option\<String>`. Проверка обеспечивает только непустоту для языков, отличных от ASM. Пропускается в выводе `dcr.toml`, если пуст.
* **`dcr run` с `out_dir`** — теперь определяет целевой каталог с учетом `build.out_dir`, если он настроен, через `get_build_string_with_profile()` из `build.rs`.
* **`collect_sources()` возвращает пустой вектор** вместо ошибки, если не найдено ни одного исходного файла, что позволяет проектам с `kind = «none»` или `kind = «custom»` не иметь исходных файлов.
* **Рефакторинг рабочего процесса выпуска CI/CD** — `git2` стал целевым (без vendored-openssl на Windows), кросс-компиляция на основе Zig для целей Linux, отличных от x86_64, очистка версий пакетов Arch Linux (тире → точки), символьная ссылка `gmake` для NetBSD.
* **Таблица совместимости README** — статус сборки/работы на FreeBSD, OpenBSD, NetBSD повышен с «сообщество/по возможности» до «официально поддерживается».
* **Обновлена документация** — `build-section.md` описывает новые поля `build.target` и `build.out_dir`. `target-directory.md` переписан для уточнения различия.
### Fixed
* **stdout/stderr `dcr run` не наследуются** — вывод дочернего процесса захватывался и выводился вручную, что приводило к сбоям интерактивных программ. Исправлено путем перехода на `Command::status()`.
* **Условие гонки в CI релиза** — задания матрицы сборки могли загружать ресурсы в релиз, который еще не существовал. Исправлено добавлением специального задания `create-release`.
* **Релиз GHA — переопределение стабильного набора инструментов** — устранены проблемы с переопределением набора инструментов Rust в CI.
* **Очистка версий пакетов Arch Linux** — строки версий с дефисами (например, `0.7.0-dev`) являются недопустимыми для `pkgver` в Arch Linux. Исправлено путем замены дефисов точками.
* **Права доступа GPG после Docker** — операции Docker изменяли владельца каталога GPG. Исправлено путем запуска `chown` после команд Docker.
* **Пути к артефактам пакетов RPM** — артефакты RPM размещались в `rpm/x86_64/` вместо `fedora/x86_64/`. Исправлено в рабочем процессе Dexoron Packages Index.
* **Надежность разбора JSON в `install.sh`** — добавлен `jq` в качестве основного парсера с резервным вариантом `python3` для поиска релизов в канале dev.
### Удалено:
* **Вспомогательная функция `format_roots()`** — удалена из `common.rs`. Использовалась только старым путем обработки ошибок в `collect_sources()`.
* **Отдельные шаги загрузки артефактов для каждой дистрибуции** — три отдельных шага `actions/download-artifact` заменены на унифицированный `gh release download --clobber`.

View File

@@ -0,0 +1,47 @@
---
sidebar_label: Команды сборки (build, run, clean)
---
# Команды сборки
## `dcr build`
Собирает проект по `dcr.toml`.
```bash
dcr build # debug profile
dcr build --release # release build
dcr build --debug # explicit debug
dcr build --target aarch64-unknown-linux-gnu
dcr build --force # full rebuild (also re-runs build.steps / post_steps)
dcr build --clean # clean + build
dcr build --verbose # show compilation commands
dcr build --workspace pkg-a # build specific workspace package
```
Артефакты: `target/\<triple>/\<profile>/\<binary-name>` (Linux с явным целевым объектом).
With `[archive]` in `dcr.toml`, a FAT disk image is packed after a successful build.
## `dcr run`
Собирает (если исходники новее артефакта) и запускает бинарник.
```bash
dcr run
dcr run --release
dcr run --force # force rebuild then run
```
On a **workspace-only** root: if `[run].cmd` is set, that command is used after build; otherwise DCR delegates to a workspace member.
## `dcr clean`
Удаляет директорию `target/`(или `target/\<target>/\<profile>`).
```bash
dcr clean
dcr clean --release # очистить target/release/
dcr clean --target windows # очистить target/x86_64-pc-windows-msvc/
dcr clean --all # очистить все пакеты workspace
```

View File

@@ -0,0 +1,53 @@
---
sidebar_label: Команды зависимостей (add, tree)
---
# Команды зависимостей
## `dcr add \<name> [source]`
Добавляет зависимость в `dcr.toml`.
```bash
dcr add fmt # поиск в реестре
dcr add mylib ../path/to/lib # путь как источник
dcr add mylib path:./lib # явный префикс пути
dcr add mylib git:https://github.com/user/repo # явный префикс git
dcr add mylib github:user/repo # сокращённая запись GitHub
dcr add mylib gitlab:user/repo # сокращённая запись GitLab
```
Префиксы источника:
* `path:` — локальный путь
* `git:` — URL адрес git-репозитория
* `github:` — расширение `https://github.com/\<user>/\<repo>`
* `gitlab:` — расширение `https://gitlab.com/\<user>/\<repo>`
* `http://` / `https://` / `git@` — полный URL
Флаги:
* `--branch \<name>` — git ветка
* `--tag \<name>` — git tag
* `--rev \<hash>` — git commit
Если источник не указан — DCR выполняет поиск в подключенных реестрах.
## `dcr tree`
Показывает дерево зависимостей проекта.
```bash
dcr tree
```
Пример вывода:
```
my-app v0.1.0
├── fmt (registry)
│ └── spdlog (registry)
└── catch2 (registry)
```
В случае path зависимостей, рекурсивно отображает их собственные зависимости (из файла `dcr.toml`).

View File

@@ -0,0 +1,73 @@
---
sidebar_label: Gen команды (vscode, clion, ...)
---
# Gen команды
## `dcr gen \<target>`
Генерирует файл интеграции с IDE.
### vscode
```bash
dcr gen vscode
```
Создаёт:
* `.vscode/tasks.json` — `build` задача (dcr build)
* `.vscode/launch.json` — конфигурация запуска отладки
* `.vscode/settings.json` — настройки C/C++ (clangd пути, includes)
* `.vscode/extensions.json` — рекомендуемые расширения (vscode-clangd, vscode-lldb)
### clion
```bash
dcr gen clion
```
Создаёт:
* `.idea/externalTools.xml` — внешние инструменты (build, run, clean, test)
* `.idea/customTargets.xml` — пользовательские цели сборки
* `.idea/misc.xml` — настройки C/C++ проекта
* `.idea/runConfigurations/\<name>.xml` — конфигурация запуска
### compile-commands
```bash
dcr gen compile-commands
```
Генерирует `compile_commands.json` — стандартный формат для clangd, cpptools, статических анализаторов.
### project-info
```bash
dcr gen project-info
```
Выводит JSON с метаданными проекта:
```json
[
{
"name": "my-app",
"version": "0.1.0",
"root": "/path/to/project",
"profile": "debug",
"language": "c",
"standard": "c17",
"cxx_standard": null,
"compiler": "/usr/bin/clang",
"kind": "bin",
"sources": ["src/main.c"],
"include_dirs": ["src"],
"lib_dirs": [],
"libs": [],
"cflags": ["-std=c17", "-O0", "-g"],
"ldflags": []
}
]
```

View File

@@ -0,0 +1,40 @@
---
sidebar_label: Команды проекта (new, init)
---
# Команды проекта
## `dcr new \<name>`
Создает новый проект со стандартной структурой и `dcr.toml`. Аргумент `name` является обязательным.
В названии проекта допускаются только ASCII буквы, цифры и подчеркивания `_` и дефисы `-`.
```bash
dcr new my-app
dcr new my-app --vcs none
```
Flags:
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
Генерирует:
* `dcr.toml` с базовыми полями
* `src/main.c` с основным шаблоном
## `dcr init`
Инициализирует проект DCR в текущем (пустом) каталоге.
```bash
dcr init
dcr init --vcs none
```
Flags:
* `--vcs \<git|none>` — Initialize version control system (defaults to `git` if available, or `none`).
Название проекта взято из имени текущего каталога. Имя каталога должно соответствовать тем же правилам именования, что и в `dcr new`.

View File

@@ -0,0 +1,60 @@
---
sidebar_label: Команды качества (test, fmt)
---
# Команды качества
## `dcr test`
Запускает тесты.
```bash
dcr test # debug профиль
dcr test --release # release профиль
dcr test --debug # явный debug
dcr test --help # подробная справка
```
Перед первым запуском нужно инициализировать тесты:
```bash
dcr test --init
```
Это создаёт `tests/dcr_test.h` (фреймворк) и `tests/test.c` (шаблон).
Что делает `dcr test`:
1. Собирает проект
2. Собирает файлы `tests/*.c` (только `.c`, не `.cpp`)
3. Компилирует и линкует каждый файл теста
4. Запускает каждый бинарник тестов
5. Вывод сводки: TOTAL, PASS, SKIP, FAIL
6. Возвращает ненулевой код при наличии FAIL
## `dcr fmt`
Форматирует исходный код C/C++ через `clang-format`.
```bash
dcr fmt
```
Процессы: `src/**/*.{c,cpp,cxx,cc,h,hpp,hxx,hh}` и `tests/**/*.{c,cpp,cxx,cc,h,hpp,hxx,hh}`.
Использует `.clang-format` в корне проекта (если таковой имеется), иначе стиль clang-format по умолчанию.
## `dcr lint`
Выполняет `clang-tidy` на C/C++ исходных файлах для статического анализа.
```bash
dcr lint # отобразить диагностику
dcr lint --fix # автоматически применить исправления
dcr lint --help # подробная справка
```
Процессы: `src/**/*.{c,cpp,cxx,cc}` и `tests/**/*.{c,cpp,cxx,cc}`.
Без параметра `--fix` clang-tidy выдает предупреждения и ошибки, не внося изменений в файлы.
При параметре `--fix` clang-tidy автоматически вносит предложения по исправлениям на месте.

View File

@@ -0,0 +1,51 @@
---
sidebar_label: Системные команды (setup, --help, ...)
---
# Системные команды
## `dcr setup`
`~/.dcr/config.toml` — конфигурация реестров
```bash
dcr setup
```
Если файл `~/.dcr/config.toml` не найден, DCR возвращает ошибку. Создайте его вручную:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
## `dcr --help`
Отображает справку по всем командам.
```bash
dcr --help
```
## `dcr --version`
Отображает версию и целевую платформу.
```bash
dcr --version # dcr 0.7.0 (x86_64-unknown-linux-gnu)
```
## `dcr --update`
Автоматическое обновление. Загружает последнюю версию бинарного файла из раздела «Релизы» на GitHub и заменяет текущую версию.
```bash
dcr --update
```
Возможности:
* Определяет платформу и архитектуру автоматически
* Выдает предупреждение при установке через AUR (вместо этого используйте пакетный менеджер)
* Работает на Linux, macOS, Windows

View File

@@ -0,0 +1,52 @@
---
sidebar_label: Вклад
---
# Вклад
## Настройка
```bash
git clone https://github.com/dexoron/dcr
cd dcr
cargo build
```
## Стиль написания кода
Весь код форматируется через `cargo fmt`:
```bash
формат груза
```
## Линтер
```bash
cargo clippy --all-targets -- -D warnings
```
## Тесты
```bash
тест cargo --all-targets
```
## Процесс связей с общественностью
1. Форкните репозиторий
2. Создайте ветку: `git checkout -b feature/description`
3. Внесите изменения
4. Запустите `cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test --all-targets`
5. Откройте Pull Request
## CI
CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check`
* `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features`
* Unit + integration tests on Linux, macOS, Windows
* Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -0,0 +1,66 @@
---
sidebar_label: Часто задаваемые вопросы
---
# Часто задаваемые вопросы
## Реестр не найден
```
Ошибка: реестр не найден
```
**Решение:** Убедитесь, что файл `~/.dcr/config.toml` существует:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
Если реестр кастомный, проверьте `DCR_INDEX_PATH`:
```bash
echo $DCR_INDEX_PATH
```
## Компилятор не найден
```
Ошибка: компилятор не найден
```
**Решение:** Убедитесь, что компилятор установлен и доступен в PATH.
```bash
какой gcc
какой clang
```
Или укажите явно через `[toolchain]` или `DCR_COMPILER`.
## Ctrl+C во время сборки
DCR корректно обрабатывает SIGINT: прерывает текущую компиляцию и завершает процесс с ненулевым кодом.
## Как создать библиотеку?
[Library Recipe](/docs/recipes/library-project).
## Как выполнить кросс-компиляцию для Windows?
См. [Cross-Compile Recipe](/docs/recipes/cross-to-windows).
## Как сделать мультипакетный проект?
См. [Workspace Recipe](/docs/recipes/multi-package-workspace).
## Bootloader / pure NASM OS image
Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk image.
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## Lock-файл устарел
При изменении зависимостей `dcr.lock` автоматически обновляется при следующем `dcr add`. Если нужно принудительно обновить — удалите `dcr.lock` и выполните `dcr build`.

View File

@@ -0,0 +1,79 @@
---
sidebar_label: Первые шаги
---
# Первые шаги
## Создать проект
```bash
dcr new my-app
cd my-app
```
Будет создана структура:
```
my-app/
├── dcr.toml
└── src/
└── main.c
```
`dcr.toml`:
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "none"
[build]
language = "c"
standard = "c11"
compiler = "clang"
kind = "bin"
```
## Сборка
```bash
dcr build
```
Результат — `target/\<triple>/debug/my-app` (Linux) или `target/debug/my-app.exe` (Windows).
Профиль сборки:
```bash
dcr build --release # release сборка
dcr build --debug # debug (по умолчанию)
```
## Запустить
```bash
dcr run
```
Собирает (если нужно) и запускает бинарник.
## Первый тест
```bash
dcr test --init # создать шаблон теста
dcr test # запустить тесты
```
## Форматирование
```bash
dcr fmt # clang-format по .clang-format
```
## Linting
```bash
dcr lint # clang-tidy checks
dcr lint --fix # apply fixes automatically
```

View File

@@ -0,0 +1,135 @@
---
sidebar_label: Установка
---
# Установка
## dcrup (recommended)
Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
### Linux / macOS / BSD / Windows (bash)
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
```
Non-interactive install of DCR in one shot:
```sh
curl -fsSL https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
```
### Windows (PowerShell)
```powershell
irm https://ps1.dcr-tool.ru | iex
# or download then run:
# irm https://ps1.dcr-tool.ru -OutFile dcrup.ps1
# powershell -File .\dcrup.ps1 self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
Optional cmd bootstrap (if you prefer `curl` of the cmd shim):
```bat
curl -fsSL -o dcrup.cmd https://cmd.dcr-tool.ru
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`): shims live in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows `dcrup.cmd`).
### Common dcrup commands
```sh
dcrup install stable # latest stable prebuilt
dcrup install 0.8.2 # pin → 0.8.2@stable
dcrup install 0.8.2@dev
dcrup install stable --libc musl # Linux: musl asset (default: gnu)
dcrup install stable --build # cargo build --features archive
dcrup install night # always build from branch dev HEAD
dcrup default 0.8.2
dcrup update
dcrup list
dcrup show
dcrup which
```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
---
## Arch Linux (AUR)
```sh
ура -S dcr
```
## macOS / Linux (Homebrew)
```sh
brew tap dexoron/dexoron
brew install dcr
```
## Snap (Linux)
```sh
sudo snap install dcrup
```
> If classic Snap Store publishing is unavailable, install the `.snap` from [GitHub Releases](https://github.com/dexoron/dcr/releases/latest) with `--dangerous`.
## Nix (flake)
```sh
nix run github:dexoron/dcr
nix profile install github:dexoron/dcr
```
## Cargo (crates.io)
```sh
cargo install dcr
```
Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh
cargo install dcr --features archive
```
## Из источника
```sh
git clone https://github.com/dexoron/dcr.git
cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
```
## После установки
```bash
dcr --version
dcrup show # if installed via dcrup
```
Man pages (package installs / release assets):
```bash
man dcr
man dcr-build
```
Registry (optional) — `~/.dcr/config.toml`:
```toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```

View File

@@ -0,0 +1,51 @@
---
sidebar_label: Интеграция с IDE
---
# Интеграция с IDE
## VS Code
```bash
dcr gen vscode
```
Генерирует в `.vscode/`:
| Файл | Назначение |
| ----------------- | ------------------------------------------- |
| `tasks.json` | Задача `build` (dcr build) |
| `launch.json` | Debug-запуск бинарника |
| `settings.json` | clangd/IntelliSense: include пути, стандарт |
| `extensions.json` | Рекомендует clangd, C/C++ |
## CLion
```bash
dcr gen clion
```
Генерирует в `.idea/`:
| Файл | Назначение |
| ----------------------------------------- | ------------------------------------------------ |
| `externalTools.xml` | Build, Run, Clean, Test как внешние инструменты |
| `customTargets.xml` | Кастомные цели сборки |
| `misc.xml` | Настройки C/C++ проекта |
| `runConfigurations/dcr_build_and_run.xml` | Конфигурации запуска для каждого бинарного файла |
## compile_commands.json
```bash
dcr gen команды компиляции
```
Генерирует `compile_commands.json` в корне проекта. Стандартный формат для:
## информация о проекте
```bash
dcr gen info-проекта
```
Выводит JSON с метаданными проекта (см. [gen-commands](/docs/commands/gen-commands)).

View File

@@ -0,0 +1,33 @@
---
sidebar_label: Лицензия
---
# Лицензия
## DCR
DCR распространяется под лицензией [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html).
> **Важно:** DCR — инструмент сборки, а не библиотека. GPL распространяется только на исходный код самого DCR. Проекты, собранные с помощью DCR, не подпадают под лицензию DCR — их лицензирование определяется исключительно их собственным кодом и зависимостями.
## Rust-зависимости
DCR написан на Rust. Ниже перечислены основные статически связываемые крейты:
| Крейт | Лицензия |
| ------------------------------------------------------- | ------------------ |
| [`ureq`](https://crates.io/crates/ureq) | MIT ИЛИ Apache-2.0 |
| [`serde`](https://crates.io/crates/serde) | MIT ИЛИ Apache-2.0 |
| [`toml`](https://crates.io/crates/toml) | MIT ИЛИ Apache-2.0 |
| [`toml_edit`](https://crates.io/crates/toml_edit) | MIT OR Apache-2.0 |
| [`serde_json`](https://crates.io/crates/serde_json) | MIT ИЛИ Apache-2.0 |
| [`sha2`](https://crates.io/crates/sha2) | MIT ИЛИ Apache-2.0 |
| [`glob`](https://crates.io/crates/glob) | MIT ИЛИ Apache-2.0 |
| [`self-replace`](https://crates.io/crates/self-replace) | MIT ИЛИ Apache-2.0 |
| [`ctrlc`](https://crates.io/crates/ctrlc) | MIT ИЛИ Apache-2.0 |
Full dependency tree is available in [`Cargo.lock`](https://github.com/dexoron/dcr/blob/main/Cargo.lock). Подавляющее большинство имеют двойную лицензию MIT OR Apache-2.0.
## Дополнительные благодарности
* Дизайн CLI и модель проектов DCR вдохновлены [Cargo](https://doc.rust-lang.org/cargo/).

View File

@@ -0,0 +1,47 @@
---
sidebar_label: Кросс-компиляция для Windows
---
# Кросс-компиляция для Windows на Linux
Сборка Windows-бинаря на Linux с использованием mingw-w64.
## Установка toolchain
```bash
# Ubuntu/Debian
sudo apt install mingw-w64
# Fedora
sudo dnf install mingw64-gcc mingw64-binutils
```
## Конфигурация
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "app"
[build]
language = "c"
standard = "c17"
target = "windows"
```
## Сборка
```bash
dcr build --target windows --release
```
Артефакт: `target/x86_64-pc-windows-gnu/release/my-app.exe`.
## Кастомный toolchain (опционально)
```toml
[toolchain]
cc = "x86_64-w64-mingw32-gcc"
cxx = "x86_64-w64-mingw32-g++"
```

View File

@@ -0,0 +1,70 @@
---
sidebar_label: Проект библиотеки
---
# Проект библиотеки
Создание статической библиотеки и её использование в другом проекте.
## Шаг 1: Создать библиотеку
```bash
dcr new my-lib
```
`dcr.toml`:
```toml
[package]
name = "my-lib"
version = "0.1.0"
type = "lib"
[build]
language = "c"
standard = "c17"
kind = "staticlib"
```
`src/my_lib.h`:
```c
#ifndef MY_LIB_H
#define MY_LIB_H
int add(int a, int b);
#endif
```
`src/my_lib.c`:
```c
#include "my_lib.h"
int add(int a, int b) { return a + b; }
```
## Шаг 2: Собрать
```bash
cd my-lib
dcr build --release
```
Артефакты:
* `target/release/libmy-lib.a` (Linux/macOS)
* `target/release/my-lib.lib` (Windows)
* `target/include/` — заголовочные файлы
## Шаг 3: Использовать в проекте
```bash
dcr new my-app
cd my-app
dcr add ../my-lib
```
Автоматически:
* Добавляется include path на `target/include/` библиотеки
* Добавляется lib path на `target/release/`
* Линкуется `libmy-lib.a` / `my-lib.lib`

View File

@@ -0,0 +1,103 @@
---
sidebar_label: Рабочая область с несколькими пакетами
---
# Рабочая область с несколькими пакетами
Проект из трёх пакетов: библиотека, утилита и основной бинарник.
## Структура
```
workspace/
├── dcr.toml # корневой workspace
├── lib-core/
│ ├── dcr.toml
│ └── src/lib.rs
├── lib-utils/
│ ├── dcr.toml
│ └── src/utils.c
└── app/
├── dcr.toml
└── src/main.c
```
## Корневой dcr.toml
```toml
[package]
name = "my-workspace"
version = "0.1.0"
type = "none"
[build]
inherit = true
language = "c"
standard = "c11"
workspace_only = true
[workspace.lib-core]
path = "lib-core"
[workspace.lib-utils]
path = "lib-utils"
deps = ["lib-core"]
[workspace.app]
path = "app"
deps = ["lib-core", "lib-utils"]
main = true
```
## Пакеты
`lib-core/dcr.toml`:
```toml
[package]
name = "lib-core"
version = "0.1.0"
type = "lib"
[build]
kind = "staticlib"
```
`lib-utils/dcr.toml`:
```toml
[package]
name = "lib-utils"
version = "0.1.0"
type = "lib"
[build]
kind = "staticlib"
```
`app/dcr.toml`:
```toml
[package]
name = "app"
version = "0.1.0"
type = "app"
[build]
kind = "bin"
```
## Сборка
```bash
cd workspace
dcr build # собирает всё в правильном порядке
dcr build --workspace app # только app (lib-core и lib-utils собираются как зависимости)
dcr run # собирает и запускает main-пакет
```
Порядок сборки (топологическая сортировка):
1. `lib-core`
2. `lib-utils` (зависит от lib-core)
3. `app` (зависит от lib-core, lib-utils)

View File

@@ -0,0 +1,89 @@
---
sidebar_label: OS-dev (flat-bin + archive)
---
# Pure ASM / boot image (flat-bin + archive)
Minimal OS-dev style pipeline: assemble raw binaries with NASM, then pack a FAT floppy/image with an optional boot sector.
## Project layout
```
myos/
dcr.toml
src/
boot.asm # boot sector (512 bytes)
kernel.asm # payload
```
For multiple flat artifacts, use a **workspace** (one member per binary) or separate packages; a single `flat-bin` package produces one binary per source stem.
## Boot package (`flat-bin`)
```toml
[package]
name = "boot"
version = "0.1.0"
[build]
language = "asm"
compiler = "nasm"
kind = "flat-bin"
extension = "bin"
roots = ["src/boot.asm"]
```
```bash
dcr build
# → target/<…>/debug/boot.bin (NASM -f bin, no link)
```
## Disk image after build
```toml
[archive]
output = "target/{profile}/disk.img"
format = "fat12"
size = "1440K"
label = "MYOS"
bootsector = "target/{profile}/boot.bin"
[[archive.layout]]
from = "target/{profile}/kernel.bin"
to = "KERNEL.BIN"
```
* `format`: `fat12`, `fat16`, or `fat32`
* `size`: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default ~1.44 MiB)
* `bootsector`: written only when `offset` is omitted or `0`
* `from` may be a glob; `{profile}` is substituted in paths
## C kernel → flat binary
```toml
[build]
language = "c"
compiler = "clang"
kind = "flat-bin"
freestanding = true
filename = "kernel"
extension = "bin"
ldflags = ["-T", "linker.ld"]
```
Pipeline: objects → temporary linked ELF → `objcopy -O binary` → `kernel.bin`. Requires `objcopy` / `llvm-objcopy` in PATH.
## Other assemblers
| Tool | Notes |
| -------- | --------------------------------------------------------------------------------------- |
| **FASM** | Write `format binary` in the source; DCR writes `\<stem>.bin` directly |
| **GAS** | Assemble `.s` → obj → `objcopy -O binary` |
| **LLC** | `language = "llvm_ir"` → obj → objcopy |
| **MASM** | COFF obj → objcopy (needs binutils/LLVM objcopy) |
## Notes
* Single-file `roots` are supported: `roots = ["src/boot.asm"]`.
* `--force` re-runs `build.steps` / `build.post_steps` as well as recompilation.
* Prefer `kind = "elf"` if you need a relocatable ELF kernel without stripping to raw binary.

View File

@@ -0,0 +1,82 @@
---
sidebar_label: dcr build --profile lto
---
# Встроенные профили
Профили позволяют переопределять любые поля секции `[build]` для конкретного режима сборки.
## Конфигурация
```toml
[build]
language = "c"
standard = "c17"
cflags = ["-Wall"]
[build.debug]
cflags = ["-O0", "-g"]
[build.release]
cflags = ["-O3", "-flto"]
```
## Правила
Поля из `[build.\<profile>]` **мержатся поверх** `[build]`
* **Скалярные поля** (строки, числа, логические значения) — заменены
* Массивы (`cflags`, `ldflags`, ...) **заменяются полностью**, а не дополняются
Установите `inherit = false`, чтобы отключить наследование массивов (будут использоваться только собственные массивы профиля).
## Кастомные профили
Флаги по умолчанию для каждого профиля формируются из трёх полей конфигурации:
| Поле | Default cflags | Профили сборки |
| ---------------- | ------------------ | -------------- |
| `opt_level` | `-O0 -g` | `"3"` |
| `debug` | `true` | `false` |
| `предупреждения` | `["all", "extra"]` | `[]` |
Которые генерируют соответствующие флаги компилятора:
| Профиль | Действующие флаги |
| ------- | ---------------------------------------------------------- |
| `debug` | `-O0 -g -Wall -Wextra -fno-omit-frame-pointer -DDCR_DEBUG` |
| `релиз` | `-O3 -DNDEBUG` |
Дополнительные параметры сборки можно включать или отключать для каждого профиля:
```toml
[build.release]
opt_level = "z"
lto = true
strip = true
panic = "abort"
codegen-units = "1"
[build.debug]
opt_level = "1"
debug = false
warnings = ["all", "error"]
```
## Target-specific профили
```toml
[build.linux]
cflags = ["-DLINUX"]
[build.windows.debug]
cflags = ["-DWIN32", "-O0", "-g"]
```
Порядок применения (в порядке убывания приоритета):
1. `[build.\<target>.\<profile>]`
2. `[build.\<profile>.\<target>]`
3. ]`или`[build.\<target>]\`
4. `[build.\<profile>]`.
5. `[build]`

View File

@@ -0,0 +1,136 @@
---
sidebar_label: Система сборки
---
# Система сборки
## Бэкенды компилятора
DCR поддерживает 4 бэкенда компиляции. Выбор происходит автоматически на основе расширения файла и target triple.
| Бэкенд | Файлы | Когда используется |
| --------- | --------------------------------------- | ------------------------------------- |
| `unix_cc` | `.c`, `.cpp`, `.cxx`, `.cc`, `.s`, `.S` | gcc/clang на Linux/macOS/BSD |
| `msvc` | `.c`, `.cpp`, `.cxx`, `.cc` | Windows (cl, clang-cl) |
| `газ` | `.s`, `.S` | ARM/ARM64 ассемблер |
| `nasm` | `.asm`, `.s` | x86/x86_64 ассемблер |
| `masm` | `.asm` | MASM (ml/ml64) в Windows |
| `fasm` | `.asm`, `.fasm` | Сборщик плоских деталей |
| `llvm_ir` | `.ll` | LLVM IR с помощью `llc -filetype=obj` |
## Поддержка Qt
DCR обеспечивает встроенную поддержку Qt для автоматической обработки метаобъектов (MOC, UIC, RCC).
Чтобы включить эту функцию, установите значение `build.qt = true` в файле `dcr.toml`. DCR автоматически обнаружит файлы, связанные с Qt (`.ui`, `.qrc`, `.h` с `Q_OBJECT`), и обработает их.
```toml
[build]
qt = true
```
*Примечание: Требуется установка модулей `qt6` (Core, Widgets, Gui, Svg) с помощью `pkg-config`.*
Если требуется специальная обработка, по-прежнему можно выполнить расширенную настройку с помощью файла `build.steps`:
```toml
[build.steps]
moc = "moc {in} -o {out}"
```
### Unix CC
* Компилятор определяется через `resolve_compiler()`: CC/CXX из [toolchain], DCR_COMPILER/env, PATH
* Поддерживает генерацию `.d` файлов для header dependency tracking
* Флаги: `-std=`, `-MMD -MF`, `-c -o`, `-I`, `-L`, `-l`
* Условные флаги, зависящие от настроек:
* `freestanding` или целевая среда «bare-metal»: `-ffreestanding` (компиляция), `-nostdlib -static` (линковка)
* `lto`: `-flto` (компиляция + линковка)
* `panic = "abort"`: `-fno-exceptions` (только для C++), `-fno-unwind-tables`, `-fno-asynchronous-unwind-tables`
### MSVC
* Поддерживает cl.exe и clang-cl.exe
* Флаги: `/std:`, `/Fo:`, `/Fe:`, `/I`, `/link`
### GAS / NASM
* GAS: `-I`, `-c -o`, `--defsym`
* NASM: `-I`, `-o`, `-D`, `-f` (format: win64/elf64/macho64/macho32/elf32; **`bin` when `kind = "flat-bin"`**)
* MASM: `/nologo /c /Fo\<obj> <source>`
* FASM: `<source> \<output>` (путь вывода — объектный файл)
* LLVM IR: `-filetype=obj <source> -o \<output>`
## Инкрементные сборки
Три уровня инкрементальности:
1. **mtime** — если выходной файл новее всех входных, файл не перекомпилируется
2. **`.d` files** — отслеживание изменений в заголовочных файлах (включая транзитивные)
3. **SHA256 fingerprint** — если флаги компиляции изменились, файл перекомпилируется (fingerprint хранится в `.dcr_fingerprint`)
## Параллельная компиляция
* Используется `thread::scope` для создания пула потоков
* Атомарная очередь задач (`AtomicU64`)
* Мьютекс на запись в stdout (`OUTPUT_MUTEX`)
* Количество потоков = `available_parallelism()`, ограниченное значением `build.codegen-units`, если оно задано
## Типы сборок
| Тип | Тип | Путь (пример для Linux) |
| ------------------ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `bin` | Исполняемый файл | `target/\<profile>/\<name>` (.exe) |
| `staticlib` | Статическая библиотека | `target/\<profile>/lib\<name>.a` (.lib) |
| `sharedlib` | Динамическая библиотека | `target/\<profile>/lib\<name>.so` (.dll/.dylib) |
| `efi` | UEFI приложение | `target/\<profile>/\<name>.efi` |
| `эльф` | ELF без стандартной библиотеки | `target/\<profile>/\<name>` |
| `нет` | Только компиляция, без линковки | — |
| `пользовательский` | Полный контроль filename + extension | `target/\<profile>/\<filename>.\<extension>` |
| `flat-bin` | Raw binary | ASM: `\<stem>.bin` (NASM `-f bin` / FASM / GAS·MASM·LLC via objcopy); C/C++: `\<name>.bin` (link + objcopy) |
## Disk images (`[archive]`)
After a successful build, if `[archive]` is present in `dcr.toml`, DCR formats a FAT volume and copies files from `layout` into the image. See [dcr.toml → archive](/docs/reference/dcr-toml#archive).
## Этапы сборки
DCR поддерживает pre-build и post-build шаги через Qt codegen:
* `build.steps` — команды, выполняемые перед компиляцией
* `build.post_steps` — команды, выполняемые после компиляции
Подстановки: `{stem}`, `{in}`, `{out}`.
`rcc` — Resource Compiler: `{stem}.qrc → qrc_{stem}.cpp`
```toml
[build.steps]
moc = "moc {in} -o {out}"
```
## pkg-config
Автоматический поиск (чтение из исходного файла конфигурации):
```toml
[build]
pkg_config = ["sdl2", "gl"]
```
DCR вызывает `pkg-config --cflags sdl2 gl` и `pkg-config --libs sdl2 gl` и добавляет результат в флаги компиляции/линковки.
## Подстановка переменных
Поддерживаемые переменные:
| Переменная | Описание |
| ----------------------- | ----------------------------------------- |
| `{version}` | Версия пакета |
| `{version_major}` | Часть, обозначающая основную версию |
| `{version_minor}` | Часть, обозначающая второстепенную версию |
| `{version_patch}` | Переменная |
| `{version_suffix}` | Суффикс (например, `-rc1`) |
| `{version_suffix_dash}` | Суффикс с тире |
| `{profile}` | Имя профиля (debug/release/...) |
| `{name}` | Имя пакета |

View File

@@ -0,0 +1,64 @@
---
sidebar_label: Кросс-компиляция
---
# Кросс-компиляция
## Сокращённые названия
DCR поддерживает короткие имена платформ, которые автоматически раскрываются в полные triples:
| Краткое название | Полный тройной |
| ---------------- | -------------------------- |
| `linux` | `x86_64-unknown-linux-gnu` |
| `macos` | `x86_64-apple-darwin` |
| `windows` | `x86_64-pc-windows-msvc` |
```bash
dcr build --target windows
```
## Полные тройки
```bash
dcr build --target aarch64-unknown-linux-gnu
dcr build --target x86_64-pc-windows-gnu
dcr build --target armv7-unknown-linux-gnueabihf
```
## clang --target
При использовании clang DCR автоматически inject-ит `--target=\<triple>` в CFLAGS/CXXFLAGS.
```toml
[build]
compiler = "clang"
target = "aarch64-unknown-linux-gnu"
# Авто: cflags = ["--target=aarch64-unknown-linux-gnu"]
```
## Bare-Metal
Для целевых платформ, содержащих значения `none`, `-elf`, `eabi` или `baremetal`, DCR автоматически:
1. Для none/elf/eabi/bare-metal target-ов отключаются DCR default флаги (нет `-I` системных путей, нет `-l` libc).
2. **Вставляет `-ffreestanding`** на этапе компиляции и `-nostdlib -static` на этапе линковки
Кроме того, можно явно включить автономный режим:
```toml
[build]
freestanding = true
```
```bash
dcr build --target aarch64-none-elf
```
## Целевой каталог
By default, the compilation output directories are structured as follows:
* **Linux and BSD**: Always output to `target/\<triple>/\<profile>/` (using host triple if no target is specified).
* **macOS and Windows (without target)**: Output to `target/\<profile>/`.
* **macOS and Windows (with explicit target)**: Output to `target/\<triple>/\<profile>/`.

View File

@@ -0,0 +1,263 @@
---
sidebar_label: Обзор dcr.toml
---
# Обзор dcr.toml
Основной конфигурационный файл проекта. Располагается в корне проекта.
## Структура
```toml
[package]
# required fields
[build]
# build settings
[build.debug] # optional: debug override
[build.release] # optional: release override
[build.linux] # optional: Linux override
[build.windows] # optional: Windows override
[build.windows.debug] # target + profile combination
[toolchain]
# compiler/linker paths
[dependencies]
# project dependencies
[workspace]
# multi-package configuration
[run]
# run settings
[archive]
# optional: pack FAT disk image after build
```
## [пакет]
| Поле | Обязательное | Описание |
| ---------- | ------------ | ------------------------------------------- |
| `имя` | да | Имя проекта |
| `версия` | да | Семантическая версия |
| `тип` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `лицензия` | нет | SPDX-идентификатор лицензии |
| `автор` | нет | Автор |
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "app"
license = "MIT"
author = "John Doe"
```
## [сборка]
...
* `build.qt` — (bool) Включить автоматическую обработку метаобъектов Qt (MOC, UIC, RCC). Требуется установка модулей `qt6` с помощью `pkg-config`.
| Поле | По умолчанию | Описание |
| ------------------------ | ------------- | --------------------------------------------------------------------------------------------------------- |
| `язык` | `"c"` | `"c"`, `"c++"`, `"cpp"`, `"cxx"`, `"asm"`, `"llvm_ir"`, `"llvm-ir"`, `"ll"` (optional, defaults to `"c"`) |
| `стандартный` | `"c11"` | Стандарт C (`c11`, `c17`, `c23`) |
| `cxx_standard` | — | Стандарт C++ (`c++17`, `c++20`, `c++23`) |
| `компилятор` | `cxxflags` | Preferred compiler (optional, defaults to `"clang"`) |
| `тип` | `"bin"` | `bin`, `staticlib`, `sharedlib`, `efi`, `elf`, `none`, `custom`, `flat-bin` |
| `target` | хост | Target triple для кросс-компиляции |
| `платформа` | `"нативный"` | `native`, `efi`, `freestanding` |
| `cflags` | `[]` | Дополнительные флаги C++ |
| `ldflags` | `[]` | Дополнительные флаги линковки |
| `имя файла` | `""` | Кастомное имя выходного файла |
| `расширение` | `""` | Custom file extension (for `flat-bin`, default is `bin`) |
| `корни` | `["src"]` | Source roots: directories and/or individual source/header files |
| `exclude` | `[]` | Паттерны исключений |
| `include` | `[]` | Дополнительные include-директории |
| `src_disable` | `false` | Отключить автоматический поиск источников |
| `наследовать` | `false` | Наследовать build от корня workspace |
| `clean` | `[]` | Шаблоны Glob для настраиваемых чистых путей |
| `out_dir` | `""` | Пользовательский каталог для вывода данных |
| `только рабочая область` | `false` | Workspace-only, not built standalone (no `language`/`compiler` required) |
| `отдельно стоящий` | `false` | Компилировать в автономном режиме (`-ffreestanding` + `-nostdlib -static`) |
| `opt_level` | — | Optimization level: `0`-`3`, `"s"`, `"z"` (derived from profile if omitted) |
| `ldscript` | profile-based | Emit debug symbols (`-g`): `true` in debug, `false` in release |
| `lto` | `false` | Оптимизация на этапе компоновки (`-flto` как для компилятора, так и для компоновщика) |
| `asflags` | `false` | Удалить символы из вывода (опция `-s` в ldflags) |
| `true` | `[]` | Warning flags (e.g. `"all"`, `"extra"`, `"pedantic"`); engine adds `-Wall -Wextra` in debug if empty |
| `panic` | `""` | Стратегия «Паника»: `"abort"` отключает исключения и таблицы развертки |
| `codegen-units` | `""` | Максимальное количество параллельных заданий компиляции (`"0"` = автоматически) |
| `qt` | `false` | Включить автоматическую обработку метаобъектов Qt (MOC, UIC, RCC) |
Параметры из исходного файла конфигурации (не в виде типизированной структуры):
* Пакеты для pkg-config
* Путь к linker script
* `build.steps` / `build.post_steps` — этапы генерации кода
## Per-language overrides: `[build.c]`, `[build.cxx]`, `[build.asm]`, `[build.llvm_ir]`
Each language can have its own table that overrides the flat `[build]` settings:
```toml
[build]
compiler = "clang"
standard = "c11"
[build.c]
standard = "c23"
compiler = "gcc"
[build.cxx]
standard = "c++23"
compiler = "g++"
[build.asm]
compiler = "nasm"
flags = ["-felf64"]
[build.llvm_ir]
compiler = "llc"
```
The flat `[build]` acts as fallback; per-language tables take precedence for their language.
Пример:
```toml
[build]
language = ["cpp", "c"]
standard = "c17"
standard = "c23"
cxx_standard = "c++23"
compiler = "clang"
kind = "sharedlib"
cflags = ["-Wall", "-Wextra"]
pkg_config = ["sdl2", "gl"]
```
## [набор инструментов]
```toml
[toolchain]
cc = "/usr/bin/clang"
cxx = "/usr/bin/clang++"
as = "/usr/bin/as"
ar = "/usr/bin/ar"
ld = "/usr/bin/ld.lld"
uic = "/usr/bin/uic" # Qt
moc = "/usr/bin/moc" # Qt
rcc = "/usr/bin/rcc" # Qt
```
Raw config также поддерживает `uic`, `moc` и `rcc` для генерации кода Qt.
## [зависимости]
См. [dependencies](/docs/reference/dependencies).
## [запустить]
```toml
[запустить]
cmd = "./target/{profile}/{name}"
```
Подстановки:
* `{version}` — версия из [package]
* `pkg_config`
* `{profile}` — отладочная / релизная версия
* `{name}` — имя из [package]
По умолчанию `cmd` вычисляется как `./target/{profile}/{name}`.
## [рабочая область]
См. [workspaces](/docs/reference/workspaces).
## [archive]
Optional post-build step: format a FAT volume and copy built artifacts into a disk image. Runs after a successful package build (and after workspace member builds that define `[archive]`).
Requires DCR built with the `archive` Cargo feature (`cargo build --features archive`). Release binaries include this feature.
| Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) |
| `format` | yes | `fat12`, `fat16`, or `fat32` |
| `size` | no | Image size: bytes or `K`/`KB`/`M`/`MB`/`G`/`GB` (default `1474560` ≈ 1.44 MiB) |
| `offset` | no | Byte offset of the FAT volume inside the image (default `0`) |
| `label` | no | Volume label (max 11 chars, default `VOLUME`) |
| `bootsector` | no | Path to a 512-byte boot sector written at offset 0 when `offset` is 0 (`{profile}` allowed) |
| `layout` | no | List of `{ from, to }` entries (files or globs → path inside the volume) |
```toml
[archive]
output = "target/{profile}/disk.img"
format = "fat12"
size = "1440K"
label = "MYOS"
bootsector = "target/{profile}/boot.bin"
[[archive.layout]]
from = "target/{profile}/kernel.bin"
to = "KERNEL.BIN"
[[archive.layout]]
from = "assets/*"
to = "/"
```
Typical pairing with `kind = "flat-bin"` (NASM `-f bin`) for bootloaders and pure-ASM OS images.
## `flat-bin` (kind)
Produces a raw binary (default extension `bin`) for boot sectors, kernels, and freestanding payloads.
### Assemblers
| Tool | Language / compiler | How flat-bin is produced |
| ---- | ------------------------------------------ | -------------------------------------------- |
| NASM | `language = "asm"`, `compiler = "nasm"` | `-f bin` → `\<stem>.bin` |
| FASM | `compiler = "fasm"` | direct write (use `format binary` in source) |
| GAS | `compiler = "as"` / `"gas"` | assemble → `objcopy -O binary` |
| MASM | `compiler = "ml"` / `"ml64"` | assemble → `objcopy -O binary` |
| LLC | `language = "llvm_ir"`, `compiler = "llc"` | `-filetype=obj` → `objcopy -O binary` |
```toml
[build]
language = "asm"
compiler = "nasm"
kind = "flat-bin"
extension = "bin"
roots = ["src/boot.asm"]
```
### C / C++
Compile all sources, link with `-nostdlib -static` (plus your `ldflags` / `ldscript`), then convert the intermediate ELF/PE with `objcopy -O binary` to `\<filename|name>.bin`.
```toml
[build]
language = "c"
compiler = "clang"
kind = "flat-bin"
freestanding = true
filename = "kernel"
extension = "bin"
ldscript = "linker.ld"
ldflags = ["-T", "linker.ld"]
```
Notes:
* Multi-file **ASM** packages emit one `\<stem>.bin` per source; **C/C++** emit a single project binary.
* `objcopy` tools tried in order: `llvm-objcopy`, `objcopy`, `gobjcopy`.
* Incompatible with `build.qt = true`.
* `dcr run` rejects `flat-bin` (not a host executable).

View File

@@ -0,0 +1,88 @@
---
sidebar_label: Зависимости
---
# Зависимости
## Форматы
В секции `[dependencies]` поддерживаются три формата:
### Строка (реестр)
```toml
[dependencies]
fmt = "10.1.1"
spdlog = "^1.12"
catch2 = ">=3.0,<4.0"
```
Строка версии используется без изменений для поиска в реестре.
### Табличный (git)
```toml
[dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" }
```
Поля: `git`, `branch`, `tag`, `rev`, `features`.
### Табличный (path)
```toml
[dependencies]
mylib = { path = "../mylib" }
```
## Реестр
## RegistryDCR использует реестр пакетов для поиска зависимостей по имени.```toml
# ~/.dcr/config.toml
[registry]
main = { url = "https://github.com/dcr-ports/dcr-index", priority = 1 }
```
```toml
# ~/.dcr/config.toml
[registry.default]
url = "https://index.dcr.pm"
priority = 1
```
Приоритет реестра: порядок в файле `config.toml`. Переменная `DCR_INDEX_PATH` переопределяет путь к index.json.
## Git-зависимости
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources:
* `branch` — переключиться на ветку
* `tag` — переключиться на тег
* `rev` — переключиться на конкретный коммит
* `features` — флаги функций (проанализированы, но не влияют на сборку)
## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`.
```toml
[dependencies]
mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" }
```
*Note: Header resolution automatically checks the packaged `target/include` directory of path dependencies, ensuring consumer packages can find headers from compiled static or dynamic libraries.*
## dcr.lock
Dependency lock file. Contains package names and sources.
Created during `dcr build` when registry dependencies are present. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process
1. Load all dependencies (registry → git → path)
2. For path deps: recursively read their `dcr.toml`
3. For registry deps: search `index.json`
4. For git deps: clone to cache
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -0,0 +1,60 @@
---
sidebar_label: Переменные среды
---
# Переменные среды
## DCR_COMPILER
Переопределяет компилятор для всех языков. **Наивысший приоритет.**
```bash
export DCR_COMPILER=clang
dcr build
```
Приоритет разрешения компилятора:
1. `DCR_COMPILER` (переменная среды)
2. `DCR_CC` / `DCR_CXX` / `DCR_AS` (переменная среды)
3. `[toolchain]` (dcr.toml)
4. `build.compiler` (dcr.toml)
5. `PATH`
## DCR_CC / DCR_CXX / DCR_AS
Приоритет: `[toolchain]` > `DCR_COMPILER` > `DCR_CC` > `PATH`.
```bash
export DCR_CC=gcc-14
export DCR_CXX=g++-14
export DCR_AS=arm-linux-gnueabihf-as
```
## DCR_LD / DCR_AR
Переопределить линкер и архиватор.
```bash
export DCR_LD=ld.lld
export DCR_AR=llvm-ar
```
## DCR_DEBUG
Включает режим отладки — печатает все команды компиляции перед выполнением.
```bash
export DCR_DEBUG=1
dcr build
```
## DCR_INDEX_PATH
Переопределяет путь к index.json реестра.
```bash
export DCR_INDEX_PATH=/custom/path/index.json
```
По умолчанию: `~/.dcr/index.json`.

View File

@@ -0,0 +1,53 @@
---
sidebar_label: Поддержка платформ
---
# Поддержка платформ
## Тройные цели
DCR нормализует target triple через `platform_triple::normalize_triple()`. Если задано имя платформы (short name), оно раскрывается в triple.
### Linux
```
target/<arch>-unknown-linux-<env>/<profile>/
```
Architectures: `x86_64`, `aarch64`, `i686`, `armv7`, `riscv64` (host-detected).
Environments: `gnu` (default), `musl`.
Тип артефакта: ELF. Расширения: `.so` для sharedlib, `.a` для staticlib
### macOS
```
target/<profile>/ (default) or target/<triple>/<profile>/ (with target)
```
Поддержка архитектур: `x86_64`, `aarch64`.
`.dylib` для sharedlib, `.a` для staticlib
### Windows
```
target/<profile>/ (default) or target/<triple>/<profile>/ (with target)
```
Поддержка архитектур: `x86_64`, `aarch64`.
Environments: `msvc` (default), `gnu` (MinGW).
Расширения: `.exe` (бинарный файл), `.lib` (статическая библиотека), `.dll` (общая библиотека), `.efi` (UEFI).
### BSD
```
target/<arch>-unknown-<os>/<profile>/
```
Поддерживаемые системы: `freebsd`, `openbsd`, `netbsd`.
## Определение хоста
`platform_triple::host_triple()` возвращает тройку текущей системы. Используется как fallback, если `target` не указан.

View File

@@ -0,0 +1,80 @@
---
sidebar_label: Рабочие пространства
---
# Рабочие пространства
Workspaces позволяют управлять несколькими пакетами в одном репозитории.
## Конфигурация
```toml
[workspace]
members = [
{ path = "pkg-a" },
{ path = "pkg-b", deps = ["pkg-a"] },
{ path = "pkg-c", deps = ["pkg-a", "pkg-b"], main = true },
]
```
### Поля member
| Поле | Описание |
| ------ | -------------------------------------------- |
| `path` | Путь к пакету (относительно корня workspace) |
| `deps` | Зависимости от других member-ов |
| `main` | Пометить как главный пакет |
## Топологическая сортировка
DCR автоматически сортирует пакеты по зависимостям: пакет A собирается раньше B, если B зависит от A.
Циклические зависимости обнаруживаются и приводят к ошибке.
## Сборка
```bash
dcr build # собрать все пакеты
dcr build --workspace pkg-a # собрать только pkg-a
```
When building a workspace, DCR automatically injects include and library paths of dependent workspace members:
* **Include Paths**: Automatically resolves and injects header directories of dependencies, including the member's `src/` directory, local `include/` directory, and the packaged `target/include` directory.
* **Library Paths**: Injects compiled library search paths (`target/lib` as well as target-specific build folders) to allow automatic linking with member libraries.
## Очистка
```bash
dcr clean # очистить только корневой target/
dcr clean --all # очистить target/ всех пакетов
```
## Наследование
Если у member-а нет своей секции `[build]`, а в корневом `[build]` указано `inherit = true`:
```toml
[build]
inherit = true
language = "c"
standard = "c17"
```
## Workspace-only root (no build of its own)
A workspace root can set `workspace_only = true` — it won't be built itself, and doesn't need `language` or `compiler`:
```toml
[package]
name = "my-workspace"
version = "0.1.0"
[build]
workspace_only = true
kind = "bin"
[workspace]
lib-core = { path = "lib-core" }
app = { path = "app", deps = ["lib-core"] }
```

Some files were not shown because too many files have changed in this diff Show More