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

haskell-session-change-target unusable in cabal package with multiple library stanzas #1796

Open
noinia opened this issue Nov 20, 2022 · 1 comment · May be fixed by #1800
Open

haskell-session-change-target unusable in cabal package with multiple library stanzas #1796

noinia opened this issue Nov 20, 2022 · 1 comment · May be fixed by #1800

Comments

@noinia
Copy link

noinia commented Nov 20, 2022

I have a project in which my cabal file specifies multiple libraries (since I'm using backpack) [1]. If I try to fire up an repl I have to select the correct target using haskell-session-change-target. That works well for selecting benchmarks or testsuites, however,
for each library stanza I just get a copy of "lib:" (so "lib:hgeometry-vector" in my particular case), and unfortunately that does not allow me to actually switch to the right library.

Browsing through the source a bit, I think the culprit is the haskell-cabal-enum-targets function in haskell-cabal.el. In particular, it seems that on line 520 it is indeed creating the "lib:" instances rather than picking whatever the right session name is. While I (think) I can read enough elisp to figure out where this went wrong, I'm not really fluent enough to easily change it to do the right thing. I guess we want to keep the current behavior for the unnamed global library, but use the proper section-name (=name of the sub-library) when the section has a name).

[1] the particular package in question is https://github.com/noinia/hgeometry/tree/hgeom-1/hgeometry-vector but I don't think it should matter.

@siraben
Copy link

siraben commented Jul 17, 2023

I also get this issue frequently. However, when I select the target with haskell-session-change-target, the process still dies immediately.

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