diff --git a/tools/ci/tmp_path_check.py b/tools/ci/tmp_path_check.py index ef8ab4fc7..f7f6d6cbf 100644 --- a/tools/ci/tmp_path_check.py +++ b/tools/ci/tmp_path_check.py @@ -46,7 +46,12 @@ # anchor is "not the tail of another path": `(?`, `=`, a quote or nothing at all. A trailing quote # is included when present so the baseline names the literal as a reader finds it. -LITERAL = re.compile(r"""(? None: check(all('"' not in s and "'" not in s for s in bare.get("tools/bare.sh", [])), "and the bare form is recorded without a quote it never had") + # engine#2027 review: `/dev/shm` is the other RAM path the directive names, so it is the same site rule -- and + # the anchor has to keep `/var/dev/shm` out for the same reason it keeps `/var/tmp` out. + (root / "npu" / "forward" / "shm.cpp").write_text( + 'void h() { open("/dev/shm/buf.bin"); }\nconst char* o2 = "/var/dev/shm/not_ours.bin";\n', + encoding="utf-8", + ) + shm = scan(root) + check(shm.get("npu/forward/shm.cpp") == ["/dev/shm/buf.bin"], + "a /dev/shm literal is a site too, and /var/dev/shm is not") + (root / "npu" / "forward" / "shm.cpp").unlink() + # The ratchet: a new site fails, a stale baseline line fails, and an unchanged tree passes. write_baseline(root / "tools" / "ci" / "tmp_paths.txt", found) base = read_baseline(root / "tools" / "ci" / "tmp_paths.txt")