Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
5fd3ec1
2026.11.26.2: a build after a failed build that stated a build-optimi…
Sunrisepeak Nov 26, 2026
679fc6a
Merge remote-tracking branch 'origin/main' into fix/buildopt-switch-a…
Sunrisepeak Nov 26, 2026
ffec0b9
one reader of code text, one enumeration of dependency tables; mcpp a…
Sunrisepeak Nov 26, 2026
7855d05
cache entries record their users; a graph C library without a C++ ABI…
Sunrisepeak Nov 26, 2026
b8781d5
the home keeps its given spelling; path identity is asked of one modu…
Sunrisepeak Nov 26, 2026
bf4da82
an import inside a preprocessor condition is read by the compiler's d…
Sunrisepeak Nov 26, 2026
405bdd7
a dependency's shared library is named by its package; exact exports …
Sunrisepeak Nov 26, 2026
bf75d10
the PATH of a build program, a test and a run from one composer; a ho…
Sunrisepeak Nov 26, 2026
d80c5ec
an image linked from one file and loaded from another is refused (run…
Sunrisepeak Nov 26, 2026
7b2ef5e
a shared image asking for the static TLS block beyond the C library's…
Sunrisepeak Nov 26, 2026
c96bb89
completion: mcpp answers from its command tree through mcpplibs.cmdli…
Sunrisepeak Nov 26, 2026
a173618
a BMI is one ninja node in both its spellings; the static TLS bound i…
Sunrisepeak Nov 26, 2026
5aae00e
tests: cases 1167 to 1176 and the expectations of the changed behaviour
Sunrisepeak Nov 26, 2026
fb0d7b0
2026.11.27.1: specifications, usage chapters, CHANGELOG and the desig…
Sunrisepeak Nov 26, 2026
905bff1
the planning scan starts with an argument vector; the C++ ABI refusal…
Sunrisepeak Nov 27, 2026
cb712a3
tests and records: the BMI edges under clang, the scan words, the ref…
Sunrisepeak Nov 27, 2026
23facb5
docs/22: the C++ ABI refusal states the toolchain's std module among …
Sunrisepeak Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ v3 的 R1 到 R4 与文本不变。变化:`conservative` 的描述,`check`
开关的"取值改变后第一次构建正确"需要它成立,因此一并修复:`toolchain_request_identity` 把这三个环境变量并入请求,未陈述时的标识与此前相同,
只有陈述时才附加。边的条目(`MCPP_BMI_CUTOFF`)在执行时读取,不并入。

**发布后的更正(2026.11.27.1)。** 上述做法在 2026.11.26.1 中有一个缺口,由发布后的净室验证测出:`toolchain_request_identity` 属于构建的记录
(`target/.build_cache`),记录只在构建成功时写下。带陈述的构建失败时,图已按陈述重写,记录仍是此前那次成功构建的;其后不带陈述的构建与记录相符,
快速路径重放了按陈述写的图。GCC 上提示所给的命令 `MCPP_PRIVATE_FRAGMENT=conservative mcpp build` 在片段之前有条件指令时必然失败
(按原样构建,GCC 不支持),于是其后的 `mcpp build` 以 `module already declared` 失败,直到编辑源文件或清单。

更正:陈述并入图自身所记的请求(`request_tag`,`build.ninja` 首行的 `request=`),这是"A、B、A"问题已有的机制,所有快速路径在重放前比较它;
`toolchain_request_identity` 中的那一段删除,不留两处。未陈述时标签与此前相同。e2e 1162、1163 在核对之后增加一次不带陈述的构建,
单元测试 `GraphShape/TheRequestNamesAStatedSwitch` 固定哪些陈述改变标签、哪些不改变。原先的 e2e 1161 E 只覆盖了"带陈述的构建成功之后",没有覆盖失败之后。

## 8. 未决的测量

| 编号 | 问题 | 结论 |
Expand Down Expand Up @@ -293,7 +302,7 @@ e2e:1161(条件放行、宏拒绝、`conservative`、取值改变后的第
| 正确性(B) | 条件内的 `#define` 是否生效不可知 | 只读文本,一律拒绝 |
| 正确性(C) | 续行使物理行与逻辑行不同 | 模块声明与片段之间出现即按原样构建;GMF 中的宏续行不受影响 |
| 开关 | GCC 上没有 `as-written` | `conservative`、`checkGcc` |
| 开关 | 取值改变后第一次构建(7.5) | 请求标识并入三个环境变量;e2e 1161 E |
| 开关 | 取值改变后第一次构建(7.5) | 图自身所记的请求并入三个环境变量(2026.11.27.1 起;此前在构建的记录里);e2e 1161 E,1162、1163 的核对之后一步 |
| 提示 | 以"这次构建用过什么"为条件会在不相干的失败上出现 | 以失败的步骤为条件;e2e 的反例 |
| 提示 | 失败的步骤取自输出格式 | 取不到按 R4,少说而不是多说;`progress` 已依赖同一格式 |
| 提示 | 保留的记录在编译边结束时才写 | 7.3:并行失败的导入者不给 R2;只说已记录的事实 |
Expand Down

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .agents/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ superseded_by: 2026-09-07-....md # when status is superseded
---
```

374 records.
375 records.

## By subject

Expand Down Expand Up @@ -61,6 +61,7 @@ Records that declare one. Everything else is listed by date below.

### design

- [陈述的闭包、单一读者与六项功能:十四项缺陷的收敛设计](2026-11-27-stated-closure-single-reader-and-feature-designs.md) — landed
- [生态级方案:内核接口的供给与能力,派生状态的核对,存储的引用](2026-11-22-kernel-interface-and-derived-state-ecosystem-design.md) — active
- [程序起点模型:启动者、两层入口与 `main` 的三种陈述(mcpp#845、mcpp#981)](2026-11-20-program-start-model.md) — landed
- [升级的连续性:打包修订不在使用路径上替换载荷、替换失败不拆掉可用状态、home 中的悬空记录自愈、真实的升级 lane](2026-10-17-upgrade-continuity-design.md) — active
Expand Down Expand Up @@ -216,6 +217,7 @@ Records that declare one. Everything else is listed by date below.

### 2026-11

- [陈述的闭包、单一读者与六项功能:十四项缺陷的收敛设计](2026-11-27-stated-closure-single-reader-and-feature-designs.md) — landed
- [clang BMI 的截断与私有模块片段判定的收窄](2026-11-26-clang-bmi-cutoff-and-private-fragment-refinement-design.md) — active
- [测试与 CI 一轮的收尾:平台列未命中的刷新条件(mcpp#996)、`i686-windows-msvc` 行、工作区索引与引号键的迁移、索引的全量验证](2026-11-22-test-round-wrap-up-plan.md) — active
- [生态级方案:内核接口的供给与能力,派生状态的核对,存储的引用](2026-11-22-kernel-interface-and-derived-state-ecosystem-design.md) — active
Expand Down
35 changes: 35 additions & 0 deletions .github/tools/check_path_identity.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# The resolutions of a path to its canonical form only fall (design 2026-11-27 §4.6, mcpp#1024).
#
# A path the user or the environment gives is opened and handed to a program as it is spelled; its
# canonical form is an identity, asked of mcpp.libs.path_identity, which reports when it cannot be
# read. Each file's count of `canonical(` and `weakly_canonical(` called on std::filesystem is at
# most its line in path-identity.baseline; a file not listed has none. A line falls as its calls
# move to the identity module (an identity) or to the given spelling (an address).
set -u
cd "$(dirname "$0")/../.."

baseline=.github/tools/path-identity.baseline
[ -f "$baseline" ] || { echo "::error::missing $baseline"; exit 1; }

current=$(grep -rcE '(filesystem|fs)::(weakly_)?canonical\(' src modules \
--include='*.cpp' --include='*.cppm' 2>/dev/null \
| grep -v ':0$' | grep -v '^modules/libs/src/path_identity.cppm:' | grep -v '/tests/' \
| sed 's/:/ /' | sort)

rc=0
while read -r file n; do
[ -n "$file" ] || continue
allowed=$(awk -v f="$file" '$1 == f { print $2 }' "$baseline")
if [ -z "$allowed" ]; then
echo "::error::$file resolves a path to its canonical form $n time(s); ask mcpp.libs.path_identity, or open the given spelling"
rc=1
elif [ "$n" -gt "$allowed" ]; then
echo "::error::$file resolves a path to its canonical form $n times, more than the $allowed of $baseline"
rc=1
elif [ "$n" -lt "$allowed" ]; then
echo "note: $file resolves $n times, fewer than the $allowed of $baseline; lower its line"
fi
done <<< "$current"
[ "$rc" = 0 ] && echo "OK: no file resolves a path to its canonical form more often than $baseline states"
exit "$rc"
30 changes: 30 additions & 0 deletions .github/tools/path-identity.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
modules/manifest/src/glob.cppm 5
src/build/engine_package.cppm 2
src/build/hermetic.cppm 1
src/build/plan.cppm 2
src/build/prepare/features.cpp 4
src/build/prepare/graph.cpp 3
src/build/prepare/manifest.cpp 1
src/build/prepare/plan.cpp 2
src/build/prepare/platform.cpp 1
src/build/prepare/state.cppm 1
src/build/prepare/windows_resources.cpp 2
src/build/resources.cppm 1
src/build/runtime_validation.cppm 3
src/build/schedule/compiler_transaction.cppm 2
src/build/schedule/detach_codegen.cppm 2
src/config.cppm 1
src/home/files.cpp 1
src/modgraph/scanner.cppm 1
src/pack/distribution.cppm 2
src/pack/pack.cppm 5
src/pm/lock_io.cppm 1
src/pm/patch.cppm 1
src/project.cppm 3
src/provider/xlings/xlings.cpp 1
src/runtime/binding.cppm 4
src/runtime/elf.cppm 2
src/toolchain/base_probe.cppm 4
src/toolchain/clang.cpp 2
src/toolchain/post_install.cppm 3
src/toolchain/registry.cppm 2
2 changes: 1 addition & 1 deletion .github/tools/system-names.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ haiku 0
dos 0
uefi 0
is_linux 26
is_windows 123
is_windows 122
is_macos 28
is_apple 5
is_ios 7
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ jobs:
- name: The tests wait for a time no more often than the baseline states
run: bash .github/tools/check_waits.sh

- name: Paths are resolved to their canonical form no more often than the baseline states
run: bash .github/tools/check_path_identity.sh

- name: Only the adapter and the composition root name the provider
run: python3 .github/tools/check_provider_boundary.py

Expand Down
131 changes: 131 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,137 @@
> Each `## [<version>]` section is that release's notes. Entries are written in English
> from 2026.9.28.3 on; earlier entries remain as written.

## [2026.11.27.1] - 2026-11-27

### Changed

- A dependency's shared library is named by its package. Its file and its SONAME take the
package's qualified name, made a file name by the function that names the package's object
directory: `compat.sdl3`'s target `sdl3` builds `libcompat_sdl3.so`, and a target named
otherwise than its package follows the package's name (`libcompat_sdl3_extra.so`). A package of
the default namespace is spelled by its bare name: a target named as its package keeps its
library's name, and one named otherwise follows the package's name (`libdep_depshared.so`). The
root package and a selected member keep their target's name, and a target that states `soname`
is loaded by the name it states. Two packages whose libraries would be loaded by one name are
refused at planning with `[soname-collision]`, naming both. Before, `compat.sdl3` and
`mcpplibs.mwrap.sdl3` both made `libsdl3.so`. A script outside mcpp that names a dependency's
shared library by its file name follows the change (docs/04, mcpp#975).
- The `PATH` of a build program, a test and the program of `mcpp run` is composed by one
function, the same on every host: the directories of the tools the graph states, then the
declared environment's `bin` when the project declares one, then the `PATH` mcpp was started
with. A build program that calls a tool the graph states by its bare name gets the stated one,
and a test finds a tool stated with `when = "run"` on Windows and macOS as on Linux. Before, a
build program's `PATH` had no stated tool, and a test's held the toolchain's environment `bin`
on Linux only (docs/23, mcpp#926).
- `mcpp add` writes the form the table already uses for the namespace: the short key in an
existing `[dependencies.<ns>]` section, else the dotted key `<ns>.<name>` in `[dependencies]`;
a package of the default namespace is a bare key. Before, it could write a
`[dependencies.<ns>]` header after dotted keys had defined that table, which TOML 1.0 and every
strict reader refuse. `mcpp remove` takes `--dev` and `--build`, as `mcpp add` does
(docs/05, mcpp#964).
- The code text of a source, its text with comments and literals blanked, has one reader, shared
by the module scanner, the build optimizations and the check of module names a package
declares. An `export module` inside a raw string literal or a comment no longer declares a
module (mcpp#963).
- The cache entry of a `path` dependency or a `path` host tool records every tree that uses it,
one file per tree under the entry's `users/`. A tree that writes or hits the entry of an edited
content withdraws itself from the entries of its earlier contents, and an entry is removed when
no tree uses it. Before, an edit in one checkout removed the entry another checkout's plan named. The
`source` record of an earlier mcpp is read as the first user and is not written, so an earlier
mcpp that shares the home removes none of the new entries (docs/09, mcpp#1025).
- The home keeps the spelling it is given: a home named through a symbolic link is used under
that name in every path mcpp opens, starts or prints, and its physical path is used only to
decide whether two paths are one object. A comparison that cannot be made is made on the
spelling and reported as degraded. A check in CI holds the physical-path calls outside the
identity function to a baseline that only shrinks (docs/25, mcpp#1024).
- `mcpp publish` normalizes every dependency table, the tables under `[target.<selector>]` and
each `[feature-deps.<feature>]` included, through one enumeration of a manifest's dependency
tables, which the loader and the manifest editor also walk. A `path` dependency of a feature is
published by its version, and so is a workspace member that lies inside the package's directory
(mcpp#962).
- The `host-module-in-dependencies` warning names the two commands that move the entry:
`mcpp remove <package>`, then `mcpp add --build <package>@<version>` (mcpp#993).
- mcpp's Windows images reserve 8 MiB of stack for the main thread, the size Linux and macOS give
it. A command nests whole builds in one process: `mcpp pack` prepares the program, a host tool
its platform names and that tool's build programs. Measured on the openkal canary, this held
about 1 MiB of frames, the whole of a PE image's default reserve.

### Added

- An `import` inside a conditional block (`#if`, `#ifdef`, ...) is read by the compiler's
dependency scan with the unit's own compile words, on GCC and on Clang (`clang-scan-deps`), and
the unit imports what the condition selects. Before, the lexical scan refused the unit. A module
declaration in a conditional block is read the same way; header units are still refused, and so
is such a unit under MSVC, which has no scan at planning (docs/04, mcpp#1026).
- `mcpp add --build` writes the dependency into `[build-dependencies]` (docs/05, mcpp#993).
- `[profile.<name>] dialect_cxxflags`, with the meaning of `[build] dialect_cxxflags` and appended
after it: it reaches every unit of the graph and the `std` module. A workspace's profile takes
it too. SPEC-004 §9 states that a profile's `cflags` and `cxxflags` reach the root package and
the selected members, and its `opt`, `debug`, `ndebug`, `dialect_cxxflags` and `ldflags` the
whole graph. An unknown key in a profile is reported (docs/04, mcpp#1025).
- Shell completion. `mcpp self completion [bash|zsh|fish|powershell]` writes into
`<home>/config/shell/` a script that passes the words before the cursor to `mcpp __complete`,
and prints the line that loads it. mcpp answers from its command tree, with the profiles,
members and dependencies of the manifest in the directory, its target rows, the installed
toolchains and the packages of the local index copies; a completion reads only what is on disk
and initializes no home. The engine is mcpplibs.cmdline 0.0.6 (docs/01, mcpp#794).
- A host tool's store entry holds, beside the executable, each shared object its link read from
its own build, and lists them; an entry without them is built again. Before, a tool that linked
a library of its graph shared failed to start from the store (docs/30, mcpp#535).
- The file a link reads for a `DT_NEEDED` is the file the loader loads. After an ELF image is
linked, the name is resolved over the image's search path and compared with the shared object
the link recorded reading (`--dependency-file`), as an object and then by content; another file
is refused with `[runtime-closure]`, naming both. A name nothing answers at load time carries
the same token. Under `MCPP_ALLOW_HOST_LIBS` a difference is inconclusive (docs/04, mcpp#537).
- An ELF shared image that asks for the static TLS block (`DF_STATIC_TLS`) with a TLS segment
larger than glibc serves an image loaded by `dlopen` (512 bytes) is reported; when its exact
`exports` say a host enters it by name, it is refused with `[static-tls-image]` (docs/04,
mcpp#907).
- A graph that supplies the C library and no C++ ABI, whose units import the `std` module, is
refused at planning with `[layer-requirement]` and two remedies, a dependency that provides
`mcpp:c++-abi` or `[build] cxx_runtime = "host-coupled"`. Before, the `std` module's precompile
failed inside the toolchain's headers (docs/22, SPEC-002 §3.11, mcpp#898).
- Before `mcpp run` and `mcpp test` execute an artefact whose `#!` line names a program that is
not on its `PATH`, a note names the program and gives the commands that install a toolchain
descriptor, with the toolchain the build used (docs/20, mcpp#621).
- A library a program finds only in the default environment's union view, for a project that
declares no environment, is reported, naming the program and the library (docs/23).
- The features of `examples/11-features` state their descriptions, and a test holds that a
package's descriptions are the same from its manifest, an inline descriptor and an installed
payload (mcpp#1018).

### Deprecated

- `reopened-dotted-table` (until 2027.3): a `[header]` that reopens a table dotted keys defined.
The two are read together and reported; the next `mcpp add` to that table writes the header's
entries as dotted keys (docs/51).
- `implicit-default-environment` (until 2027.3): for a project that declares no environment, the
default environment's union view on the run-time search path and the link's `--sysroot`, and
its `bin` on a test's `PATH` outside Windows (docs/23, docs/51).
- `unmatched-exact-export` (until 2027.3): an exact `exports` name the shared image does not
define, which was dropped from the published set without a word; it is reported (docs/04,
docs/51).

### Fixed

- A build with no edit after an edit of a module compiles nothing under clang. clang names every
BMI an importer read by the absolute path it finds it through (`-fprebuilt-module-path`), and the
graph names the BMI below the build directory; ninja held the two spellings as two files, so the
importer of an importer whose BMI an edit changed was compiled by the next build, which had no
edit. The edge that writes a BMI now states the absolute spelling as an implicit output too
(SPEC-018 §1 item 6, mcpp#1015).
- `examples/11-features/greeter` stated `opt_level` in a profile, which is no profile key, and
the profile built without it; it states `opt`.
- A build after a failed build that stated `MCPP_PRIVATE_FRAGMENT`, `MCPP_BMI_SCHEDULE` or
`MCPP_BUILDOPT` is the build before it. In 2026.11.26.1 the statement was part of the record of
a build, which a build writes when it succeeds: a build that stated one and failed left its
graph under the record of the build before, and a plain build then replayed that graph and
failed the same way until a source or the manifest was edited. On GCC that is the invocation a
failure's `tip:` gives (`MCPP_PRIVATE_FRAGMENT=conservative mcpp build`), which fails where the
purview before the fragment holds a condition. The statement is now part of the request the
graph itself names (`request=` on the first line of `build.ninja`), which every fast path
compares before replaying it (SPEC-019 §9 item 5).

## [2026.11.26.1] - 2026-11-26

### Changed
Expand Down
26 changes: 26 additions & 0 deletions docs/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ mcpp --version
> rather than using `source`, and verify the active command with
> `Get-Command mcpp.exe`.

### Shell completion (2026.11.27.1+)

`mcpp self completion` writes the completion script of a shell -- `bash`,
`zsh`, `fish` or `powershell`, named as the argument, taken from `SHELL`, or
`powershell` where `SHELL` is unset and `PSModulePath` is set -- into
`<home>/config/shell/`, and prints the line that loads it. That line goes
into the shell's own configuration, which mcpp does not edit:

```
$ mcpp self completion bash
Wrote /home/user/.mcpp/config/shell/mcpp.bash
source '/home/user/.mcpp/config/shell/mcpp.bash' # in ~/.bashrc
```

The script holds no command of mcpp's: it passes the words before the cursor to
`mcpp __complete`, and mcpp answers from its own command tree, so a later
release that adds a command or an option completes it with the same script.
Beside subcommands and options, the answer holds the profiles and members of
the manifest in the current directory, the dependencies `mcpp remove` takes,
the targets mcpp has rows for, the toolchains installed in the home
(`gcc@16.1.0`) and the packages of the local index copies, each spelled as a
dependency key spells it: a package of the default namespace by its bare name,
and by its qualified name once the word begins with `mcpplibs.`. A completion
reads only what is on disk: it initializes no home, writes nothing and fetches
nothing. `--print` writes the script to standard output instead of the home.

## Creating a Project

```bash
Expand Down
Loading
Loading