-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Split HLS plugins into internal libraries #421
Comments
FYI that is the next step as envisioned in #164 |
Excellent. Is there a timeline on #164? I'm willing to throw some elbow grease at it if necessary. |
I am afraid that we had issues with cabal private libs in the past:
We had a private lib and we converted it to a common stanza to avoid those problems: #136. For the hlint plugin that must live in its own lib to being even buildable (due to ghc-lib) we opted to create a subpackage, with its own |
I would separate plugins one by one in their own subpackages, if we consider that it would give us something in return. |
@jneira how do you suggest I move forward in that case? |
Well, as first step i would move the tactic plugin in its own subpackage (hls-tactic-plugin?) cause it will improve its development process and the extra maintaining effort would worth it for sure. |
@jneira part of the context is refactoring the build etc process to enable testing of subcomponents. Will this do that? |
Mmm, good question, i supposed the advantages of having a private lib are the same as having a subpackage. The plugin could have its own (unit?) test suite or a hls test suite could have the plugin as dependency. |
We tried using an internal library but as anticipated, none of the tooling could handle it. @TOTBWF and I are running into some extremely subtle bugs in tactics right now that don't show up outside of HLS. Being unable to write tests is extremely painful --- how can we move forward on this issue? |
@isovector could split the plugin in its own subpackage as commented above help? It is an almost mechanic change |
I am in favour of splitting them into sub-packages. I think this will help with future work, too, e.g. when we have compile-time plugin composition. |
Of late I have been spending time reading/understanding
I may be off the mark with these questions. But, answers to these questions could help me understand the current and future architecture better. Thanks |
I made some progress today on what splitting |
@gdevanla there is a subpackage
|
@isovector When What do you miss from the hls tests infrastructure, |
@jneira that's an unfortunate state of affairs. We'd like to run gold tests in our separate package --- they're really and truly tests of the plugin, not the integration. I copied and pasted the test infrastructure into the package, but it fails being unable to find the |
mmm not sure if i am understanding it correctly: if we are using the hls executable to run functional test we are testing the integration of the plugin and the executable even if that integration is trivial. But i get you really want to have those tests close to the plugin and no in hls (imho they could live in hls too, if the plugin is a subpackage in the same project than hls) Note that although use private libraries would fit that concrete use case, the goal is plugins (even private ones) could live (and be tested) outside hls. So find out a way to do functional tests would be necessary for sure. I can think off in some paths:
We always could let the funcional tests live in hls, at least temporary, while we find out a final solution. |
Corrections:
|
@jneira yeah, that sums it up I think. We'd like to split |
In my view we should not put test infra into Would it make sense to be able to run a plugin's tests in some sort of composable way, so have a slimmed down Main,hs that only calls in the plugin, and runs the functional tests against that. This part would ideally run via some sort of exposed part of hls. This might mean that a plugin in its own repo needs to either have a flag to fully enable the tests, or publish its tests in a separate package (which is functionally the same effect, just different admin process). |
I think the quick one is keep functional tests in hls while we dont have a definitive solution, the hls test suite could import the plugin lib if needed. It is far from ideal cause changes in the repo usually supposes add or modify tests. |
I think we close this issue and open a new one about test infra for plugins |
While working through #391, and now attempting to do followup work, I'm continually running into issues of project structure. Today, HLS consists of a small internal library providing common functionality to plugins, and then one monolithic executable providing all of the plugins.
Due to the inaccessibility of the source code in cabal executables, the only sort of testing that can be done against the HLS exe is at the integration-level. And this testing must be mediated via LSP, aggressively limiting it's usefulness for any sort of unit test of internal-facing behavior.
Instead, I'd suggest moving plugins to internal libraries which eventually get linked by the exe. This would allow for the code to be reused in tests, and improve incremental build times for everyone.
The text was updated successfully, but these errors were encountered: