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

Remove dependency on Cabal #195

Merged
merged 1 commit into from
Jul 13, 2020
Merged

Conversation

lukel97
Copy link
Collaborator

@lukel97 lukel97 commented Jul 13, 2020

Cabal as a dependency is a pretty hefty price to pay for simply getting the build architecture, which already seems to be in System.Info. Probably just accidentally copied over from when HIE used Cabal for dealing with .cabal files

@lukel97 lukel97 requested review from jneira, alanz and fendor July 13, 2020 10:07
@lukel97
Copy link
Collaborator Author

lukel97 commented Jul 13, 2020

Looks like stylish-haskell is pulling it in anyway to detect language extensions from the cabal file

@lukel97 lukel97 force-pushed the remove-cabal-dep branch from 3206a72 to b4db132 Compare July 13, 2020 10:39
@fendor
Copy link
Collaborator

fendor commented Jul 13, 2020

When I use cabal-plan why-depends exe:haskell-language-server lib:Cabal

I get the output:

askell-language-server-0.2.0.0
 [haskell-language-server-0.2.0.0:exe:"haskell-language-server"]
 ├─ ghc-check-0.5.0.1
 │  └─ ghc-paths-0.1.0.12
 │     [setup]
 │     └─ Cabal-3.0.1.0
 ├─ ghc-paths-0.1.0.12 ┄┄
 ├─ ghcide-0.2.0
 │  ├─ haskell-lsp-0.22.0.0
 │  │  ├─ haskell-lsp-types-0.22.0.0
 │  │  │  └─ lens-4.19.2
 │  │  │     ├─ bifunctors-5.5.7
 │  │  │     │  └─ comonad-5.0.6
 │  │  │     │     └─ distributive-0.6.2
 │  │  │     │        [setup]
 │  │  │     │        ├─ Cabal-3.0.1.0 ┄┄
 │  │  │     │        └─ cabal-doctest-1.0.8
 │  │  │     │           └─ Cabal-3.0.1.0 ┄┄
 │  │  │     │     [setup]
 │  │  │     │     ├─ Cabal-3.0.1.0 ┄┄
 │  │  │     │     └─ cabal-doctest-1.0.8 ┄┄
 │  │  │     ├─ comonad-5.0.6 ┄┄
 │  │  │     ├─ distributive-0.6.2 ┄┄
 │  │  │     ├─ free-5.1.3
 │  │  │     │  ├─ comonad-5.0.6 ┄┄
 │  │  │     │  ├─ distributive-0.6.2 ┄┄
 │  │  │     │  ├─ profunctors-5.5.2
 │  │  │     │  │  ├─ bifunctors-5.5.7 ┄┄
 │  │  │     │  │  ├─ comonad-5.0.6 ┄┄
 │  │  │     │  │  └─ distributive-0.6.2 ┄┄
 │  │  │     │  └─ semigroupoids-5.3.4
 │  │  │     │     ├─ bifunctors-5.5.7 ┄┄
 │  │  │     │     ├─ comonad-5.0.6 ┄┄
 │  │  │     │     └─ distributive-0.6.2 ┄┄
 │  │  │     │     [setup]
 │  │  │     │     ├─ Cabal-3.0.1.0 ┄┄
 │  │  │     │     └─ cabal-doctest-1.0.8 ┄┄
 │  │  │     ├─ kan-extensions-5.2
 │  │  │     │  ├─ adjunctions-4.4
 │  │  │     │  │  ├─ comonad-5.0.6 ┄┄
 │  │  │     │  │  ├─ distributive-0.6.2 ┄┄
 │  │  │     │  │  ├─ free-5.1.3 ┄┄
 │  │  │     │  │  ├─ profunctors-5.5.2 ┄┄
 │  │  │     │  │  └─ semigroupoids-5.3.4 ┄┄
 │  │  │     │  ├─ comonad-5.0.6 ┄┄
 │  │  │     │  ├─ distributive-0.6.2 ┄┄
 │  │  │     │  ├─ free-5.1.3 ┄┄
 │  │  │     │  ├─ invariant-0.5.3
 │  │  │     │  │  ├─ bifunctors-5.5.7 ┄┄
 │  │  │     │  │  ├─ comonad-5.0.6 ┄┄
 │  │  │     │  │  └─ profunctors-5.5.2 ┄┄
 │  │  │     │  ├─ profunctors-5.5.2 ┄┄
 │  │  │     │  └─ semigroupoids-5.3.4 ┄┄
 │  │  │     ├─ profunctors-5.5.2 ┄┄
 │  │  │     └─ semigroupoids-5.3.4 ┄┄
 │  │  │     [setup]
 │  │  │     ├─ Cabal-3.0.1.0 ┄┄
 │  │  │     └─ cabal-doctest-1.0.8 ┄┄
 │  │  └─ lens-4.19.2 ┄┄
 │  └─ haskell-lsp-types-0.22.0.0 ┄┄
 ├─ haskell-language-server-0.2.0.0
 │  ├─ Cabal-3.0.1.0 ┄┄
 │  ├─ brittany-0.12.1.1
 │  │  ├─ butcher-1.3.3.2
 │  │  │  ├─ bifunctors-5.5.7 ┄┄
 │  │  │  ├─ deque-0.4.3
 │  │  │  │  └─ strict-list-0.1.5
 │  │  │  │     └─ semigroupoids-5.3.4 ┄┄
 │  │  │  └─ free-5.1.3 ┄┄
 │  │  ├─ ghc-exactprint-0.6.2
 │  │  │  ├─ free-5.1.3 ┄┄
 │  │  │  └─ ghc-paths-0.1.0.12 ┄┄
 │  │  └─ ghc-paths-0.1.0.12 ┄┄
 │  ├─ cabal-helper-1.1.0.0
 │  │  ├─ Cabal-3.0.1.0 ┄┄
 │  │  └─ semigroupoids-5.3.4 ┄┄
 │  ├─ floskell-0.10.3
 │  │  └─ monad-dijkstra-0.1.1.2
 │  │     └─ free-5.1.3 ┄┄
 │  ├─ ghcide-0.2.0 ┄┄
 │  ├─ haskell-lsp-0.22.0.0 ┄┄
 │  ├─ lens-4.19.2 ┄┄
 │  └─ stylish-haskell-0.11.0.0
 │     └─ Cabal-3.0.1.0 ┄┄
 └─ haskell-lsp-0.22.0.0 ┄┄

