Skip to content

DIME chooses wrong working directory #76

@cgay

Description

@cgay

If I start emacs like this:

cd dylan-emacs-support
emacs dswank/dswank.dylan

and then type M-x dime, then show directory in the DIME REPL buffer shows the current directory is dylan-emacs-support/dswank. That means when dime opens a project it's going to expect the _build directory to be in dylan-emacs-support/dswank/_build (it's in dylan-emacs-support/_build) and will fail to find compiler databases there. Various dime commands will fail.

This can be fixed in the user's emacs init file with

       (setq dime-dylan-implementations
             `((opendylan (,(concat *dylan* "/workspaces/dylan-emacs-support/_build/bin/dswank"))
                          ;; The registry setting should be found dynamically but for now
                          ;; must be set specifically for the code I'm currently working on.
                          :env (,(format "OPEN_DYLAN_USER_REGISTRIES=%s/workspaces/dylan-emacs-support/registry:%s/workspaces/opendylan/sources/registry"
                                         *dylan* *dylan*))
                          ;; Same story here...
                          :directory ,(format "%s/workspaces/dylan-emacs-support/" *dylan*))))

but that really shouldn't be necessary.

What to do?

If OPEN_DYLAN_USER_ROOT is set (rare, I suspect), use that. We'll assume that the user is also setting OPEN_DYLAN_USER_REGISTRIES in order to find project sources.

I tend to not set any OD environment variables and use Deft workspaces. For this case "_build" is always a sibling of "registry", so...

  1. When M-x dime is run search up from the current buffer's file to find a "registry" directory and make its parent the working directory of the dswank process.
  2. When swank:set-project (C-c M-p) is executed successfully, find the current project's LID file and search up from that to find "registry". To even choose a project for C-c M-p, swank:list-all-package-names must succeed, so that command also needs to find the "registry" directory if OD env vars aren't set.

Details need to be worked out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions