-
Notifications
You must be signed in to change notification settings - Fork 63
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
Auto generating hie.yaml / better implicit configuration #122
Comments
The issue is that in order to do this you need to depend on the A better path forward would be to modify cabal/stack in order to output the correct information via a command line option which could be used to improve the implicit cradles. |
See also haskell/haskell-ide-engine#1529 |
I'm not suggesting a cabal dependency. I was suggesting we make a best effort to read the parts we care about from the cabal file. |
I am also a bit confused about this. Right now I put nearly the same
I am even wondering why this is necessary because the README says it‘s looking for a cabal project. (otoh: It‘s really no big hazzle, so I don‘t worry much about it.) |
The implicit discovery mechanism of hie-bios should be able to resolve it if there is only a single component. So, you usually need it if you have multiple components, e.g. exe and lib. |
Having something like $ cabal components
These components were found:
library:ghcide
exe:ghcide-test-preprocessor
exe:ghcide
test:ghcide-tests I don't know how much information should be provided for each component, but I was thinking of adding a command like this to Yet, this approach would require running an external command in order to get the desired information. |
@emlautarom1 Something like that is needed, there are an ongoing pr (by @fendor) to add the command |
@jneira A few questions:
I don't mean to sound pessimistic but this approach seems fragile (maybe I'm missing something). Since adding I haven't read the full spec yet, but maybe using something like the Correct me if I'm wrong, but the workflow would look like:
I'll look later into the |
@emlautarom1 sorry, i missed completely your thoughtful comment
Yeah, stringly typed programming! live the crazy unix life! 😁
hie-bios cradle includes the info about what files have to been watched, client code is the responsable to use that info to invalidate caches, triggers calls to external build tool etc
|
@jneira Alright, so if I'm understanding this correctly, then the workflow would be something like:
Absolutely, parsing plain text would be a lot faster to implement, yet I think that in the long run a more robust solution would prove to be better for maintainability. The point that worries my is 4, since now the client code on top of I understand that in the current situation this is the most pragmatic solution and I think that it can prove to be very usefull, but as someone said somewhere "nothing is more permanent than a temporary solution". Currently I'm a bit busy with school, but once I'm available I'll look into building a MVP of the |
I don‘t think that the client code needs to know what build tool is being used. I think hie-bios can pass a list of files it used to the client. The client just needs to watch them and trigger a reload on file change. It doesn‘t need to know, why it is depending on those files. |
I want to take a deeper look asap to check in which cases it works (and doesnt), checking corner cases like:
|
The next step I'm going to look at is ingratiation with hie-bios. My experience and the experience of those I have talked to is that a handwritten hie.yaml is almost always needed even in spite of hie using cabal-helper. The current version should alleviate all the config problems beginners face, it does not cover all expert use cases. |
Nice, imo it is suited to be integrated here cause to not have dependencies on the build tools is a hard requirement in hie-bios. So only left:
|
Yeah, that is needed. |
About the stack work to output build info as json (like |
For stack projects with multiple package hie currently fails since it cannot detect which Running |
@Avi-D-coder Now we are already using |
How do I enable implicit-hie-cradle to use multi-project stack? |
@domenkozar |
It seems like it should be possible in most cases to auto generate
hie.yaml
files given only cradle type. This would also remove the need forhie.yaml
most of the time.A
.hie-bios.yaml in lowest parent directory could be used to determine
stack, or
cabal, if
.stack-workxor
dist-newstylexor
hie-bios` is not detected first.We could start by looking in
*.cabal
forexecutable
,library
,test-suite
, then anymain-is
andhs-source-dirs
.Caveats:
main-is
orhs-source-dirs
in a single module. Can we duplicate the cradle with the same name, but a different path?cabal-helper
could be used, but it's a heavy dependency for such a simple task.Thoughts? I would implement this feature.
Update
implicit-hie
The text was updated successfully, but these errors were encountered: