104 Commits

Author SHA1 Message Date
87406928ff New translations cli-output.mdx (Ukrainian)
[ci skip]
2026-10-21 21:18:45 +08:00
78ad3bf3d8 New translations installation.mdx (Ukrainian)
[ci skip]
2026-10-21 21:18:43 +08:00
0d8830edc5 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-10-21 21:18:40 +08:00
b087f24b83 New translations cli-output.mdx (Russian)
[ci skip]
2026-10-21 21:18:36 +08:00
238aaae9d4 New translations installation.mdx (Russian)
[ci skip]
2026-10-21 21:18:33 +08:00
4bc037a159 New translations changelog.mdx (Russian)
[ci skip]
2026-10-21 21:18:30 +08:00
400f1d0e7b New translations cli-output.mdx (Polish)
[ci skip]
2026-10-21 21:18:26 +08:00
471a008721 New translations installation.mdx (Polish)
[ci skip]
2026-10-21 21:18:23 +08:00
5610b5de38 New translations changelog.mdx (Polish)
[ci skip]
2026-10-21 21:18:20 +08:00
bc55b9f50a New translations cli-output.mdx (German)
[ci skip]
2026-10-21 21:18:17 +08:00
7fbf5e466f New translations installation.mdx (German)
[ci skip]
2026-10-21 21:18:14 +08:00
86c0154c93 New translations changelog.mdx (German)
[ci skip]
2026-10-21 21:18:11 +08:00
000ad89798 New translations dcr-toml.mdx (Ukrainian)
[ci skip]
2026-09-13 15:12:45 +08:00
2c7ca13775 New translations dcr-toml.mdx (Russian)
[ci skip]
2026-09-13 15:12:42 +08:00
8fd2dd00d2 New translations dcr-toml.mdx (Polish)
[ci skip]
2026-09-13 15:12:39 +08:00
8c3fbf4d80 New translations dcr-toml.mdx (German)
[ci skip]
2026-09-13 15:12:36 +08:00
cd566872db New translations dependencies.mdx (Ukrainian)
[ci skip]
2026-09-13 15:12:33 +08:00
864cd0565e New translations dependency-commands.mdx (Ukrainian)
[ci skip]
2026-09-13 15:12:30 +08:00
706131ea57 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-09-13 15:12:28 +08:00
0b461ac906 New translations dependencies.mdx (Russian)
[ci skip]
2026-09-13 15:12:24 +08:00
2a777d1124 New translations dependency-commands.mdx (Russian)
[ci skip]
2026-09-13 15:12:22 +08:00
3200d7f719 New translations changelog.mdx (Russian)
[ci skip]
2026-09-13 15:12:19 +08:00
543099e934 New translations dependencies.mdx (Polish)
[ci skip]
2026-09-13 15:12:16 +08:00
07e8776bf8 New translations dependency-commands.mdx (Polish)
[ci skip]
2026-09-13 15:12:13 +08:00
e516f17704 New translations changelog.mdx (Polish)
[ci skip]
2026-09-13 15:12:10 +08:00
2bc37d5960 New translations dependencies.mdx (German)
[ci skip]
2026-09-13 15:12:07 +08:00
ddd06b4b06 New translations dependency-commands.mdx (German)
[ci skip]
2026-09-13 15:12:05 +08:00
46356739e9 New translations changelog.mdx (German)
[ci skip]
2026-09-13 15:12:02 +08:00
80c87539f5 New translations dependencies.mdx (Ukrainian)
[ci skip]
2026-08-31 15:09:11 +08:00
dee16616e4 New translations dependency-commands.mdx (Ukrainian)
[ci skip]
2026-08-31 15:09:08 +08:00
9181276bde New translations changelog.mdx (Ukrainian)
[ci skip]
2026-08-31 15:09:06 +08:00
0ca083a6c0 New translations dependencies.mdx (Russian)
[ci skip]
2026-08-31 15:09:02 +08:00
95fe4eab02 New translations dependency-commands.mdx (Russian)
[ci skip]
2026-08-31 15:08:59 +08:00
bf0d38e2e9 New translations changelog.mdx (Russian)
[ci skip]
2026-08-31 15:08:56 +08:00
3ffe6eeca9 New translations dependencies.mdx (Polish)
[ci skip]
2026-08-31 15:08:53 +08:00
51439a79a0 New translations dependency-commands.mdx (Polish)
[ci skip]
2026-08-31 15:08:50 +08:00
0820574db6 New translations changelog.mdx (Polish)
[ci skip]
2026-08-31 15:08:48 +08:00
2857bfa058 New translations dependencies.mdx (German)
[ci skip]
2026-08-31 15:08:44 +08:00
790c4933fa New translations dependency-commands.mdx (German)
[ci skip]
2026-08-31 15:08:42 +08:00
396412048f New translations changelog.mdx (German)
[ci skip]
2026-08-31 15:08:39 +08:00
01f76fe052 New translations environment-variables.mdx (Ukrainian)
[ci skip]
2026-08-13 13:07:10 +08:00
bee6a4a2e8 New translations installation.mdx (Ukrainian)
[ci skip]
2026-08-13 13:07:07 +08:00
ac5e2d9785 New translations faq.mdx (Ukrainian)
[ci skip]
2026-08-13 13:07:05 +08:00
ac6fa37097 New translations contributing.mdx (Ukrainian)
[ci skip]
2026-08-13 13:07:02 +08:00
a1118ca7da New translations readme.mdx (Ukrainian)
[ci skip]
2026-08-13 13:07:00 +08:00
57a1247871 New translations environment-variables.mdx (Russian)
[ci skip]
2026-08-13 13:06:57 +08:00
f7ccafaa35 New translations installation.mdx (Russian)
[ci skip]
2026-08-13 13:06:54 +08:00
a629fb43b8 New translations faq.mdx (Russian)
[ci skip]
2026-08-13 13:06:52 +08:00
19a4f20bb2 New translations contributing.mdx (Russian)
[ci skip]
2026-08-13 13:06:49 +08:00
19eada9e9f New translations readme.mdx (Russian)
[ci skip]
2026-08-13 13:06:47 +08:00
369db6a14c New translations environment-variables.mdx (Polish)
[ci skip]
2026-08-13 13:06:44 +08:00
cd38d36eb9 New translations installation.mdx (Polish)
[ci skip]
2026-08-13 13:06:42 +08:00
68b779fa94 New translations faq.mdx (Polish)
[ci skip]
2026-08-13 13:06:39 +08:00
7760a7ba76 New translations contributing.mdx (Polish)
[ci skip]
2026-08-13 13:06:37 +08:00
1827f312c0 New translations readme.mdx (Polish)
[ci skip]
2026-08-13 13:06:34 +08:00
abd78ad7c8 New translations environment-variables.mdx (German)
[ci skip]
2026-08-13 13:06:31 +08:00
18952378e4 New translations installation.mdx (German)
[ci skip]
2026-08-13 13:06:29 +08:00
b9b457ebad New translations faq.mdx (German)
[ci skip]
2026-08-13 13:06:26 +08:00
e80fd0b62c New translations contributing.mdx (German)
[ci skip]
2026-08-13 13:06:24 +08:00
e2b9f1ffa7 New translations readme.mdx (German)
[ci skip]
2026-08-13 13:06:21 +08:00
1c43af2234 New translations changelog.mdx (Ukrainian)
[ci skip]
2026-08-13 13:06:19 +08:00
715ecba2bb New translations changelog.mdx (Russian)
[ci skip]
2026-08-13 13:06:16 +08:00
c3b769c0ae New translations changelog.mdx (Polish)
[ci skip]
2026-08-13 13:06:13 +08:00
cc01cf4c2f New translations changelog.mdx (German)
[ci skip]
2026-08-13 13:06:10 +08:00
06462adf69 New translations ide-integration.mdx (Ukrainian)
[ci skip]
2026-08-12 18:02:47 +08:00
77327244ee New translations ide-integration.mdx (Russian)
[ci skip]
2026-08-12 18:02:44 +08:00
16a1a01dc5 New translations ide-integration.mdx (Polish)
[ci skip]
2026-08-12 18:02:41 +08:00
828649caa7 New translations ide-integration.mdx (German)
[ci skip]
2026-08-12 18:02:39 +08:00
59a7cb6b8c New translations dcr-toml.mdx (Ukrainian)
[ci skip]
2026-08-08 15:03:14 +08:00
e90eda5fa8 New translations dcr-toml.mdx (Russian)
[ci skip]
2026-08-08 15:03:11 +08:00
820114d7d8 New translations dcr-toml.mdx (Polish)
[ci skip]
2026-08-08 15:03:08 +08:00
46c7607b62 New translations dcr-toml.mdx (German)
[ci skip]
2026-08-08 15:03:06 +08:00
ffcc245cec New translations changelog.mdx (Ukrainian)
[ci skip]
2026-08-08 15:03:03 +08:00
f0a0da18b0 New translations changelog.mdx (Russian)
[ci skip]
2026-08-08 15:02:59 +08:00
7a64c2e944 New translations changelog.mdx (Polish)
[ci skip]
2026-08-08 15:02:56 +08:00
098724a1ea New translations changelog.mdx (German)
[ci skip]
2026-08-08 15:02:53 +08:00
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
44 changed files with 1561 additions and 259 deletions

View File

@@ -8,8 +8,11 @@ sidebar_label: Introduction
<summary>Quick reference</summary> <summary>Quick reference</summary>
```bash ```bash
# Installation # Installation (dcrup)
curl -fsSL https://dcr.dexoron.su/install.sh | 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 / GitHub / SourceForge / Yandex
# Create a project # Create a project
dcr new my-app dcr new my-app

View File

@@ -4,6 +4,111 @@ sidebar_label: Changelog
# Changelog # Changelog
## 0.9.5 (2026-10-21)
* **Structured CLI output** — shared helpers now provide Cargo-like human, plain, and JSON output modes.
* **Color and diagnostics policy** — `--color`, `NO_COLOR`, `--quiet`, and `--verbose` are applied consistently across commands.
* **Build reporting** — lifecycle events and compiler diagnostics are available as structured JSON events.
* **Output lab** — sandbox scenarios cover help, lifecycle commands, compiler warnings/errors, stream capture, and broken pipes.
## 0.9.1 (2026-09-13)
* **`pkg-config` dependencies** — declare `fmt = { pkg-config = "fmt" }` or multiple package names in `[dependencies]`; DCR applies `.pc` compiler/linker flags and records the resolved package in `dcr.lock`.
* **`dcr add` support for `pkg-config`** — easily add system package dependencies with `dcr add fmt pkg-config:fmt` or `dcr add openssl pkg:openssl,libcrypto`.
* **`dcr tree` & IDE integration** — `pkg-config` packages are marked in `dcr tree` and resolved into compiler flags in `dcr gen` (`compile_commands.json`).
* **Fixed `dcr new` in non-ASCII / spaced paths** — initializing projects from folders with non-ASCII characters or spaces no longer fails validation.
## 0.9.0 (2026-08-31)
* **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 record the exact commit in `dcr.lock`.
* **Build and prebuild modes** — `path` and `git` dependencies can build a DCR package from `dcr.toml` or link existing `include`/`lib`/`libs` artifacts; `mode = "build"` / `"prebuild"` selects explicitly when both forms are present.
* **Prebuilt dependency examples** — documentation now shows the `dcr-math-lib` Git repository and recommended build/prebuilt layouts for both `git` and `path`.
* **Transitive dependency builds and cycle reporting** — DCR recursively builds DCR packages and reports a clear dependency chain for cycles.
* **Bare path arguments for `dcr add`** — `dcr add mylib ../mylib` now works in addition to the explicit `path:` form.
* **Removed `install.sh` / `install.ps1` / `install_bsd.sh`** — superseded by `dcrup`.
## 0.8.5 (2026-08-08)
* **`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)
**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) ## 0.8.1 (2026-07-20)
### Added ### Added
@@ -14,7 +119,7 @@ sidebar_label: Changelog
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin` * **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin` * **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit * Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — after a successful build, pack a FAT disk image (`fatfs`): `output`, `format` (`fat12`/`fat16`/`fat32`), optional `size` (default 1.44 MiB), `offset`, `label`, `bootsector`, and `layout` (`from` → `to`, supports globs). `{profile}` works in paths. * **`[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. * **Single-file `build.roots`** — a root may be a single source or header file, not only a directory.
### Changed ### Changed
@@ -22,10 +127,6 @@ sidebar_label: Changelog
* **`--force`** also re-runs `build.steps` and `build.post_steps`. * **`--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. * **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
### Dependencies
* `fatfs = "0.3"` for FAT image packing.
## 0.8.0 (2026-07-18) ## 0.8.0 (2026-07-18)
### Added ### Added

View File

@@ -15,6 +15,8 @@ dcr add mylib path:./lib # explicit path prefix
dcr add mylib git:https://github.com/user/repo # explicit git prefix dcr add mylib git:https://github.com/user/repo # explicit git prefix
dcr add mylib github:user/repo # GitHub shorthand dcr add mylib github:user/repo # GitHub shorthand
dcr add mylib gitlab:user/repo # GitLab shorthand dcr add mylib gitlab:user/repo # GitLab shorthand
dcr add fmt pkg-config:fmt # system package via pkg-config
dcr add openssl pkg:openssl,libcrypto # multiple pkg-config packages
``` ```
Source prefixes: Source prefixes:
@@ -23,6 +25,7 @@ Source prefixes:
* `git:` — generic git URL * `git:` — generic git URL
* `github:` — expands to `https://github.com/\<user>/\<repo>` * `github:` — expands to `https://github.com/\<user>/\<repo>`
* `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>` * `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>`
* `pkg-config:` / `pkg:` — one or more packages resolved by `pkg-config`
* `http://` / `https://` / `git@` — full URL * `http://` / `https://` / `git@` — full URL
Flags: Flags:
@@ -31,7 +34,12 @@ Flags:
* `--tag \<name>` — git tag * `--tag \<name>` — git tag
* `--rev \<hash>` — git commit * `--rev \<hash>` — git commit
If source is omitted — DCR searches connected registries. If source is omitted — DCR searches connected registries. A bare relative or absolute path is accepted as a path dependency.
For `pkg-config` dependencies, the referenced packages must already be installed
and provide `.pc` files. DCR invokes `pkg-config` during the build (using
`PATH` and `PKG_CONFIG_PATH`) and forwards the returned compiler and linker
flags; it does not download or build these packages.
## `dcr tree` ## `dcr tree`

View File

@@ -8,6 +8,7 @@ sidebar_label: Contributing
```bash ```bash
git clone https://github.com/dexoron/dcr git clone https://github.com/dexoron/dcr
# or a source mirror: GitVerse / SourceCraft / SourceForge / GitLab (see README)
cd dcr cd dcr
cargo build cargo build
``` ```
@@ -42,10 +43,11 @@ cargo test --all-targets
## CI ## CI
CI runs: CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check` * `cargo fmt --check`
* `cargo clippy --all-targets -- -D warnings` * `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features` * `cargo check --all-targets --all-features`
* Build on Linux, macOS, Windows * Unit + integration tests on Linux, macOS, Windows
* Integration tests (compilation check) * Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -61,6 +61,15 @@ Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive). See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## How do I choose a download mirror?
`dcrup install` uses `--mirror auto` by default and tries **cf → gh → sf → ya**.
```bash
dcrup install stable --mirror cf
export DCRUP_MIRROR=ya
```
## Lock file ## 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`. `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

@@ -4,28 +4,75 @@ sidebar_label: Installation
# Installation # Installation
## Linux (Dexoron Packages) ## dcrup (recommended)
Configure your package manager at https://pkg.dexoron.su and install: Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
**Arch Linux** ### Linux / macOS / BSD / Windows (bash)
```sh ```sh
sudo pacman -Sy dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
``` ```
**Debian/Ubuntu** Non-interactive install of DCR in one shot:
```sh ```sh
sudo apt update && sudo apt install dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
``` ```
**Fedora/RHEL** ### Windows (PowerShell)
```powershell
& ([scriptblock]::Create((irm https://ps1.dcr-tool.ru))) self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`) and is installed in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows).
### Common dcrup commands
```sh ```sh
sudo dnf install dcr dcrup install stable # latest stable prebuilt (auto: cf → gh → sf → ya)
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 --mirror cf # CloudFlare CDN
dcrup install stable --mirror ya # Yandex CDN (RU fallback)
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
dcrup uninstall 0.8.2 # remove one installed version
dcrup uninstall --all # remove all installed versions
``` ```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
### Download mirrors
Prebuilt installs try **cf → gh → sf → ya** unless you pin a host.
| Code | URL | Notes |
| ---- | ------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `cf` | `https://cdn-global.dcr-tool.ru/\<tag>/\<asset>` | CloudFlare CDN (worldwide) |
| `gh` | `https://github.com/dexoron/dcr/releases/download/\<tag>/\<asset>` | GitHub Releases |
| `sf` | `https://sourceforge.net/projects/dcr-tool/files/\<tag>/\<asset>/download` | SourceForge |
| `ya` | `https://cdn-ru.dcr-tool.ru/\<tag>/\<asset>` | Yandex CDN (RU fallback) |
```sh
dcrup install stable --mirror auto # default
export DCRUP_MIRROR=cf # persist for this shell
```
---
## Arch Linux (AUR) ## Arch Linux (AUR)
```sh ```sh
@@ -45,11 +92,12 @@ brew install dcr
sudo snap install dcrup 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) ## Nix (flake)
```sh ```sh
nix run github:dexoron/dcr nix run github:dexoron/dcr
# or install to profile:
nix profile install github:dexoron/dcr nix profile install github:dexoron/dcr
``` ```
@@ -59,48 +107,37 @@ nix profile install github:dexoron/dcr
cargo install dcr cargo install dcr
``` ```
## Linux / macOS (script) Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh ```sh
curl -fsSL https://dcr.dexoron.su/install.sh | sh cargo install dcr --features archive
```
## BSD (script)
```sh
curl -fsSL https://dcr.dexoron.su/install_bsd.sh | sh
```
## Windows (PowerShell)
```powershell
irm https://dcr.dexoron.su/install.ps1 | iex
``` ```
## From source ## From source
```sh ```sh
git clone https://github.com/dexoron/dcr.git git clone https://github.com/dexoron/dcr.git
cd dcr && cargo build --release cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
``` ```
## Post-install ## Post-install
Verify the installation:
```bash ```bash
dcr --version dcr --version
dcrup show # if installed via dcrup
``` ```
Man pages are available after installation: Man pages (package installs / release assets):
```bash ```bash
man dcr man dcr
man dcr-build man dcr-build
``` ```
To use the registry, create `~/.dcr/config.toml`: Registry (optional) — `~/.dcr/config.toml`:
```toml ```toml
[registry.default] [registry.default]

View File

@@ -6,6 +6,13 @@ sidebar_label: IDE Integration
## VS Code ## VS Code
Install the recommended [DCR extension by Dexoron-Labs](https://marketplace.visualstudio.com/items?itemName=Dexoron-Labs.dcr). Do not install Microsoft C/C++ extensions for DCR projects: DCR uses `clangd`. MS C/C++ is acceptable only when you need its debugger.
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
```bash ```bash
dcr gen vscode dcr gen vscode
``` ```

View File

@@ -0,0 +1,34 @@
---
sidebar_label: CLI output
---
# CLI output (experimental)
The structured output implementation is being developed incrementally.
Currently these global options apply to diagnostics emitted through the logger:
```sh
dcr --output plain build
dcr --output json build
dcr --color never build
dcr --quiet build
dcr --verbose build
```
`--output` accepts `human` (default), `plain`, or `json`.
Diagnostics are written to stderr. JSON diagnostics are newline-delimited objects
with `schema_version: 1`, `event`, and `message` fields. Command statuses use the
shared output helpers, build reporting emits structured lifecycle events, and
compiler output is represented as JSON events with its original stream and text.
The protocol is still experimental: some raw command data and subprocess stdout
remain unstructured.
`--color` accepts `auto`, `always`, or `never`. Automatic coloring requires a
terminal and respects `NO_COLOR`. Plain and JSON diagnostics never add colors.
Quiet mode preserves warnings, errors, and compiler diagnostics; verbose mode
enables debug and trace logging. Arguments following `--` are passed through
unchanged.
Remaining work includes migrating the remaining raw command data and subprocess
stdout, improving progress rendering and contextual errors, and expanding
integration coverage for stdout/stderr and closed pipes.

View File

@@ -41,9 +41,10 @@ Main project configuration file. Located at the project root.
## [package] ## [package]
| Field | Required | Description | | Field | Required | Description |
| --------- | -------- | ------------------------------------------- | | ------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| `name` | yes | Project name | | `name` | yes | Project name |
| `version` | yes | Semantic version | | `version` | yes | Semantic version of the **project** |
| `dcr-version` | no | Semver of the **dcr tool** this project targets. Written by `dcr new` / `dcr init` to the current tool version. |
| `type` | no | `app`, `lib`, `none` (defaults to `"none"`) | | `type` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `license` | no | SPDX license identifier | | `license` | no | SPDX license identifier |
| `author` | no | Author | | `author` | no | Author |
@@ -52,11 +53,26 @@ Main project configuration file. Located at the project root.
[package] [package]
name = "my-app" name = "my-app"
version = "0.1.0" version = "0.1.0"
dcr-version = "0.8.4"
type = "app" type = "app"
license = "MIT" license = "MIT"
author = "John Doe" author = "John Doe"
``` ```
### `package.dcr-version`
Optional pin of the DCR CLI the project was written for. On every `dcr.toml` load:
| Situation | Behaviour |
| ------------------------------ | ---------------------------------------------------------- |
| Field missing / empty | Warning: add `dcr-version` (set by `dcr new` / `dcr init`) |
| Running dcr **older** than pin | Warning: upgrade dcr (`dcr --update`) |
| Running dcr **newer** than pin | Warning: review changelog, bump the pin when ready |
| Equal | Silent |
| Invalid semver | Warning once, field ignored |
Never fails the command — warnings only. Pre-release suffixes (`1.0.0-dev`) are ignored for comparison (`1.0.0-dev` ≡ `1.0.0`).
## [build] ## [build]
... ...
@@ -96,7 +112,12 @@ author = "John Doe"
Settings from raw config (not in typed struct): Settings from raw config (not in typed struct):
* `pkg_config` — list of pkg-config packages * `pkg_config` — list of packages queried for build-wide compiler/linker flags
Dependencies can also declare a system package directly, for example
`fmt = { pkg-config = "fmt" }`. This records the package in `dcr.lock` and applies
the flags returned by `pkg-config --cflags` and `pkg-config --libs`.
* `ldscript` — linker script path * `ldscript` — linker script path
* `build.steps` / `build.post_steps` — codegen steps * `build.steps` / `build.post_steps` — codegen steps
@@ -185,6 +206,8 @@ See [workspaces](/docs/reference/workspaces).
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]`). 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 | | Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- | | ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) | | `output` | yes | Image path relative to project root (`{profile}` allowed) |

View File

@@ -6,7 +6,7 @@ sidebar_label: Dependencies
## Formats ## Formats
The `[dependencies]` section supports three formats: The `[dependencies]` section supports registry, path, Git, and `pkg-config` dependencies:
### String (registry) ### String (registry)
@@ -23,10 +23,10 @@ The version string is used as-is for registry lookup.
```toml ```toml
[dependencies] [dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" } dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0" }
``` ```
Fields: `git`, `branch`, `tag`, `rev`. Fields: `git`, `branch`, `tag`, `rev`, `mode`, `include`, `lib`, `libs`.
### Table (path) ### Table (path)
@@ -35,6 +35,32 @@ Fields: `git`, `branch`, `tag`, `rev`.
mylib = { path = "../mylib" } mylib = { path = "../mylib" }
``` ```
For a prebuilt external library, specify its layout explicitly. The three
arrays are paths relative to the dependency root (`include`, `lib`) and linker
names (`libs`):
```toml
[dependencies]
dcr-math = { path = "../deps/dcr-math", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
### Table (`pkg-config`)
Use an installed `.pc` package when the library is provided by the operating system
or another system package manager. DCR invokes `pkg-config --cflags` and
`pkg-config --libs`, preserving include, library, linker, and other flags:
```toml
[dependencies]
fmt = { pkg-config = "fmt" }
openssl = { pkg-config = ["openssl", "libcrypto"] }
```
The `pkg-config` executable must be available in `PATH`. The named `.pc` files must
be available through pkg-config's standard search paths or via `PKG_CONFIG_PATH`.
These dependencies are not downloaded or built by DCR; they are recorded in
`dcr.lock` with a `pkg-config+...` source.
## Registry ## Registry
DCR uses a package registry for dependency lookup by name. DCR uses a package registry for dependency lookup by name.
@@ -42,7 +68,7 @@ DCR uses a package registry for dependency lookup by name.
```toml ```toml
# ~/.dcr/config.toml # ~/.dcr/config.toml
[registry.default] [registry.default]
url = "https://index.dcr.pm" url = "https://index.dcr.dexoron.tech"
priority = 1 priority = 1
``` ```
@@ -50,7 +76,23 @@ Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrid
## Git dependencies ## Git dependencies
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources: Git dependencies are cloned into `~/.dcr/git/`; their exact checked-out commit is written to `dcr.lock`.
Both Git and path dependencies have two modes:
* **DCR package:** the source has `dcr.toml`. DCR builds it before the consumer and uses the package name from its manifest for linking.
* **Prebuilt library:** it provides existing headers and binaries through `include`, `lib`, and `libs`. DCR passes them to the compiler/linker without building the dependency.
The mode is normally detected automatically. Use `mode = "build"` or `mode = "prebuild"` when a source contains both a manifest and prebuilt artifacts and you need to choose explicitly.
`dcr-math-lib` publishes both forms. Select its prebuilt library explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
DCR supports specifying branch/tag/rev for git sources:
* `branch` — switch to a branch * `branch` — switch to a branch
* `tag` — switch to a tag * `tag` — switch to a tag
@@ -59,7 +101,7 @@ Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying
## Path dependencies ## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`. Local paths may point at a DCR package or a prebuilt external library. A path DCR package is built before its consumer, including its own path/git dependencies. DCR detects dependency cycles. A prebuilt library is never built by DCR; it is linked from the directories declared in its dependency entry.
```toml ```toml
[dependencies] [dependencies]
@@ -67,18 +109,51 @@ mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" } 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.* For DCR packages, the package name from `dcr.toml` is used for linking (so the dependency key may differ from the library name). Header resolution includes the packaged `target/include` directory and link search includes `target/lib`.
### Recommended library layouts
Buildable DCR library:
```text
dcr-math-lib/
├── dcr.toml
└── src/
├── dcr_math.c
└── dcr_math.h
```
Prebuilt library:
```text
dcr-math-lib/
├── include/
│ └── dcr_math.h
└── lib/
└── libdcr-math.a # or .so / .lib
```
`libs` contains linker names without the `lib` prefix and file extension: use
`["dcr-math"]` for `libdcr-math.a`.
If one repository contains both forms, keep the prebuilt files in `include/` and `lib/` and select the mode explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
For a local copy, replace `git` with `path = "../dcr-math-lib"`. In `prebuild` mode DCR does not run the dependency build, even when `dcr.toml` is present.
## dcr.lock ## dcr.lock
Dependency lock file. Contains package names and sources. 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`. Created during `dcr build` for resolved registry, path, and Git dependencies. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process ## Resolution process
1. Load all dependencies (registry → git → path) 1. Resolve dependency sources (registry → git → path)
2. For path deps: recursively read their `dcr.toml` 2. Fetch git dependencies into `~/.dcr/git/` and check out the requested ref
3. For registry deps: search `index.json` 3. Build DCR package dependencies recursively
4. For git deps: clone to cache 4. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -58,3 +58,27 @@ export DCR_INDEX_PATH=/custom/path/index.json
``` ```
Default: `~/.dcr/index.json`. Default: `~/.dcr/index.json`.
## DCRUP_MIRROR
Download mirror for `dcrup` (prebuilt binaries only).
```bash
export DCRUP_MIRROR=auto # cf → gh → sf → ya (default)
export DCRUP_MIRROR=cf # CloudFlare CDN
export DCRUP_MIRROR=gh # GitHub Releases
export DCRUP_MIRROR=sf # SourceForge
export DCRUP_MIRROR=ya # Yandex CDN (RU fallback)
```
CLI override: `dcrup install stable --mirror cf`.
## DCRUP_HOME / DCRUP_BIN / DCRUP_REPO
Installer layout and source clone URL:
```bash
export DCRUP_HOME=~/.dcr
export DCRUP_BIN=~/.dcr/bin
export DCRUP_REPO=https://github.com/dexoron/dcr
```

View File

@@ -8,8 +8,11 @@ sidebar_label: Introduction
<summary>Quick reference</summary> <summary>Quick reference</summary>
```bash ```bash
# Installation # Installation (dcrup)
curl -fsSL https://dcr.dexoron.su/install.sh | 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 / GitHub / SourceForge / Yandex
# Create a project # Create a project
dcr new my-app dcr new my-app

View File

@@ -4,6 +4,111 @@ sidebar_label: Changelog
# Changelog # Changelog
## 0.9.5 (2026-10-21)
* **Structured CLI output** — shared helpers now provide Cargo-like human, plain, and JSON output modes.
* **Color and diagnostics policy** — `--color`, `NO_COLOR`, `--quiet`, and `--verbose` are applied consistently across commands.
* **Build reporting** — lifecycle events and compiler diagnostics are available as structured JSON events.
* **Output lab** — sandbox scenarios cover help, lifecycle commands, compiler warnings/errors, stream capture, and broken pipes.
## 0.9.1 (2026-09-13)
* **`pkg-config` dependencies** — declare `fmt = { pkg-config = "fmt" }` or multiple package names in `[dependencies]`; DCR applies `.pc` compiler/linker flags and records the resolved package in `dcr.lock`.
* **`dcr add` support for `pkg-config`** — easily add system package dependencies with `dcr add fmt pkg-config:fmt` or `dcr add openssl pkg:openssl,libcrypto`.
* **`dcr tree` & IDE integration** — `pkg-config` packages are marked in `dcr tree` and resolved into compiler flags in `dcr gen` (`compile_commands.json`).
* **Fixed `dcr new` in non-ASCII / spaced paths** — initializing projects from folders with non-ASCII characters or spaces no longer fails validation.
## 0.9.0 (2026-08-31)
* **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 record the exact commit in `dcr.lock`.
* **Build and prebuild modes** — `path` and `git` dependencies can build a DCR package from `dcr.toml` or link existing `include`/`lib`/`libs` artifacts; `mode = "build"` / `"prebuild"` selects explicitly when both forms are present.
* **Prebuilt dependency examples** — documentation now shows the `dcr-math-lib` Git repository and recommended build/prebuilt layouts for both `git` and `path`.
* **Transitive dependency builds and cycle reporting** — DCR recursively builds DCR packages and reports a clear dependency chain for cycles.
* **Bare path arguments for `dcr add`** — `dcr add mylib ../mylib` now works in addition to the explicit `path:` form.
* **Removed `install.sh` / `install.ps1` / `install_bsd.sh`** — superseded by `dcrup`.
## 0.8.5 (2026-08-08)
* **`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)
**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) ## 0.8.1 (2026-07-20)
### Added ### Added
@@ -14,7 +119,7 @@ sidebar_label: Changelog
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin` * **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin` * **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit * Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — after a successful build, pack a FAT disk image (`fatfs`): `output`, `format` (`fat12`/`fat16`/`fat32`), optional `size` (default 1.44 MiB), `offset`, `label`, `bootsector`, and `layout` (`from` → `to`, supports globs). `{profile}` works in paths. * **`[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. * **Single-file `build.roots`** — a root may be a single source or header file, not only a directory.
### Changed ### Changed
@@ -22,10 +127,6 @@ sidebar_label: Changelog
* **`--force`** also re-runs `build.steps` and `build.post_steps`. * **`--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. * **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
### Dependencies
* `fatfs = "0.3"` for FAT image packing.
## 0.8.0 (2026-07-18) ## 0.8.0 (2026-07-18)
### Added ### Added

View File

@@ -15,6 +15,8 @@ dcr add mylib path:./lib # explicit path prefix
dcr add mylib git:https://github.com/user/repo # explicit git prefix dcr add mylib git:https://github.com/user/repo # explicit git prefix
dcr add mylib github:user/repo # GitHub shorthand dcr add mylib github:user/repo # GitHub shorthand
dcr add mylib gitlab:user/repo # GitLab shorthand dcr add mylib gitlab:user/repo # GitLab shorthand
dcr add fmt pkg-config:fmt # system package via pkg-config
dcr add openssl pkg:openssl,libcrypto # multiple pkg-config packages
``` ```
Source prefixes: Source prefixes:
@@ -23,6 +25,7 @@ Source prefixes:
* `git:` — generic git URL * `git:` — generic git URL
* `github:` — expands to `https://github.com/\<user>/\<repo>` * `github:` — expands to `https://github.com/\<user>/\<repo>`
* `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>` * `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>`
* `pkg-config:` / `pkg:` — one or more packages resolved by `pkg-config`
* `http://` / `https://` / `git@` — full URL * `http://` / `https://` / `git@` — full URL
Flags: Flags:
@@ -31,7 +34,12 @@ Flags:
* `--tag \<name>` — git tag * `--tag \<name>` — git tag
* `--rev \<hash>` — git commit * `--rev \<hash>` — git commit
If source is omitted — DCR searches connected registries. If source is omitted — DCR searches connected registries. A bare relative or absolute path is accepted as a path dependency.
For `pkg-config` dependencies, the referenced packages must already be installed
and provide `.pc` files. DCR invokes `pkg-config` during the build (using
`PATH` and `PKG_CONFIG_PATH`) and forwards the returned compiler and linker
flags; it does not download or build these packages.
## `dcr tree` ## `dcr tree`

View File

@@ -8,6 +8,7 @@ sidebar_label: Contributing
```bash ```bash
git clone https://github.com/dexoron/dcr git clone https://github.com/dexoron/dcr
# or a source mirror: GitVerse / SourceCraft / SourceForge / GitLab (see README)
cd dcr cd dcr
cargo build cargo build
``` ```
@@ -42,10 +43,11 @@ cargo test --all-targets
## CI ## CI
CI runs: CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check` * `cargo fmt --check`
* `cargo clippy --all-targets -- -D warnings` * `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features` * `cargo check --all-targets --all-features`
* Build on Linux, macOS, Windows * Unit + integration tests on Linux, macOS, Windows
* Integration tests (compilation check) * Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -61,6 +61,15 @@ Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive). See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## How do I choose a download mirror?
`dcrup install` uses `--mirror auto` by default and tries **cf → gh → sf → ya**.
```bash
dcrup install stable --mirror cf
export DCRUP_MIRROR=ya
```
## Lock file ## 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`. `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

@@ -4,28 +4,75 @@ sidebar_label: Installation
# Installation # Installation
## Linux (Dexoron Packages) ## dcrup (recommended)
Configure your package manager at https://pkg.dexoron.su and install: Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
**Arch Linux** ### Linux / macOS / BSD / Windows (bash)
```sh ```sh
sudo pacman -Sy dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
``` ```
**Debian/Ubuntu** Non-interactive install of DCR in one shot:
```sh ```sh
sudo apt update && sudo apt install dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
``` ```
**Fedora/RHEL** ### Windows (PowerShell)
```powershell
& ([scriptblock]::Create((irm https://ps1.dcr-tool.ru))) self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`) and is installed in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows).
### Common dcrup commands
```sh ```sh
sudo dnf install dcr dcrup install stable # latest stable prebuilt (auto: cf → gh → sf → ya)
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 --mirror cf # CloudFlare CDN
dcrup install stable --mirror ya # Yandex CDN (RU fallback)
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
dcrup uninstall 0.8.2 # remove one installed version
dcrup uninstall --all # remove all installed versions
``` ```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
### Download mirrors
Prebuilt installs try **cf → gh → sf → ya** unless you pin a host.
| Code | URL | Notes |
| ---- | ------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `cf` | `https://cdn-global.dcr-tool.ru/\<tag>/\<asset>` | CloudFlare CDN (worldwide) |
| `gh` | `https://github.com/dexoron/dcr/releases/download/\<tag>/\<asset>` | GitHub Releases |
| `sf` | `https://sourceforge.net/projects/dcr-tool/files/\<tag>/\<asset>/download` | SourceForge |
| `ya` | `https://cdn-ru.dcr-tool.ru/\<tag>/\<asset>` | Yandex CDN (RU fallback) |
```sh
dcrup install stable --mirror auto # default
export DCRUP_MIRROR=cf # persist for this shell
```
---
## Arch Linux (AUR) ## Arch Linux (AUR)
```sh ```sh
@@ -45,11 +92,12 @@ brew install dcr
sudo snap install dcrup 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) ## Nix (flake)
```sh ```sh
nix run github:dexoron/dcr nix run github:dexoron/dcr
# or install to profile:
nix profile install github:dexoron/dcr nix profile install github:dexoron/dcr
``` ```
@@ -59,48 +107,37 @@ nix profile install github:dexoron/dcr
cargo install dcr cargo install dcr
``` ```
## Linux / macOS (script) Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh ```sh
curl -fsSL https://dcr.dexoron.su/install.sh | sh cargo install dcr --features archive
```
## BSD (script)
```sh
curl -fsSL https://dcr.dexoron.su/install_bsd.sh | sh
```
## Windows (PowerShell)
```powershell
irm https://dcr.dexoron.su/install.ps1 | iex
``` ```
## From source ## From source
```sh ```sh
git clone https://github.com/dexoron/dcr.git git clone https://github.com/dexoron/dcr.git
cd dcr && cargo build --release cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
``` ```
## Post-install ## Post-install
Verify the installation:
```bash ```bash
dcr --version dcr --version
dcrup show # if installed via dcrup
``` ```
Man pages are available after installation: Man pages (package installs / release assets):
```bash ```bash
man dcr man dcr
man dcr-build man dcr-build
``` ```
To use the registry, create `~/.dcr/config.toml`: Registry (optional) — `~/.dcr/config.toml`:
```toml ```toml
[registry.default] [registry.default]

View File

@@ -6,6 +6,13 @@ sidebar_label: IDE Integration
## VS Code ## VS Code
Install the recommended [DCR extension by Dexoron-Labs](https://marketplace.visualstudio.com/items?itemName=Dexoron-Labs.dcr). Do not install Microsoft C/C++ extensions for DCR projects: DCR uses `clangd`. MS C/C++ is acceptable only when you need its debugger.
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
```bash ```bash
dcr gen vscode dcr gen vscode
``` ```

View File

@@ -0,0 +1,34 @@
---
sidebar_label: CLI output
---
# CLI output (experimental)
The structured output implementation is being developed incrementally.
Currently these global options apply to diagnostics emitted through the logger:
```sh
dcr --output plain build
dcr --output json build
dcr --color never build
dcr --quiet build
dcr --verbose build
```
`--output` accepts `human` (default), `plain`, or `json`.
Diagnostics are written to stderr. JSON diagnostics are newline-delimited objects
with `schema_version: 1`, `event`, and `message` fields. Command statuses use the
shared output helpers, build reporting emits structured lifecycle events, and
compiler output is represented as JSON events with its original stream and text.
The protocol is still experimental: some raw command data and subprocess stdout
remain unstructured.
`--color` accepts `auto`, `always`, or `never`. Automatic coloring requires a
terminal and respects `NO_COLOR`. Plain and JSON diagnostics never add colors.
Quiet mode preserves warnings, errors, and compiler diagnostics; verbose mode
enables debug and trace logging. Arguments following `--` are passed through
unchanged.
Remaining work includes migrating the remaining raw command data and subprocess
stdout, improving progress rendering and contextual errors, and expanding
integration coverage for stdout/stderr and closed pipes.

View File

@@ -41,9 +41,10 @@ Main project configuration file. Located at the project root.
## [package] ## [package]
| Field | Required | Description | | Field | Required | Description |
| --------- | -------- | ------------------------------------------- | | ------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| `name` | yes | Project name | | `name` | yes | Project name |
| `version` | yes | Semantic version | | `version` | yes | Semantic version of the **project** |
| `dcr-version` | no | Semver of the **dcr tool** this project targets. Written by `dcr new` / `dcr init` to the current tool version. |
| `type` | no | `app`, `lib`, `none` (defaults to `"none"`) | | `type` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `license` | no | SPDX license identifier | | `license` | no | SPDX license identifier |
| `author` | no | Author | | `author` | no | Author |
@@ -52,11 +53,26 @@ Main project configuration file. Located at the project root.
[package] [package]
name = "my-app" name = "my-app"
version = "0.1.0" version = "0.1.0"
dcr-version = "0.8.4"
type = "app" type = "app"
license = "MIT" license = "MIT"
author = "John Doe" author = "John Doe"
``` ```
### `package.dcr-version`
Optional pin of the DCR CLI the project was written for. On every `dcr.toml` load:
| Situation | Behaviour |
| ------------------------------ | ---------------------------------------------------------- |
| Field missing / empty | Warning: add `dcr-version` (set by `dcr new` / `dcr init`) |
| Running dcr **older** than pin | Warning: upgrade dcr (`dcr --update`) |
| Running dcr **newer** than pin | Warning: review changelog, bump the pin when ready |
| Equal | Silent |
| Invalid semver | Warning once, field ignored |
Never fails the command — warnings only. Pre-release suffixes (`1.0.0-dev`) are ignored for comparison (`1.0.0-dev` ≡ `1.0.0`).
## [build] ## [build]
... ...
@@ -96,7 +112,12 @@ author = "John Doe"
Settings from raw config (not in typed struct): Settings from raw config (not in typed struct):
* `pkg_config` — list of pkg-config packages * `pkg_config` — list of packages queried for build-wide compiler/linker flags
Dependencies can also declare a system package directly, for example
`fmt = { pkg-config = "fmt" }`. This records the package in `dcr.lock` and applies
the flags returned by `pkg-config --cflags` and `pkg-config --libs`.
* `ldscript` — linker script path * `ldscript` — linker script path
* `build.steps` / `build.post_steps` — codegen steps * `build.steps` / `build.post_steps` — codegen steps
@@ -185,6 +206,8 @@ See [workspaces](/docs/reference/workspaces).
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]`). 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 | | Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- | | ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) | | `output` | yes | Image path relative to project root (`{profile}` allowed) |

View File

@@ -6,7 +6,7 @@ sidebar_label: Dependencies
## Formats ## Formats
The `[dependencies]` section supports three formats: The `[dependencies]` section supports registry, path, Git, and `pkg-config` dependencies:
### String (registry) ### String (registry)
@@ -23,10 +23,10 @@ The version string is used as-is for registry lookup.
```toml ```toml
[dependencies] [dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" } dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0" }
``` ```
Fields: `git`, `branch`, `tag`, `rev`. Fields: `git`, `branch`, `tag`, `rev`, `mode`, `include`, `lib`, `libs`.
### Table (path) ### Table (path)
@@ -35,6 +35,32 @@ Fields: `git`, `branch`, `tag`, `rev`.
mylib = { path = "../mylib" } mylib = { path = "../mylib" }
``` ```
For a prebuilt external library, specify its layout explicitly. The three
arrays are paths relative to the dependency root (`include`, `lib`) and linker
names (`libs`):
```toml
[dependencies]
dcr-math = { path = "../deps/dcr-math", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
### Table (`pkg-config`)
Use an installed `.pc` package when the library is provided by the operating system
or another system package manager. DCR invokes `pkg-config --cflags` and
`pkg-config --libs`, preserving include, library, linker, and other flags:
```toml
[dependencies]
fmt = { pkg-config = "fmt" }
openssl = { pkg-config = ["openssl", "libcrypto"] }
```
The `pkg-config` executable must be available in `PATH`. The named `.pc` files must
be available through pkg-config's standard search paths or via `PKG_CONFIG_PATH`.
These dependencies are not downloaded or built by DCR; they are recorded in
`dcr.lock` with a `pkg-config+...` source.
## Registry ## Registry
DCR uses a package registry for dependency lookup by name. DCR uses a package registry for dependency lookup by name.
@@ -42,7 +68,7 @@ DCR uses a package registry for dependency lookup by name.
```toml ```toml
# ~/.dcr/config.toml # ~/.dcr/config.toml
[registry.default] [registry.default]
url = "https://index.dcr.pm" url = "https://index.dcr.dexoron.tech"
priority = 1 priority = 1
``` ```
@@ -50,7 +76,23 @@ Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrid
## Git dependencies ## Git dependencies
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources: Git dependencies are cloned into `~/.dcr/git/`; their exact checked-out commit is written to `dcr.lock`.
Both Git and path dependencies have two modes:
* **DCR package:** the source has `dcr.toml`. DCR builds it before the consumer and uses the package name from its manifest for linking.
* **Prebuilt library:** it provides existing headers and binaries through `include`, `lib`, and `libs`. DCR passes them to the compiler/linker without building the dependency.
The mode is normally detected automatically. Use `mode = "build"` or `mode = "prebuild"` when a source contains both a manifest and prebuilt artifacts and you need to choose explicitly.
`dcr-math-lib` publishes both forms. Select its prebuilt library explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
DCR supports specifying branch/tag/rev for git sources:
* `branch` — switch to a branch * `branch` — switch to a branch
* `tag` — switch to a tag * `tag` — switch to a tag
@@ -59,7 +101,7 @@ Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying
## Path dependencies ## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`. Local paths may point at a DCR package or a prebuilt external library. A path DCR package is built before its consumer, including its own path/git dependencies. DCR detects dependency cycles. A prebuilt library is never built by DCR; it is linked from the directories declared in its dependency entry.
```toml ```toml
[dependencies] [dependencies]
@@ -67,18 +109,51 @@ mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" } 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.* For DCR packages, the package name from `dcr.toml` is used for linking (so the dependency key may differ from the library name). Header resolution includes the packaged `target/include` directory and link search includes `target/lib`.
### Recommended library layouts
Buildable DCR library:
```text
dcr-math-lib/
├── dcr.toml
└── src/
├── dcr_math.c
└── dcr_math.h
```
Prebuilt library:
```text
dcr-math-lib/
├── include/
│ └── dcr_math.h
└── lib/
└── libdcr-math.a # or .so / .lib
```
`libs` contains linker names without the `lib` prefix and file extension: use
`["dcr-math"]` for `libdcr-math.a`.
If one repository contains both forms, keep the prebuilt files in `include/` and `lib/` and select the mode explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
For a local copy, replace `git` with `path = "../dcr-math-lib"`. In `prebuild` mode DCR does not run the dependency build, even when `dcr.toml` is present.
## dcr.lock ## dcr.lock
Dependency lock file. Contains package names and sources. 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`. Created during `dcr build` for resolved registry, path, and Git dependencies. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process ## Resolution process
1. Load all dependencies (registry → git → path) 1. Resolve dependency sources (registry → git → path)
2. For path deps: recursively read their `dcr.toml` 2. Fetch git dependencies into `~/.dcr/git/` and check out the requested ref
3. For registry deps: search `index.json` 3. Build DCR package dependencies recursively
4. For git deps: clone to cache 4. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -58,3 +58,27 @@ export DCR_INDEX_PATH=/custom/path/index.json
``` ```
Default: `~/.dcr/index.json`. Default: `~/.dcr/index.json`.
## DCRUP_MIRROR
Download mirror for `dcrup` (prebuilt binaries only).
```bash
export DCRUP_MIRROR=auto # cf → gh → sf → ya (default)
export DCRUP_MIRROR=cf # CloudFlare CDN
export DCRUP_MIRROR=gh # GitHub Releases
export DCRUP_MIRROR=sf # SourceForge
export DCRUP_MIRROR=ya # Yandex CDN (RU fallback)
```
CLI override: `dcrup install stable --mirror cf`.
## DCRUP_HOME / DCRUP_BIN / DCRUP_REPO
Installer layout and source clone URL:
```bash
export DCRUP_HOME=~/.dcr
export DCRUP_BIN=~/.dcr/bin
export DCRUP_REPO=https://github.com/dexoron/dcr
```

View File

@@ -8,15 +8,28 @@ sidebar_label: Введение
<summary>Быстрая справка</summary> <summary>Быстрая справка</summary>
```bash ```bash
# Установка(Linux/MacOS скрипт) # Installation (dcrup)
curl -fsSL https://dcr.dexoron.su/install.sh | 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 / GitHub / SourceForge / Yandex
# Создать проект # Create a project
dcr new my-app dcr new my-app
cd my-app cd my-app
# Собрать и запустить # Build and run
dcr build
dcr run dcr run
# Run tests
dcr test
# Add a dependency
dcr add fmt
# Generate IDE files
dcr gen vscode
``` ```
</details> </details>

View File

@@ -4,31 +4,132 @@ sidebar_label: Список изменений
# Список изменений # Список изменений
## 0.8.1 (2026-07-20) ## 0.9.5 (2026-10-21)
* **Structured CLI output** — shared helpers now provide Cargo-like human, plain, and JSON output modes.
* **Color and diagnostics policy** — `--color`, `NO_COLOR`, `--quiet`, and `--verbose` are applied consistently across commands.
* **Build reporting** — lifecycle events and compiler diagnostics are available as structured JSON events.
* **Output lab** — sandbox scenarios cover help, lifecycle commands, compiler warnings/errors, stream capture, and broken pipes.
## 0.9.1 (2026-09-13)
* **`pkg-config` dependencies** — declare `fmt = { pkg-config = "fmt" }` or multiple package names in `[dependencies]`; DCR applies `.pc` compiler/linker flags and records the resolved package in `dcr.lock`.
* **`dcr add` support for `pkg-config`** — easily add system package dependencies with `dcr add fmt pkg-config:fmt` or `dcr add openssl pkg:openssl,libcrypto`.
* **`dcr tree` & IDE integration** — `pkg-config` packages are marked in `dcr tree` and resolved into compiler flags in `dcr gen` (`compile_commands.json`).
* **Fixed `dcr new` in non-ASCII / spaced paths** — initializing projects from folders with non-ASCII characters or spaces no longer fails validation.
## 0.9.0 (2026-08-31)
* **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 record the exact commit in `dcr.lock`.
* **Build and prebuild modes** — `path` and `git` dependencies can build a DCR package from `dcr.toml` or link existing `include`/`lib`/`libs` artifacts; `mode = "build"` / `"prebuild"` selects explicitly when both forms are present.
* **Prebuilt dependency examples** — documentation now shows the `dcr-math-lib` Git repository and recommended build/prebuilt layouts for both `git` and `path`.
* **Transitive dependency builds and cycle reporting** — DCR recursively builds DCR packages and reports a clear dependency chain for cycles.
* **Bare path arguments for `dcr add`** — `dcr add mylib ../mylib` now works in addition to the explicit `path:` form.
* **Removed `install.sh` / `install.ps1` / `install_bsd.sh`** — superseded by `dcrup`.
## 0.8.5 (2026-08-08)
* **`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)
**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: * **`build.kind = "flat-bin"`** — raw binary (default `.bin`) for OS-dev payloads:
* **NASM** — `-f bin` → `\<stem>.bin` * **NASM** — `-f bin` → `\<stem>.bin`
* **FASM** — direct output (`format binary` in source) * **FASM** — direct output (`format binary` in source)
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin` * **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin` * **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit * Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — after a successful build, pack a FAT disk image (`fatfs`): `output`, `format` (`fat12`/`fat16`/`fat32`), optional `size` (default 1.44 MiB), `offset`, `label`, `bootsector`, and `layout` (`from` → `to`, supports globs). `{profile}` works in paths. * **`[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. * **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`. * **`--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. * **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
### Dependencies
* `fatfs = "0.3"` for FAT image packing.
## 0.8.0 (2026-07-18) ## 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. * **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 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).
@@ -41,7 +142,7 @@ sidebar_label: Список изменений
* **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. * **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`. * **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. * **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. * **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.
@@ -97,7 +198,7 @@ sidebar_label: Список изменений
* `default_target_triple()` now respects `target_env` — Linux (gnu/musl) and Windows (msvc/gnu) use the correct environment instead of hardcoded values. * `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`. * **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. * **GitHub Stars and GPL-3.0 badges not rendering in README** — badge block converted to pure HTML.
@@ -140,7 +241,7 @@ sidebar_label: Список изменений
* **`tree.rs`, `fmt.rs` и `setup.rs`** — теперь поддерживают аргументы для опции `--help`. * **`tree.rs`, `fmt.rs` и `setup.rs`** — теперь поддерживают аргументы для опции `--help`.
* **Команды установки из файла README** — `| bash` → `| sh` для обеспечения совместимости с POSIX. * **Команды установки из файла README** — `| bash` → `| sh` для обеспечения совместимости с POSIX.
### Исправлено ### Fixed
* **`dcr new \<invalid-name>` создает каталог, а затем завершается с ошибкой** — теперь проверка * **`dcr new \<invalid-name>` создает каталог, а затем завершается с ошибкой** — теперь проверка
выполняется до начала любых операций с файлами. выполняется до начала любых операций с файлами.

View File

@@ -9,12 +9,14 @@ sidebar_label: Команды зависимостей (add, tree)
Добавляет зависимость в `dcr.toml`. Добавляет зависимость в `dcr.toml`.
```bash ```bash
dcr add fmt # поиск в реестре dcr add fmt # registry lookup
dcr add mylib ../path/to/lib # путь как источник dcr add mylib ../path/to/lib # path as source
dcr add mylib path:./lib # явный префикс пути dcr add mylib path:./lib # explicit path prefix
dcr add mylib git:https://github.com/user/repo # явный префикс git dcr add mylib git:https://github.com/user/repo # explicit git prefix
dcr add mylib github:user/repo # сокращённая запись GitHub dcr add mylib github:user/repo # GitHub shorthand
dcr add mylib gitlab:user/repo # сокращённая запись GitLab dcr add mylib gitlab:user/repo # GitLab shorthand
dcr add fmt pkg-config:fmt # system package via pkg-config
dcr add openssl pkg:openssl,libcrypto # multiple pkg-config packages
``` ```
Префиксы источника: Префиксы источника:
@@ -23,6 +25,7 @@ dcr add mylib gitlab:user/repo # сокращённая запись GitLab
* `git:` — URL адрес git-репозитория * `git:` — URL адрес git-репозитория
* `github:` — расширение `https://github.com/\<user>/\<repo>` * `github:` — расширение `https://github.com/\<user>/\<repo>`
* `gitlab:` — расширение `https://gitlab.com/\<user>/\<repo>` * `gitlab:` — расширение `https://gitlab.com/\<user>/\<repo>`
* `pkg-config:` / `pkg:` — one or more packages resolved by `pkg-config`
* `http://` / `https://` / `git@` — полный URL * `http://` / `https://` / `git@` — полный URL
Флаги: Флаги:
@@ -31,7 +34,12 @@ dcr add mylib gitlab:user/repo # сокращённая запись GitLab
* `--tag \<name>` — git tag * `--tag \<name>` — git tag
* `--rev \<hash>` — git commit * `--rev \<hash>` — git commit
Если источник не указан — DCR выполняет поиск в подключенных реестрах. Если источник не указан — DCR выполняет поиск в подключенных реестрах. A bare relative or absolute path is accepted as a path dependency.
For `pkg-config` dependencies, the referenced packages must already be installed
and provide `.pc` files. DCR invokes `pkg-config` during the build (using
`PATH` and `PKG_CONFIG_PATH`) and forwards the returned compiler and linker
flags; it does not download or build these packages.
## `dcr tree` ## `dcr tree`

View File

@@ -8,6 +8,7 @@ sidebar_label: Вклад
```bash ```bash
git clone https://github.com/dexoron/dcr git clone https://github.com/dexoron/dcr
# or a source mirror: GitVerse / SourceCraft / SourceForge / GitLab (see README)
cd dcr cd dcr
cargo build cargo build
``` ```
@@ -42,10 +43,11 @@ cargo clippy --all-targets -- -D warnings
## CI ## CI
В CI запускаются: CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check` * `cargo fmt --check`
* `cargo clippy --all-targets -- -D warnings` * `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features` * `cargo check --all-targets --all-features`
* Сборка под Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD * Unit + integration tests on Linux, macOS, Windows
* Integration tests (compilation check) * Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -61,6 +61,15 @@ Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive). See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## How do I choose a download mirror?
`dcrup install` uses `--mirror auto` by default and tries **cf → gh → sf → ya**.
```bash
dcrup install stable --mirror cf
export DCRUP_MIRROR=ya
```
## Lock-файл устарел ## Lock-файл устарел
При изменении зависимостей `dcr.lock` автоматически обновляется при следующем `dcr add`. Если нужно принудительно обновить — удалите `dcr.lock` и выполните `dcr build`. При изменении зависимостей `dcr.lock` автоматически обновляется при следующем `dcr add`. Если нужно принудительно обновить — удалите `dcr.lock` и выполните `dcr build`.

View File

@@ -4,28 +4,75 @@ sidebar_label: Установка
# Установка # Установка
## Linux (Dexoron Packages) ## dcrup (recommended)
Настройте менеджер пакетов на https://pkg.dexoron.su и установите: Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
**Arch Linux** ### Linux / macOS / BSD / Windows (bash)
```sh ```sh
sudo pacman -Sy dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
``` ```
**Debian/Ubuntu** Non-interactive install of DCR in one shot:
```sh ```sh
sudo apt update && sudo apt install dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
``` ```
**Fedora/RHEL** ### Windows (PowerShell)
```powershell
& ([scriptblock]::Create((irm https://ps1.dcr-tool.ru))) self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`) and is installed in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows).
### Common dcrup commands
```sh ```sh
sudo dnf install dcr dcrup install stable # latest stable prebuilt (auto: cf → gh → sf → ya)
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 --mirror cf # CloudFlare CDN
dcrup install stable --mirror ya # Yandex CDN (RU fallback)
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
dcrup uninstall 0.8.2 # remove one installed version
dcrup uninstall --all # remove all installed versions
``` ```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
### Download mirrors
Prebuilt installs try **cf → gh → sf → ya** unless you pin a host.
| Code | URL | Notes |
| ---- | ------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `cf` | `https://cdn-global.dcr-tool.ru/\<tag>/\<asset>` | CloudFlare CDN (worldwide) |
| `gh` | `https://github.com/dexoron/dcr/releases/download/\<tag>/\<asset>` | GitHub Releases |
| `sf` | `https://sourceforge.net/projects/dcr-tool/files/\<tag>/\<asset>/download` | SourceForge |
| `ya` | `https://cdn-ru.dcr-tool.ru/\<tag>/\<asset>` | Yandex CDN (RU fallback) |
```sh
dcrup install stable --mirror auto # default
export DCRUP_MIRROR=cf # persist for this shell
```
---
## Arch Linux (AUR) ## Arch Linux (AUR)
```sh ```sh
@@ -45,11 +92,12 @@ brew install dcr
sudo snap install dcrup 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) ## Nix (flake)
```sh ```sh
nix run github:dexoron/dcr nix run github:dexoron/dcr
# или установить в профиль:
nix profile install github:dexoron/dcr nix profile install github:dexoron/dcr
``` ```
@@ -59,48 +107,37 @@ nix profile install github:dexoron/dcr
cargo install dcr cargo install dcr
``` ```
## Linux / macOS (скрипт) Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh ```sh
curl -fsSL https://dcr.dexoron.su/install_bsd.sh | bash cargo install dcr --features archive
```
## BSD (скрипт)
```sh
curl -fsSL https://dcr.dexoron.su/install.sh | bash
```
## Windows (PowerShell)
```powershell
irm https://dcr.dexoron.su/install.ps1 | iex
``` ```
## Из источника ## Из источника
```sh ```sh
git clone https://github.com/dexoron/dcr.git git clone https://github.com/dexoron/dcr.git
cd dcr && cargo build --release cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
``` ```
## После установки ## После установки
Проверьте установку:
```bash ```bash
dcr setup dcr --version
dcrup show # if installed via dcrup
``` ```
После установки становятся доступны man страницы: Man pages (package installs / release assets):
```bash ```bash
man dcr man dcr
man dcr-build man dcr-build
``` ```
Чтобы использовать реестр, создайте файл `~/.dcr/config.toml`: Registry (optional) — `~/.dcr/config.toml`:
```toml ```toml
[registry.default] [registry.default]

View File

@@ -6,6 +6,13 @@ sidebar_label: Интеграция с IDE
## VS Code ## VS Code
Install the recommended [DCR extension by Dexoron-Labs](https://marketplace.visualstudio.com/items?itemName=Dexoron-Labs.dcr). Do not install Microsoft C/C++ extensions for DCR projects: DCR uses `clangd`. MS C/C++ is acceptable only when you need its debugger.
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
```bash ```bash
dcr gen vscode dcr gen vscode
``` ```

View File

@@ -0,0 +1,34 @@
---
sidebar_label: CLI output
---
# CLI output (experimental)
The structured output implementation is being developed incrementally.
Currently these global options apply to diagnostics emitted through the logger:
```sh
dcr --output plain build
dcr --output json build
dcr --color never build
dcr --quiet build
dcr --verbose build
```
`--output` accepts `human` (default), `plain`, or `json`.
Diagnostics are written to stderr. JSON diagnostics are newline-delimited objects
with `schema_version: 1`, `event`, and `message` fields. Command statuses use the
shared output helpers, build reporting emits structured lifecycle events, and
compiler output is represented as JSON events with its original stream and text.
The protocol is still experimental: some raw command data and subprocess stdout
remain unstructured.
`--color` accepts `auto`, `always`, or `never`. Automatic coloring requires a
terminal and respects `NO_COLOR`. Plain and JSON diagnostics never add colors.
Quiet mode preserves warnings, errors, and compiler diagnostics; verbose mode
enables debug and trace logging. Arguments following `--` are passed through
unchanged.
Remaining work includes migrating the remaining raw command data and subprocess
stdout, improving progress rendering and contextual errors, and expanding
integration coverage for stdout/stderr and closed pipes.

View File

@@ -41,22 +41,38 @@ sidebar_label: Обзор dcr.toml
## [пакет] ## [пакет]
| Поле | Обязательное | Описание | | Поле | Обязательное | Описание |
| ---------- | ------------ | ------------------------------------------- | | ------------- | ------------ | --------------------------------------------------------------------------------------------------------------- |
| `имя` | да | Имя проекта | | `имя` | да | Имя проекта |
| `версия` | да | Семантическая версия | | `версия` | да | Semantic version of the **project** |
| `тип` | no | `app`, `lib`, `none` (defaults to `"none"`) | | `dcr-version` | no | Semver of the **dcr tool** this project targets. Written by `dcr new` / `dcr init` to the current tool version. |
| `тип` | нет | `app`, `lib`, `none` (defaults to `"none"`) |
| `лицензия` | нет | SPDX-идентификатор лицензии | | `лицензия` | нет | SPDX-идентификатор лицензии |
| `автор` | нет | Автор | | `автор` | no | Автор |
```toml ```toml
[package] [package]
name = "my-app" name = "my-app"
version = "0.1.0" version = "0.1.0"
dcr-version = "0.8.4"
type = "app" type = "app"
license = "MIT" license = "MIT"
author = "John Doe" author = "John Doe"
``` ```
### `package.dcr-version`
Optional pin of the DCR CLI the project was written for. On every `dcr.toml` load:
| Situation | Behaviour |
| ------------------------------ | ---------------------------------------------------------- |
| Field missing / empty | Warning: add `dcr-version` (set by `dcr new` / `dcr init`) |
| Running dcr **older** than pin | Warning: upgrade dcr (`dcr --update`) |
| Running dcr **newer** than pin | Warning: review changelog, bump the pin when ready |
| Equal | Silent |
| Invalid semver | Warning once, field ignored |
Never fails the command — warnings only. Pre-release suffixes (`1.0.0-dev`) are ignored for comparison (`1.0.0-dev` ≡ `1.0.0`).
## [сборка] ## [сборка]
... ...
@@ -96,7 +112,12 @@ author = "John Doe"
Параметры из исходного файла конфигурации (не в виде типизированной структуры): Параметры из исходного файла конфигурации (не в виде типизированной структуры):
* Пакеты для pkg-config * `pkg_config` — list of packages queried for build-wide compiler/linker flags
Dependencies can also declare a system package directly, for example
`fmt = { pkg-config = "fmt" }`. This records the package in `dcr.lock` and applies
the flags returned by `pkg-config --cflags` and `pkg-config --libs`.
* Путь к linker script * Путь к linker script
* `build.steps` / `build.post_steps` — этапы генерации кода * `build.steps` / `build.post_steps` — этапы генерации кода
@@ -185,6 +206,8 @@ cmd = "./target/{profile}/{name}"
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]`). 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 | | Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- | | ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) | | `output` | yes | Image path relative to project root (`{profile}` allowed) |

View File

@@ -6,7 +6,7 @@ sidebar_label: Зависимости
## Форматы ## Форматы
В секции `[dependencies]` поддерживаются три формата: The `[dependencies]` section supports registry, path, Git, and `pkg-config` dependencies:
### Строка (реестр) ### Строка (реестр)
@@ -23,10 +23,10 @@ catch2 = ">=3.0,<4.0"
```toml ```toml
[dependencies] [dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" } dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0" }
``` ```
Поля: `git`, `branch`, `tag`, `rev`, `features`. Fields: `git`, `branch`, `tag`, `rev`, `mode`, `include`, `lib`, `libs`.
### Табличный (path) ### Табличный (path)
@@ -35,6 +35,32 @@ fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" }
mylib = { path = "../mylib" } mylib = { path = "../mylib" }
``` ```
For a prebuilt external library, specify its layout explicitly. The three
arrays are paths relative to the dependency root (`include`, `lib`) and linker
names (`libs`):
```toml
[dependencies]
dcr-math = { path = "../deps/dcr-math", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
### Table (`pkg-config`)
Use an installed `.pc` package when the library is provided by the operating system
or another system package manager. DCR invokes `pkg-config --cflags` and
`pkg-config --libs`, preserving include, library, linker, and other flags:
```toml
[dependencies]
fmt = { pkg-config = "fmt" }
openssl = { pkg-config = ["openssl", "libcrypto"] }
```
The `pkg-config` executable must be available in `PATH`. The named `.pc` files must
be available through pkg-config's standard search paths or via `PKG_CONFIG_PATH`.
These dependencies are not downloaded or built by DCR; they are recorded in
`dcr.lock` with a `pkg-config+...` source.
## Реестр ## Реестр
## RegistryDCR использует реестр пакетов для поиска зависимостей по имени.```toml ## RegistryDCR использует реестр пакетов для поиска зависимостей по имени.```toml
@@ -46,7 +72,7 @@ main = { url = "https://github.com/dcr-ports/dcr-index", priority = 1 }
```toml ```toml
# ~/.dcr/config.toml # ~/.dcr/config.toml
[registry.default] [registry.default]
url = "https://index.dcr.pm" url = "https://index.dcr.dexoron.tech"
priority = 1 priority = 1
``` ```
@@ -54,7 +80,23 @@ priority = 1
## Git-зависимости ## Git-зависимости
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources: Git dependencies are cloned into `~/.dcr/git/`; their exact checked-out commit is written to `dcr.lock`.
Both Git and path dependencies have two modes:
* **DCR package:** the source has `dcr.toml`. DCR builds it before the consumer and uses the package name from its manifest for linking.
* **Prebuilt library:** it provides existing headers and binaries through `include`, `lib`, and `libs`. DCR passes them to the compiler/linker without building the dependency.
The mode is normally detected automatically. Use `mode = "build"` or `mode = "prebuild"` when a source contains both a manifest and prebuilt artifacts and you need to choose explicitly.
`dcr-math-lib` publishes both forms. Select its prebuilt library explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
DCR supports specifying branch/tag/rev for git sources:
* `branch` — переключиться на ветку * `branch` — переключиться на ветку
* `tag` — переключиться на тег * `tag` — переключиться на тег
@@ -63,7 +105,7 @@ Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying
## Path dependencies ## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`. Local paths may point at a DCR package or a prebuilt external library. A path DCR package is built before its consumer, including its own path/git dependencies. DCR detects dependency cycles. A prebuilt library is never built by DCR; it is linked from the directories declared in its dependency entry.
```toml ```toml
[dependencies] [dependencies]
@@ -71,18 +113,51 @@ mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" } 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.* For DCR packages, the package name from `dcr.toml` is used for linking (so the dependency key may differ from the library name). Header resolution includes the packaged `target/include` directory and link search includes `target/lib`.
### Recommended library layouts
Buildable DCR library:
```text
dcr-math-lib/
├── dcr.toml
└── src/
├── dcr_math.c
└── dcr_math.h
```
Prebuilt library:
```text
dcr-math-lib/
├── include/
│ └── dcr_math.h
└── lib/
└── libdcr-math.a # or .so / .lib
```
`libs` contains linker names without the `lib` prefix and file extension: use
`["dcr-math"]` for `libdcr-math.a`.
If one repository contains both forms, keep the prebuilt files in `include/` and `lib/` and select the mode explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
For a local copy, replace `git` with `path = "../dcr-math-lib"`. In `prebuild` mode DCR does not run the dependency build, even when `dcr.toml` is present.
## dcr.lock ## dcr.lock
Dependency lock file. Contains package names and sources. 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`. Created during `dcr build` for resolved registry, path, and Git dependencies. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process ## Resolution process
1. Load all dependencies (registry → git → path) 1. Resolve dependency sources (registry → git → path)
2. For path deps: recursively read their `dcr.toml` 2. Fetch git dependencies into `~/.dcr/git/` and check out the requested ref
3. For registry deps: search `index.json` 3. Build DCR package dependencies recursively
4. For git deps: clone to cache 4. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -58,3 +58,27 @@ export DCR_INDEX_PATH=/custom/path/index.json
``` ```
По умолчанию: `~/.dcr/index.json`. По умолчанию: `~/.dcr/index.json`.
## DCRUP_MIRROR
Download mirror for `dcrup` (prebuilt binaries only).
```bash
export DCRUP_MIRROR=auto # cf → gh → sf → ya (default)
export DCRUP_MIRROR=cf # CloudFlare CDN
export DCRUP_MIRROR=gh # GitHub Releases
export DCRUP_MIRROR=sf # SourceForge
export DCRUP_MIRROR=ya # Yandex CDN (RU fallback)
```
CLI override: `dcrup install stable --mirror cf`.
## DCRUP_HOME / DCRUP_BIN / DCRUP_REPO
Installer layout and source clone URL:
```bash
export DCRUP_HOME=~/.dcr
export DCRUP_BIN=~/.dcr/bin
export DCRUP_REPO=https://github.com/dexoron/dcr
```

View File

@@ -8,8 +8,11 @@ sidebar_label: Introduction
<summary>Quick reference</summary> <summary>Quick reference</summary>
```bash ```bash
# Installation # Installation (dcrup)
curl -fsSL https://dcr.dexoron.su/install.sh | 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 / GitHub / SourceForge / Yandex
# Create a project # Create a project
dcr new my-app dcr new my-app

View File

@@ -4,6 +4,111 @@ sidebar_label: Changelog
# Changelog # Changelog
## 0.9.5 (2026-10-21)
* **Structured CLI output** — shared helpers now provide Cargo-like human, plain, and JSON output modes.
* **Color and diagnostics policy** — `--color`, `NO_COLOR`, `--quiet`, and `--verbose` are applied consistently across commands.
* **Build reporting** — lifecycle events and compiler diagnostics are available as structured JSON events.
* **Output lab** — sandbox scenarios cover help, lifecycle commands, compiler warnings/errors, stream capture, and broken pipes.
## 0.9.1 (2026-09-13)
* **`pkg-config` dependencies** — declare `fmt = { pkg-config = "fmt" }` or multiple package names in `[dependencies]`; DCR applies `.pc` compiler/linker flags and records the resolved package in `dcr.lock`.
* **`dcr add` support for `pkg-config`** — easily add system package dependencies with `dcr add fmt pkg-config:fmt` or `dcr add openssl pkg:openssl,libcrypto`.
* **`dcr tree` & IDE integration** — `pkg-config` packages are marked in `dcr tree` and resolved into compiler flags in `dcr gen` (`compile_commands.json`).
* **Fixed `dcr new` in non-ASCII / spaced paths** — initializing projects from folders with non-ASCII characters or spaces no longer fails validation.
## 0.9.0 (2026-08-31)
* **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 record the exact commit in `dcr.lock`.
* **Build and prebuild modes** — `path` and `git` dependencies can build a DCR package from `dcr.toml` or link existing `include`/`lib`/`libs` artifacts; `mode = "build"` / `"prebuild"` selects explicitly when both forms are present.
* **Prebuilt dependency examples** — documentation now shows the `dcr-math-lib` Git repository and recommended build/prebuilt layouts for both `git` and `path`.
* **Transitive dependency builds and cycle reporting** — DCR recursively builds DCR packages and reports a clear dependency chain for cycles.
* **Bare path arguments for `dcr add`** — `dcr add mylib ../mylib` now works in addition to the explicit `path:` form.
* **Removed `install.sh` / `install.ps1` / `install_bsd.sh`** — superseded by `dcrup`.
## 0.8.5 (2026-08-08)
* **`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)
**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) ## 0.8.1 (2026-07-20)
### Added ### Added
@@ -14,7 +119,7 @@ sidebar_label: Changelog
* **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin` * **GAS / MASM / LLC** — object → `objcopy -O binary` → `\<stem>.bin`
* **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin` * **C/C++** — objects → freestanding link → `objcopy -O binary` → `\<name>.bin`
* Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit * Requires `llvm-objcopy` / `objcopy` / `gobjcopy` except for NASM/FASM direct emit
* **`[archive]` section** — after a successful build, pack a FAT disk image (`fatfs`): `output`, `format` (`fat12`/`fat16`/`fat32`), optional `size` (default 1.44 MiB), `offset`, `label`, `bootsector`, and `layout` (`from` → `to`, supports globs). `{profile}` works in paths. * **`[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. * **Single-file `build.roots`** — a root may be a single source or header file, not only a directory.
### Changed ### Changed
@@ -22,10 +127,6 @@ sidebar_label: Changelog
* **`--force`** also re-runs `build.steps` and `build.post_steps`. * **`--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. * **`dcr run` on workspace-only root** — if `[run].cmd` is set, run that after build; otherwise delegate to a workspace member.
### Dependencies
* `fatfs = "0.3"` for FAT image packing.
## 0.8.0 (2026-07-18) ## 0.8.0 (2026-07-18)
### Added ### Added

View File

@@ -15,6 +15,8 @@ dcr add mylib path:./lib # explicit path prefix
dcr add mylib git:https://github.com/user/repo # explicit git prefix dcr add mylib git:https://github.com/user/repo # explicit git prefix
dcr add mylib github:user/repo # GitHub shorthand dcr add mylib github:user/repo # GitHub shorthand
dcr add mylib gitlab:user/repo # GitLab shorthand dcr add mylib gitlab:user/repo # GitLab shorthand
dcr add fmt pkg-config:fmt # system package via pkg-config
dcr add openssl pkg:openssl,libcrypto # multiple pkg-config packages
``` ```
Source prefixes: Source prefixes:
@@ -23,6 +25,7 @@ Source prefixes:
* `git:` — generic git URL * `git:` — generic git URL
* `github:` — expands to `https://github.com/\<user>/\<repo>` * `github:` — expands to `https://github.com/\<user>/\<repo>`
* `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>` * `gitlab:` — expands to `https://gitlab.com/\<user>/\<repo>`
* `pkg-config:` / `pkg:` — one or more packages resolved by `pkg-config`
* `http://` / `https://` / `git@` — full URL * `http://` / `https://` / `git@` — full URL
Flags: Flags:
@@ -31,7 +34,12 @@ Flags:
* `--tag \<name>` — git tag * `--tag \<name>` — git tag
* `--rev \<hash>` — git commit * `--rev \<hash>` — git commit
If source is omitted — DCR searches connected registries. If source is omitted — DCR searches connected registries. A bare relative or absolute path is accepted as a path dependency.
For `pkg-config` dependencies, the referenced packages must already be installed
and provide `.pc` files. DCR invokes `pkg-config` during the build (using
`PATH` and `PKG_CONFIG_PATH`) and forwards the returned compiler and linker
flags; it does not download or build these packages.
## `dcr tree` ## `dcr tree`

View File

@@ -8,6 +8,7 @@ sidebar_label: Contributing
```bash ```bash
git clone https://github.com/dexoron/dcr git clone https://github.com/dexoron/dcr
# or a source mirror: GitVerse / SourceCraft / SourceForge / GitLab (see README)
cd dcr cd dcr
cargo build cargo build
``` ```
@@ -42,10 +43,11 @@ cargo test --all-targets
## CI ## CI
CI runs: CI runs (see `.github/workflows/ci.yml`):
* `cargo fmt --check` * `cargo fmt --check`
* `cargo clippy --all-targets -- -D warnings` * `cargo clippy` (default + `--all-features`)
* `cargo check --all-targets --all-features` * `cargo check --all-targets --all-features`
* Build on Linux, macOS, Windows * Unit + integration tests on Linux, macOS, Windows
* Integration tests (compilation check) * Extra Linux job with `--features archive` (FAT images)
* Tools on runners: clang, nasm, clang-format/tidy (Linux)

View File

@@ -61,6 +61,15 @@ Use `kind = "flat-bin"` (NASM `-f bin`) and optional `[archive]` for a FAT disk
See [OS-dev recipe](/docs/recipes/os-flat-bin-archive). See [OS-dev recipe](/docs/recipes/os-flat-bin-archive).
## How do I choose a download mirror?
`dcrup install` uses `--mirror auto` by default and tries **cf → gh → sf → ya**.
```bash
dcrup install stable --mirror cf
export DCRUP_MIRROR=ya
```
## Lock file ## 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`. `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

@@ -4,28 +4,75 @@ sidebar_label: Installation
# Installation # Installation
## Linux (Dexoron Packages) ## dcrup (recommended)
Configure your package manager at https://pkg.dexoron.su and install: Install and switch DCR versions (stable / dev / night, pin `0.8.2`, optional build from source).
**Arch Linux** ### Linux / macOS / BSD / Windows (bash)
```sh ```sh
sudo pacman -Sy dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- self-install
export PATH="$HOME/.dcr/bin:$PATH"
dcrup install stable
``` ```
**Debian/Ubuntu** Non-interactive install of DCR in one shot:
```sh ```sh
sudo apt update && sudo apt install dcr curl --proto '=https' --tlsv1.2 -sSf https://sh.dcr-tool.ru | sh -s -- install stable
export PATH="$HOME/.dcr/bin:$PATH"
``` ```
**Fedora/RHEL** ### Windows (PowerShell)
```powershell
& ([scriptblock]::Create((irm https://ps1.dcr-tool.ru))) self-install
# $env:Path += ";$env:USERPROFILE\.dcr\bin"
dcrup install stable
```
After `self-install`, the command is **`dcrup`** (no `.sh` / `.ps1`) and is installed in `~/.dcr/bin` (Unix) or `%USERPROFILE%\.dcr\bin` (Windows).
### Common dcrup commands
```sh ```sh
sudo dnf install dcr dcrup install stable # latest stable prebuilt (auto: cf → gh → sf → ya)
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 --mirror cf # CloudFlare CDN
dcrup install stable --mirror ya # Yandex CDN (RU fallback)
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
dcrup uninstall 0.8.2 # remove one installed version
dcrup uninstall --all # remove all installed versions
``` ```
Layout: `~/.dcr/toolchains/\<id>/dcr` and `~/.dcr/bin/dcr` → active version.
### Download mirrors
Prebuilt installs try **cf → gh → sf → ya** unless you pin a host.
| Code | URL | Notes |
| ---- | ------------------------------------------------------------------------------------------------------------ | -------------------------- |
| `cf` | `https://cdn-global.dcr-tool.ru/\<tag>/\<asset>` | CloudFlare CDN (worldwide) |
| `gh` | `https://github.com/dexoron/dcr/releases/download/\<tag>/\<asset>` | GitHub Releases |
| `sf` | `https://sourceforge.net/projects/dcr-tool/files/\<tag>/\<asset>/download` | SourceForge |
| `ya` | `https://cdn-ru.dcr-tool.ru/\<tag>/\<asset>` | Yandex CDN (RU fallback) |
```sh
dcrup install stable --mirror auto # default
export DCRUP_MIRROR=cf # persist for this shell
```
---
## Arch Linux (AUR) ## Arch Linux (AUR)
```sh ```sh
@@ -45,11 +92,12 @@ brew install dcr
sudo snap install dcrup 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) ## Nix (flake)
```sh ```sh
nix run github:dexoron/dcr nix run github:dexoron/dcr
# or install to profile:
nix profile install github:dexoron/dcr nix profile install github:dexoron/dcr
``` ```
@@ -59,48 +107,37 @@ nix profile install github:dexoron/dcr
cargo install dcr cargo install dcr
``` ```
## Linux / macOS (script) Note: crates.io builds may omit optional features. For FAT disk images (`[archive]`), prefer release binaries or:
```sh ```sh
curl -fsSL https://dcr.dexoron.su/install.sh | sh cargo install dcr --features archive
```
## BSD (script)
```sh
curl -fsSL https://dcr.dexoron.su/install_bsd.sh | sh
```
## Windows (PowerShell)
```powershell
irm https://dcr.dexoron.su/install.ps1 | iex
``` ```
## From source ## From source
```sh ```sh
git clone https://github.com/dexoron/dcr.git git clone https://github.com/dexoron/dcr.git
cd dcr && cargo build --release cd dcr
cargo build --release --features archive
ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr ln -sf "$PWD/target/release/dcr" ~/.local/bin/dcr
# or manage versions with dcrup install night / --build
``` ```
## Post-install ## Post-install
Verify the installation:
```bash ```bash
dcr --version dcr --version
dcrup show # if installed via dcrup
``` ```
Man pages are available after installation: Man pages (package installs / release assets):
```bash ```bash
man dcr man dcr
man dcr-build man dcr-build
``` ```
To use the registry, create `~/.dcr/config.toml`: Registry (optional) — `~/.dcr/config.toml`:
```toml ```toml
[registry.default] [registry.default]

View File

@@ -6,6 +6,13 @@ sidebar_label: IDE Integration
## VS Code ## VS Code
Install the recommended [DCR extension by Dexoron-Labs](https://marketplace.visualstudio.com/items?itemName=Dexoron-Labs.dcr). Do not install Microsoft C/C++ extensions for DCR projects: DCR uses `clangd`. MS C/C++ is acceptable only when you need its debugger.
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
```bash ```bash
dcr gen vscode dcr gen vscode
``` ```

View File

@@ -0,0 +1,34 @@
---
sidebar_label: CLI output
---
# CLI output (experimental)
The structured output implementation is being developed incrementally.
Currently these global options apply to diagnostics emitted through the logger:
```sh
dcr --output plain build
dcr --output json build
dcr --color never build
dcr --quiet build
dcr --verbose build
```
`--output` accepts `human` (default), `plain`, or `json`.
Diagnostics are written to stderr. JSON diagnostics are newline-delimited objects
with `schema_version: 1`, `event`, and `message` fields. Command statuses use the
shared output helpers, build reporting emits structured lifecycle events, and
compiler output is represented as JSON events with its original stream and text.
The protocol is still experimental: some raw command data and subprocess stdout
remain unstructured.
`--color` accepts `auto`, `always`, or `never`. Automatic coloring requires a
terminal and respects `NO_COLOR`. Plain and JSON diagnostics never add colors.
Quiet mode preserves warnings, errors, and compiler diagnostics; verbose mode
enables debug and trace logging. Arguments following `--` are passed through
unchanged.
Remaining work includes migrating the remaining raw command data and subprocess
stdout, improving progress rendering and contextual errors, and expanding
integration coverage for stdout/stderr and closed pipes.

View File

@@ -41,9 +41,10 @@ Main project configuration file. Located at the project root.
## [package] ## [package]
| Field | Required | Description | | Field | Required | Description |
| --------- | -------- | ------------------------------------------- | | ------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| `name` | yes | Project name | | `name` | yes | Project name |
| `version` | yes | Semantic version | | `version` | yes | Semantic version of the **project** |
| `dcr-version` | no | Semver of the **dcr tool** this project targets. Written by `dcr new` / `dcr init` to the current tool version. |
| `type` | no | `app`, `lib`, `none` (defaults to `"none"`) | | `type` | no | `app`, `lib`, `none` (defaults to `"none"`) |
| `license` | no | SPDX license identifier | | `license` | no | SPDX license identifier |
| `author` | no | Author | | `author` | no | Author |
@@ -52,11 +53,26 @@ Main project configuration file. Located at the project root.
[package] [package]
name = "my-app" name = "my-app"
version = "0.1.0" version = "0.1.0"
dcr-version = "0.8.4"
type = "app" type = "app"
license = "MIT" license = "MIT"
author = "John Doe" author = "John Doe"
``` ```
### `package.dcr-version`
Optional pin of the DCR CLI the project was written for. On every `dcr.toml` load:
| Situation | Behaviour |
| ------------------------------ | ---------------------------------------------------------- |
| Field missing / empty | Warning: add `dcr-version` (set by `dcr new` / `dcr init`) |
| Running dcr **older** than pin | Warning: upgrade dcr (`dcr --update`) |
| Running dcr **newer** than pin | Warning: review changelog, bump the pin when ready |
| Equal | Silent |
| Invalid semver | Warning once, field ignored |
Never fails the command — warnings only. Pre-release suffixes (`1.0.0-dev`) are ignored for comparison (`1.0.0-dev` ≡ `1.0.0`).
## [build] ## [build]
... ...
@@ -96,7 +112,12 @@ author = "John Doe"
Settings from raw config (not in typed struct): Settings from raw config (not in typed struct):
* `pkg_config` — list of pkg-config packages * `pkg_config` — list of packages queried for build-wide compiler/linker flags
Dependencies can also declare a system package directly, for example
`fmt = { pkg-config = "fmt" }`. This records the package in `dcr.lock` and applies
the flags returned by `pkg-config --cflags` and `pkg-config --libs`.
* `ldscript` — linker script path * `ldscript` — linker script path
* `build.steps` / `build.post_steps` — codegen steps * `build.steps` / `build.post_steps` — codegen steps
@@ -185,6 +206,8 @@ See [workspaces](/docs/reference/workspaces).
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]`). 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 | | Field | Required | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------- | | ------------ | -------- | ------------------------------------------------------------------------------------------- |
| `output` | yes | Image path relative to project root (`{profile}` allowed) | | `output` | yes | Image path relative to project root (`{profile}` allowed) |

View File

@@ -6,7 +6,7 @@ sidebar_label: Dependencies
## Formats ## Formats
The `[dependencies]` section supports three formats: The `[dependencies]` section supports registry, path, Git, and `pkg-config` dependencies:
### String (registry) ### String (registry)
@@ -23,10 +23,10 @@ The version string is used as-is for registry lookup.
```toml ```toml
[dependencies] [dependencies]
fmt = { git = "https://github.com/fmtlib/fmt", tag = "10.1.1" } dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0" }
``` ```
Fields: `git`, `branch`, `tag`, `rev`. Fields: `git`, `branch`, `tag`, `rev`, `mode`, `include`, `lib`, `libs`.
### Table (path) ### Table (path)
@@ -35,6 +35,32 @@ Fields: `git`, `branch`, `tag`, `rev`.
mylib = { path = "../mylib" } mylib = { path = "../mylib" }
``` ```
For a prebuilt external library, specify its layout explicitly. The three
arrays are paths relative to the dependency root (`include`, `lib`) and linker
names (`libs`):
```toml
[dependencies]
dcr-math = { path = "../deps/dcr-math", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
### Table (`pkg-config`)
Use an installed `.pc` package when the library is provided by the operating system
or another system package manager. DCR invokes `pkg-config --cflags` and
`pkg-config --libs`, preserving include, library, linker, and other flags:
```toml
[dependencies]
fmt = { pkg-config = "fmt" }
openssl = { pkg-config = ["openssl", "libcrypto"] }
```
The `pkg-config` executable must be available in `PATH`. The named `.pc` files must
be available through pkg-config's standard search paths or via `PKG_CONFIG_PATH`.
These dependencies are not downloaded or built by DCR; they are recorded in
`dcr.lock` with a `pkg-config+...` source.
## Registry ## Registry
DCR uses a package registry for dependency lookup by name. DCR uses a package registry for dependency lookup by name.
@@ -42,7 +68,7 @@ DCR uses a package registry for dependency lookup by name.
```toml ```toml
# ~/.dcr/config.toml # ~/.dcr/config.toml
[registry.default] [registry.default]
url = "https://index.dcr.pm" url = "https://index.dcr.dexoron.tech"
priority = 1 priority = 1
``` ```
@@ -50,7 +76,23 @@ Registry priority: order in `config.toml`. The `DCR_INDEX_PATH` variable overrid
## Git dependencies ## Git dependencies
Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying branch/tag/rev for git sources: Git dependencies are cloned into `~/.dcr/git/`; their exact checked-out commit is written to `dcr.lock`.
Both Git and path dependencies have two modes:
* **DCR package:** the source has `dcr.toml`. DCR builds it before the consumer and uses the package name from its manifest for linking.
* **Prebuilt library:** it provides existing headers and binaries through `include`, `lib`, and `libs`. DCR passes them to the compiler/linker without building the dependency.
The mode is normally detected automatically. Use `mode = "build"` or `mode = "prebuild"` when a source contains both a manifest and prebuilt artifacts and you need to choose explicitly.
`dcr-math-lib` publishes both forms. Select its prebuilt library explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
DCR supports specifying branch/tag/rev for git sources:
* `branch` — switch to a branch * `branch` — switch to a branch
* `tag` — switch to a tag * `tag` — switch to a tag
@@ -59,7 +101,7 @@ Git dependencies are parsed and recorded in `dcr.lock`. DCR supports specifying
## Path dependencies ## Path dependencies
Local paths. DCR automatically discovers include and lib directories from the neighbor's `dcr.toml`. Local paths may point at a DCR package or a prebuilt external library. A path DCR package is built before its consumer, including its own path/git dependencies. DCR detects dependency cycles. A prebuilt library is never built by DCR; it is linked from the directories declared in its dependency entry.
```toml ```toml
[dependencies] [dependencies]
@@ -67,18 +109,51 @@ mylib = { path = "/abs/path/to/lib" }
mylib = { path = "../relative/path" } 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.* For DCR packages, the package name from `dcr.toml` is used for linking (so the dependency key may differ from the library name). Header resolution includes the packaged `target/include` directory and link search includes `target/lib`.
### Recommended library layouts
Buildable DCR library:
```text
dcr-math-lib/
├── dcr.toml
└── src/
├── dcr_math.c
└── dcr_math.h
```
Prebuilt library:
```text
dcr-math-lib/
├── include/
│ └── dcr_math.h
└── lib/
└── libdcr-math.a # or .so / .lib
```
`libs` contains linker names without the `lib` prefix and file extension: use
`["dcr-math"]` for `libdcr-math.a`.
If one repository contains both forms, keep the prebuilt files in `include/` and `lib/` and select the mode explicitly:
```toml
[dependencies]
dcr-math = { git = "https://github.com/dexoron/dcr-math-lib.git", tag = "v0.1.0", mode = "prebuild", include = ["include"], lib = ["lib"], libs = ["dcr-math"] }
```
For a local copy, replace `git` with `path = "../dcr-math-lib"`. In `prebuild` mode DCR does not run the dependency build, even when `dcr.toml` is present.
## dcr.lock ## dcr.lock
Dependency lock file. Contains package names and sources. 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`. Created during `dcr build` for resolved registry, path, and Git dependencies. Not updated during `dcr add` — only on the next `dcr build`.
## Resolution process ## Resolution process
1. Load all dependencies (registry → git → path) 1. Resolve dependency sources (registry → git → path)
2. For path deps: recursively read their `dcr.toml` 2. Fetch git dependencies into `~/.dcr/git/` and check out the requested ref
3. For registry deps: search `index.json` 3. Build DCR package dependencies recursively
4. For git deps: clone to cache 4. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler
5. Collect `include_dirs`, `lib_dirs`, `libs` for the compiler

View File

@@ -58,3 +58,27 @@ export DCR_INDEX_PATH=/custom/path/index.json
``` ```
Default: `~/.dcr/index.json`. Default: `~/.dcr/index.json`.
## DCRUP_MIRROR
Download mirror for `dcrup` (prebuilt binaries only).
```bash
export DCRUP_MIRROR=auto # cf → gh → sf → ya (default)
export DCRUP_MIRROR=cf # CloudFlare CDN
export DCRUP_MIRROR=gh # GitHub Releases
export DCRUP_MIRROR=sf # SourceForge
export DCRUP_MIRROR=ya # Yandex CDN (RU fallback)
```
CLI override: `dcrup install stable --mirror cf`.
## DCRUP_HOME / DCRUP_BIN / DCRUP_REPO
Installer layout and source clone URL:
```bash
export DCRUP_HOME=~/.dcr
export DCRUP_BIN=~/.dcr/bin
export DCRUP_REPO=https://github.com/dexoron/dcr
```