I dont think it is that easy.

EDIT: I think [setup] dependencies are not important.

@lukel97
Copy link
Collaborator Author

lukel97 commented Jul 13, 2020

Yeah Setup.hs always depends on Cabal, but with the removal of cabal-helper in the near future(?) then that would leave us with just stylish-haskell as the sole user. In any case, we definitely don't need it in hls just to print a version string

# - cabal-helper-1.1.0.0
- github: DanielG/cabal-helper
commit: 79a5608778493bf32e74b54bbf1ea2729941e50f
- Cabal-3.0.2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we keep it here but remove it elsewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stackage snapshot contains to Cabal-3.2, others already contain Cabal-3.0.1, and stylish-haskell requires Cabal < 3.1

Cabal as a dependency is a pretty hefty price to pay for simply getting
the build architecture, which already seems to be in System.Info.
Probably just accidentally copied over from when HIE used Cabal for
dealing with .cabal files
@lukel97 lukel97 force-pushed the remove-cabal-dep branch from b4db132 to 993b59c Compare July 13, 2020 11:14
@lukel97
Copy link
Collaborator Author

lukel97 commented Jul 13, 2020

I just undid the stack.yaml changes, might as well get whatever's in 0.3.0.2 over 0.3.0.1 https://hackage.haskell.org/package/Cabal-3.0.2.0/changelog

@fendor
Copy link
Collaborator

fendor commented Jul 13, 2020

@bubba BTW, it will be probably be re-added once we port "Package.hs" from hie, see issue #155

@lukel97 lukel97 merged commit fd351ea into haskell:master Jul 13, 2020
pepeiborra pushed a commit that referenced this pull request Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants