`M-x load-library` crashes if the build directory is deleted after installing

Open
#2,430 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active

Research direction

Start from the load-library command in lem-core/commands/other, which calls lem-core:prompt-for-library and then asdf:system-source-directory on :lem-contrib. The trace shows the search reaching Qlot's cache code (qlot/local-init/setup::find-cache, cache-stale-p) via uiop/filesystem:collect-sub*directories, so read how the build-time system registry is baked into the saved image and whether the Qlot searcher should be excluded from a dumped binary. Done means a decision on that question plus a fix or documented packaging requirement for distros.

Written by the indexing model from the issue text.

Description

ary directory, installed the resulting lem binary system-wide, and then deleted the build directory. After that, M-x load-library crashes with the following error:

Failed to find the WRITE-DATE of /path/to/build/lem/src/lem/: No such file or directory
...
10: (FILE-WRITE-DATE #P"/path/to/build/lem/src/lem/")
11: (QLOT/LOCAL-INIT/SETUP::CACHE-STALE-P #P"/path/to/build/lem/src/lem/" #S(QLOT/LOCAL-INIT/SETUP::SYSTEM-CACHE ...))
12: (QLOT/LOCAL-INIT/SETUP::FIND-CACHE #P"/path/to/build/lem/src/lem/")
13: ((LAMBDA (QLOT/LOCAL-INIT/SETUP::DIR) :IN QLOT/LOCAL-INIT/SETUP::PROJECT-SYSTEM-SEARCHER) ...)
14: (UIOP/FILESYSTEM:COLLECT-SUB*DIRECTORIES ...)
15: (QLOT/LOCAL-INIT/SETUP::PROJECT-SYSTEM-SEARCHER "lem-contrib")
...
18: (ASDF/SYSTEM-REGISTRY:SEARCH-FOR-SYSTEM-DEFINITION "lem-contrib")
...
24: (ASDF/SYSTEM:SYSTEM-SOURCE-DIRECTORY :LEM-CONTRIB)
25: (LEM-CORE:PROMPT-FOR-LIBRARY "load library: " ...)
26: ((:METHOD LEM-CORE:EXECUTE (T LEM-CORE/COMMANDS/OTHER:LOAD-LIBRARY T)) ...)

/path/to/build/lem is the directory where I built Lem. If I keep that directory after installing, there is no crash, so the installed binary needs its build directory to exist at runtime.

Is a packaged Lem expected to keep its source tree around, with contribs found there? If so, that should be documented, and distro packages need to install the tree. If not, the Qlot searcher shouldn't be in the saved image.

Dominant language
Common Lisp
Stars
3.1k
Forks
261
Avg merge
1d 6h
Merged PRs (30d)
133

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lem-project/lem

All issues in lem-project/lem

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.