Skip to content

fix: watch parent-directory glob inputs in build programs - #765

Merged
Sunrisepeak merged 2 commits into
mcpp-community:mainfrom
julixian:fix/parent-directory-glob-inputs
Oct 5, 2026
Merged

Sunrisepeak merged 2 commits into
mcpp-community:mainfrom
julixian:fix/parent-directory-glob-inputs

Conversation

@julixian

@julixian julixian commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Adding a file to a workspace member's sibling input directory currently leaves build.mcpp cached: rerun_if_changed_glob("../inputs/**/*.in") enumerates only the package tree and records an empty path set. A generated executable therefore keeps reporting COUNT=0 after the first sibling input appears.

Derive the fingerprint's walk root from the glob's literal directory prefix, sharing the existing source-scanner derivation through mcpp.modgraph.glob. Keep matching paths relative to the declaring package, sorted path-set hashing, output/.git exclusions and the no-directory-symlink policy. Missing input directories have the same empty-set fingerprint as directories without matches.

Add subsystem tests and an E2E covering creation of a previously missing sibling directory, additions/removals on the project fast path, content-only edits and unchanged builds. Document parent-directory inputs in both manuals.

Closes #764.

Validation

  • Built a fresh mcpp from this branch with LLVM 22.1.8 on Windows / MSVC ABI and used that executable for the following tests.
  • 882_parent_directory_glob_inputs.sh fails before the fix (appeared expected COUNT=1, got COUNT=0) and passes after it. Its tool/build caches are isolated and the installed tool payloads are shared.
  • Existing E2E 01_help_and_version.sh, 194_build_mcpp_glob_input.sh and 612_build_program_file_input_fast_path.sh pass.
  • mcpp test -p mcpp.buildmcpp: both test programs pass; the new glob suite has five passing cases and one directory-symlink case skipped because this Windows account cannot create symlinks.
  • mcpp test -p mcpp.manifest: both test programs pass.
  • Full mcpp test: 144 test programs pass, one fails in the existing Glob.EscapedSpellingIsUtf8WhateverTheName Windows code-page case. The same failure was reproduced on a clean main build at the same base commit before this change.
  • Version-pin, documentation-style, path-narrowing, module-wiring, workflow-assertion and fixture-path-hygiene checks pass; git diff --check passes.
  • Documentation structure passes after moving the Chinese README's CI badge outside its navigation table to match the English layout and correct the existing table-row mismatch.

Linux/macOS behavior and directory-symlink execution remain for CI. No changes are made to the wire protocol, toolchain selection or vcpkg itself.

CI status

The preceding revision's Windows E2E 882 failed before compilation because native Windows MCPP_HOME paths were written into TOML without normalization. The shared fixture helper now normalizes drive-absolute paths; E2E 00 covers native and mixed Windows spelling and relative-path preservation. E2E 882 passes locally with native Windows MCPP_HOME. The new CI run verifies commit 20f878ed; its results are pending.

@Sunrisepeak
Sunrisepeak merged commit acd9578 into mcpp-community:main Oct 5, 2026
51 checks passed
Sunrisepeak added a commit that referenced this pull request Oct 5, 2026
…ow-ups of #766 (#767)

mcpp run, mcpp run -q --release and the named runners now give the program the terminal. On POSIX mcpp replaces itself with the program once the build is done; on Windows the program runs in mcpp's console and process group while mcpp ignores Ctrl-C. A death by signal reaches the caller as that signal, and closing notices precede the Running line.

The follow-ups of #761, #763 and #765 recorded in #766: members and artifacts link the shared dependencies of the statics placed in their own image and not the objects of statics placed in another image; exports narrows discovered symbols on the MSVC ABI, with a warning beside source declarations and an error for an empty surface a program of the build links; auto_export is renamed windows_auto_export before its first release under SPEC-004 section 5.3; build-program glob inputs share the walk of sources globs, report unwatchable patterns, match absolute patterns and refuse patterns leaving a registry or git dependency; run_all.sh bounds each test where GNU timeout is absent.

SPEC-004 v1.11 and SPEC-009 v0.2. Closes #766.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: watch parent-directory glob inputs in build programs

2 participants