Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer to help with bytecode mismatches? #41

Open
greghendershott opened this issue Sep 10, 2014 · 2 comments
Open

Offer to help with bytecode mismatches? #41

greghendershott opened this issue Sep 10, 2014 · 2 comments

Comments

@greghendershott
Copy link
Owner

When working on a project that's been compiled -- that has compiled subdir(s) created by raco make or raco setup -- eventually you can get this error:

link: module mismatch; possibly, bytecode file needs re-compile because dependencies changed

The solution is to rm -rf compiled/ or re-run raco make or raco setup. Which isn't difficult to do. But it's kind of a buzz-kill flow-breaker to need to M-x shell, cd to the right directory, issue the rm or raco command... then remember what you were focused on before this annoying distraction.

Could racket-mode notice this sort of error, and do something automatically? Maybe after a y/n prompt?

@greghendershott greghendershott changed the title Offer to help with bytecode mismatches Offer to help with bytecode mismatches? Sep 10, 2014
@greghendershott
Copy link
Owner Author

@cpitclaudel
Copy link
Contributor

Instead of going to a separate shell, I would expect users to use M-x compile and put raco make in there. We could help by setting compile-command to raco make by default:

compile-command is a variable defined in ‘compile.el’.
Its value is "make -k "

  This variable may be risky if used as a file-local variable.
  This variable is safe as a file local variable if its value
  satisfies the predicate ‘(lambda (a) (and (stringp a) (or (not (boundp (quote compilation-read-command))) compilation-read-command)))’.

Documentation:
Last shell command used to do a compilation; default for next compilation.

Sometimes it is useful for files to supply local values for this variable.
You might also use mode hooks to specify it in certain modes, like this:

    (add-hook 'c-mode-hook
       (lambda ()
     (unless (or (file-exists-p "makefile")
             (file-exists-p "Makefile"))
       (set (make-local-variable 'compile-command)
        (concat "make -k "
            (if buffer-file-name
              (shell-quote-argument
                (file-name-sans-extension buffer-file-name))))))))

You can customize this variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants