Skip to content
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

Internal error when trying to use gazelle_cabal and gazelle_haskell_modules together #39

Open
googleson78 opened this issue Jun 27, 2022 · 1 comment

Comments

@googleson78
Copy link
Contributor

While trying to smash gazelle_cabal and gazelle_haskell_modules together in a single gazelle invocation, I get the following golang exception:

panic: interface conversion: interface {} is gazelle_cabal.ImportData, not *gazelle_haskell_modules.HRuleImportData

goroutine 1 [running]:
github.com/tweag/gazelle_haskell_modules/gazelle_haskell_modules.(*gazelleHaskellModulesLang).Resolve(0x0, 0xc000170420, 0x400?, 0xc0006bf360?, 0xc00006e980, {0x9b8940?, 0xc000082720?}, {{0xc00015a019, 0x15}, {0x0, ...}, ...})
        external/io_tweag_gazelle_haskell_modules/gazelle_haskell_modules/lang.go:175 +0x21f
main.runFixUpdate({0xc00002a01a, 0x28}, 0x7ffcbae73675?, {0xc000132010, 0x0, 0x0})
        external/bazel_gazelle/cmd/gazelle/fix-update.go:376 +0x1356
main.run({0xc00002a01a?, 0x28?}, {0xc000132010?, 0x1?, 0x1?})
        external/bazel_gazelle/cmd/gazelle/gazelle.go:95 +0x1f3
main.main()
        external/bazel_gazelle/cmd/gazelle/gazelle.go:72 +0xdd

Adding gazelle_haskell_modules as a different target and running them in order works out fine.

Is this workflow of using a single target for both ("@io_tweag_gazelle_cabal//gazelle_cabal" and "@io_tweag_gazelle_haskell_modules//gazelle_haskell_modules" added to languages for the same target) simply not supported? If so, perhaps we should extend the README to indicate this. Additionally, it might be nice to add some better error instead of showing the internal golang exception. I guess this could be an issue for gazelle_cabal instead though.

@facundominguez
Copy link
Member

facundominguez commented Jun 27, 2022

Since gazelle_cabal generates rules that gazelle_haskell_modules needs to analyse, they are not straight-forward to run in a single gazelle invocation. I think it is good idea to say something about it in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants