Skip to content

Commit 0421d32

Browse files
committed
fix(emit): a store package's build program inputs are not watched
A store package's build program may declare inputs, and they were listed in `watch`; its files are fixed by the version its manifest and lock name, so only an editable package's declared inputs are inputs that can change. Found by running the command over lsp-mcpp, whose openkal-musl dependency declares its own mcpp.toml.
1 parent 9e31f50 commit 0421d32

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/build/build_database.cppm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,12 @@ Rendered render(std::span<const Member> members,
515515
for (auto const& g : sp.sources) watch_glob(sp.root, g);
516516
}
517517
for (auto const& g : member.testDiscover) watch_glob(member.testRoot, g);
518+
// Only an editable package's build program inputs can change: a store
519+
// package's are fixed by the version its manifest and lock name.
520+
std::set<std::filesystem::path> editableRoots;
521+
for (auto const& sp : ctx.sourcePackages) editableRoots.insert(sp.root.lexically_normal());
518522
for (auto const& declared : mcpp::build::declared_program_inputs(member.workDir)) {
523+
if (!editableRoots.contains(declared.root.lexically_normal())) continue;
519524
for (auto const& f : declared.files) watch_file(f);
520525
for (auto const& g : declared.globs) watch_glob(declared.root, g);
521526
}

0 commit comments

Comments
 (0)