-
Notifications
You must be signed in to change notification settings - Fork 4
Autocompile / melpa compatibility #4
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks. I'll look into this when I have some free time. |
finalpatch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this on Windows and it works really well. I'm not sure what's the best way to manage binary dependencies though. The compilation command wouldn't work if the required build tools and libraries are not installed on the user's system.
Consider automatically pulling the file output type from ninja -- more compatibility? Co-authored-by: finalpatch <[email protected]>
| (when (not (featurep 'ob-glsl-module)) | ||
| (ob-glsl-compile)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: does this mean this code will always attempt to compile if the module is not yet loaded, even when it's already compiled and available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in order to minimize the loading latency, we would only want to run the compilation when the dynamic module is not available (or better, check if it is out of date).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points here. Are there any well established references for automatically compiling modules? Vterm detects when its module is out of date (I haven't looked into the implementation), but doesn't do so automatically.
If lazy loading is done properly, then this may be enough. It'd help with debugging problems in compilation (eg a dependency isn't installed).
I don't know of any emacs packages with modules that automatically compile on install/load, but I haven't exactly looked too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: does this mean this code will always attempt to compile if the module is not yet loaded, even when it's already compiled and available?
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just perform a quick check of the existence of the dynamic module, or just attempt to load it, and only run the compilation when the file does not already exist or failed to load?
The following allows for loading this package via quelpa directly from .emacs as follows:
Obviously, replace
"finalpatch/ob-glsl"with"shizcow/ob-glsl"for a working example.Being able to load this package with quelpa makes it one step closer to being melpa-compatible and able to be loaded with a simple
(use-package ob-glsl).Note on cleanliness
I'm not particularly versed in writing emacs packages, so I probable made some big mistakes here. The provided changes aren't really intended as a final product, but as a push towards the eventual goal of making this package more accessible.