Skip to content

Stop stubbing file-exists-p in the dirconfig specs - #2191

Merged
bbatsov merged 2 commits into
masterfrom
fix/native-comp-file-exists-spies
Sep 16, 2026
Merged

bbatsov merged 2 commits into
masterfrom
fix/native-comp-file-exists-spies

Conversation

@bbatsov

@bbatsov bbatsov commented Sep 15, 2026

Copy link
Copy Markdown
Owner

An always-true file-exists-p stub makes a native-comp Emacs with a cold eln cache try to load subr trampolines it never compiled, which is how two dirconfig specs fail in distro builds. The specs now write a real .projectile, and the 2023 insert-file-contents workaround for the same stubs goes away with them.

Fixes #2100


  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the docs (when adding new project types, configuration options, commands, etc)

The dirconfig parser specs faked the file with an always-true
`file-exists-p' spy.  Under native compilation that breaks as soon as a
primitive gets redefined while the spy is active: Emacs looks for the
subr trampoline's .eln with `file-exists-p', is told it's there, and
fails to load a file that doesn't exist.  Buttercup redefines `message'
when it captures the prefix-less dirconfig warning, so on a cold eln
cache (a distro build, say) two of the specs died with
native-lisp-load-failed.

They now write a real `.projectile' into the sandbox instead.  That
also retires the 2023 workaround of keeping `insert-file-contents' out
of trampoline compilation, which existed only for these specs.  The
spec that parsed the same file twice with different comment prefixes
is split in two, since the parse is now cached against the file.
@bbatsov
bbatsov force-pushed the fix/native-comp-file-exists-spies branch from bce5932 to db8717b Compare September 16, 2026 11:54
@bbatsov
bbatsov merged commit f902073 into master Sep 16, 2026
10 checks passed
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.

Some tests are failing when native compilation is in place

1 participant