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

Allow trying multiple entries in a multi cradle if the first one fails #196

Closed
michaelpj opened this issue Jun 11, 2020 · 3 comments
Closed
Labels
help wanted Extra attention is needed

Comments

@michaelpj
Copy link
Contributor

At the moment, the bare Cabal cradle can't handle components other than the main library component. We can fix this with a multi component where we have a mapping for all the paths to their appropriate components. However, it would be nice to be able to just use this for the components that the bare Cabal cradle can't find.

With @fendor 's help, I tried something like this:

cradle:
  multi:
    - path: ./.
      config:
        cradle:
          cabal:
    - path: ./.
      config:
        cradle:
          cabal:
            - path: ./mylib/test
              component: mylib:mylib-tests

However, it turns out that this will only try the first component that matches a path. So depending which one I put first, either the test component or the library component will work, and the other will give an error.

It would be nice to be able to do something like this.

@fendor
Copy link
Collaborator

fendor commented Jun 12, 2020

While I like the general idea of it, it will be a breaking change in the hie.yaml file format.

Although I would hope nobody wrote these kinds of hie.yaml files...

@fendor fendor closed this as completed Jun 12, 2020
@fendor fendor reopened this Jun 12, 2020
@fendor
Copy link
Collaborator

fendor commented Jun 12, 2020

I think this is a suitable issue for Zurihac for whoever is interested!

It should be enough to only modify the function multiCradle
https://github.com/mpickering/hie-bios/blob/master/src/HIE/Bios/Cradle.hs#L276

@jneira jneira added help wanted Extra attention is needed and removed Zurihac 2020 labels Oct 30, 2020
@fendor
Copy link
Collaborator

fendor commented Jul 20, 2021

Since cabal 3.4, this issue is obsolete. Usually cabal repl <filepath> works for every component in a cabal project (assuming build-type: Simple).

Going to close this, feel free to re-open if current situation is unsatisfying.

@fendor fendor closed this as completed Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants