Skip to content

fix: skip regular files on engine clean#613

Merged
doorgan merged 1 commit into
mainfrom
engine-clean-skip-files
Apr 24, 2026
Merged

fix: skip regular files on engine clean#613
doorgan merged 1 commit into
mainfrom
engine-clean-skip-files

Conversation

@katafrakt
Copy link
Copy Markdown
Member

This was found in a #570 , which added DETS file inside the cache directory. Then when engine clean was run, it failed because it could only handle directories.

The failure looked like this:

❯ ~/.local/bin/expert_darwin_arm64 engine clean --force
Kernel pid terminated (application_controller) ("{application_start_failure,xp_expert,{bad_return,{{'Elixir.XPExpert.Application',start,[normal,[]]},{'EXIT',{#{reason => enotdir,path => <<\"/Users/pawel.sw/Library/Caches/expert/hex.dets\">>,'__struct__' => 'Elixir.File.Error','__exception__' => true,action => <<\"list directory\">>},[{'Elixir.File','ls!',1,[{file,\"lib/file.ex\"},{line,2064}]},{'Elixir.XPExpert.Engine','-get_engine_dirs/0-fun-1-',3,[{file,\"lib/expert/engine.ex\"},{line,103}]},{'Elixir.Enum','-reduce/3-lists^foldl/2-0-',3,[{file,\"lib/enum.ex\"},{line,2520}]},{'Elixir.XPExpert.Engine',get_engine_dirs,0,[{file,\"lib/expert/engine.ex\"},{line,102}]},{'Elixir.XPExpert.Engine',clean_engines,1,[{file,\"lib/expert/engine.ex\"},{line,80}]},{'Elixir.XPExpert.Application',start,2,[{file,\"lib/expert/application.ex\"},{line,26}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,299}]}]}}}}}")

Crash dump is being written to: erl_crash.dump...done

This PR makes the clean command skip any files in the cache directory.

@katafrakt katafrakt force-pushed the engine-clean-skip-files branch from 504faaa to 9ee843a Compare April 24, 2026 07:24
This was found in a PR adding Hex intelligence, which added DETS file
inside the cache directory. Then when `engine clean` was run, it failed
because it could only handle directories.
@doorgan doorgan force-pushed the engine-clean-skip-files branch from 9ee843a to 3a74ceb Compare April 24, 2026 13:25
@doorgan doorgan merged commit ce93691 into main Apr 24, 2026
39 checks passed
@doorgan doorgan deleted the engine-clean-skip-files branch April 24, 2026 13:40
@expert-backports
Copy link
Copy Markdown

Successfully created backport PR for v0.1:

expert-backports Bot added a commit that referenced this pull request Apr 24, 2026
# Description
Backport of #613 to `v0.1`.

Co-authored-by: Paweł Świątkowski <katafrakt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants