-
Notifications
You must be signed in to change notification settings - Fork 11
RFC: Vendor JuliaSyntax to avoid compatibility issues #121
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
Conversation
|
This is now based on #122 since I'm using the module dispatch syntax for extensible ignoring of modules. That PR also removes Compat as a dependency so we should have fewer compat conflicts (though Compat.jl hasn't had a breaking change in a while so it's not as likely anyway). |
| @@ -0,0 +1 @@ | |||
| vendor/*/** linguist-vendored | |||
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 this might only "take effect" once the PR is merged, but I believe it means github will mark diffs to the vendored code as uninteresting during PR review in the future
I think this is worth it.
Fully agree. And since this is mostly used at test/development time and not at user execution time, I don't think the (rather minimal) overhead is any real concern.
I would not want to vendor Pkg; that seems like an utter nightmare. Pkg is also much more stable.
ibid
Yes, but I don't think it's necessary. I think JuliaSyntax is a little bit special here because it's just started to see uptake across the ecosystem and has had a major breaking release (0.4 -> 1.0) in the very recent past that hasn't been adopted by all the packages using it. The public interface for PrecompileTools and the stdlibs seems to be much more stable. (Commented more than I usually would since you marked this as RFC 😄 ❤️ ) |
| """ | ||
| ignore_submodules(::ModuleDispatcher{T}) where {T} = () | ||
|
|
||
| ignore_submodules(::ModuleDispatcher{ExplicitImports}) = (Vendored,) |
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.
Instead of dispatching on module (ExplicitImports), could we instead dispatch on symbols? This would allow us to keep support for older Julia versions.
ExplicitImports needs to be loaded in the same Julia session as the user package being analyzed, because it does a dynamic analysis via introspection, not purely a static analysis.
This presents some issues, because:
I have tried to avoid too many deps in ExplicitImports to reduce this issue, but we still have
Compat, AbstractTrees, JuliaSyntax, Markdown, Pkg, PrecompileTools, and TOML. Of these, all issues so far have been with JuliaSyntax. So here I propose vendoring JuliaSyntax.I've also introduced a comment syntax based on JuliaFormatter's to disable ExplicitImports, so we can tell it to not recurse into vendored code.
I setup a script
vendor/run.jlto make it easy to update versions, and added a.gitattributesto mark the code as vendored:If we like this approach we could also vendor more deps, e.g. AbstractTrees.
This is a different approach than VSCodeServer's which uses submodules since I don't know that those will work well with Pkg. That package is distributed by the language server not Pkg so it's a different scenario. My approach (literally copying the src files) should be simple and robust.
Notes: