-
Notifications
You must be signed in to change notification settings - Fork 5
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
cabal-gild-1.3.2
breaks discover src
#89
Comments
I can't make it work at all with newer |
Perhaps something changed to be sensitive to the working directory? |
Hmm, it works as expected for me with both 1.3.2.0 and 1.4.0.0. I did change how discovery works behind the scenes, but if you're not passing Here's an example showing it working: # cat example.cabal
-- cabal-gild: discover src
exposed-modules: whatever
# find . -type f
./example.cabal
./src/M.hs
./src/N.hs
# cabal-gild --version
1.4.0.0
# cabal-gild -i example.cabal
-- cabal-gild: discover src
exposed-modules:
M
N It also works when called from another directory: # cabal-gild -i gh-89/example.cabal
-- cabal-gild: discover src
exposed-modules:
M
N And when using # cabal-gild --stdin example.cabal < example.cabal
-- cabal-gild: discover src
exposed-modules:
M
N And with # cabal-gild --stdin gh-89/example.cabal < gh-89/example.cabal
-- cabal-gild: discover src
exposed-modules:
M
N |
It looks like your test failed on Ubuntu but succeeded on Windows: https://github.com/haskell/haskell-language-server/actions/runs/9594229151/job/26456359466#step:34:42 I'm not sure what to make of that. Maybe some directory or file casing is weird somewhere? |
@michaelpj can you provide more detail here? I wasn't able to reproduce this problem. |
Sorry , I'm on holiday at the moment, but this is on my list to get back to. Possibly @fendor is also interested? |
I can reproduce on linux:
Does this help? The absolute path to |
Ah, that's the ticket! Thank you! If you pass an absolute path to either # find . -type f
./example.cabal
./M.hs
# cat example.cabal
-- cabal-gild: discover .
exposed-modules: whatever
# cabal-gild --version
1.3.2.0
# cabal-gild --input example.cabal
-- cabal-gild: discover .
exposed-modules: M
# cabal-gild --input $PWD/example.cabal
-- cabal-gild: discover .
exposed-modules: |
Ah, I think I've found the problem:
Gild always searches from the current directory. The I think this can be fixed by using |
I would also be trivial to pass in the relative location in HLS if you think this is a user error on the HLS side. |
I think it's reasonable to expect that tools like this should work the same with relative and absolute paths, even if humans are more likely to use relative ones. |
I agree. It's a bug that Gild's discovery doesn't work with absolute paths. |
Should be fixed in 1.4.0.1! Let me know if you want a backport to 1.3.x. |
Not sure what's going on, but an index-state bump allowed HLS to pull in newer
cabal-gild
, which broke our tests. I manually tracked it down tocabal-gild-1.3.2
, so I guess #84.Here's what we have in the failing test, I don't know why this would have started failing now? https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-gild-plugin/test/testdata/commented_testdata.cabal#L8
The text was updated successfully, but these errors were encountered: