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

Prepare for Hackage #1176

Merged
merged 5 commits into from
Jan 9, 2021
Merged

Prepare for Hackage #1176

merged 5 commits into from
Jan 9, 2021

Conversation

pepeiborra
Copy link
Collaborator

@pepeiborra pepeiborra commented Jan 9, 2021

Fixes #1175

Backport branch: https://github.com/haskell/haskell-language-server/tree/0.8.0-hackage

Tested:

[nix-shell:/tmp]$ tar xzf ~/scratch/ide/dist-newstyle/sdist/haskell-language-server-0.8.0.0.tar.gz 

[nix-shell:/tmp]$ cd haskell-language-server-0.8.0.0/

[nix-shell:/tmp/haskell-language-server-0.8.0.0]$ cabal configure && cabal build
Resolving dependencies...
Build profile: -w ghc-8.10.2 -O1
In order, the following would be built (use -v for more details):
 - brittany-0.13.1.0 (exe:brittany) (requires build)
 - fourmolu-0.3.0.0 (exe:fourmolu) (requires build)
 - ghcide-0.7.0.0 (exe:ghcide-test-preprocessor) (requires build)
 - ghcide-0.7.0.0 (exe:ghcide) (requires build)
 - haskell-language-server-0.8.0.0 (lib) (first run)
 - ghcide-0.7.0.0 (exe:ghcide-bench) (requires build)
 - haskell-language-server-0.8.0.0 (exe:haskell-language-server-wrapper) (first run)
 - haskell-language-server-0.8.0.0 (exe:haskell-language-server) (first run)
Build profile: -w ghc-8.10.2 -O1
In order, the following will be built (use -v for more details):
 - haskell-language-server-0.8.0.0 (lib) (first run)
 - haskell-language-server-0.8.0.0 (exe:haskell-language-server-wrapper) (first run)
 - haskell-language-server-0.8.0.0 (exe:haskell-language-server) (first run)
...

Copy link
Collaborator

@ndmitchell ndmitchell left a comment

Choose a reason for hiding this comment

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

Why should some plugins be manual false? My understand was that was almost always the wrong thing to do, and is just inviting a Cabal screwup?

@pepeiborra
Copy link
Collaborator Author

pepeiborra commented Jan 9, 2021

Why should some plugins be manual false? My understand was that was almost always the wrong thing to do, and is just inviting a Cabal screwup?

This is one of those occasions where the extra power afforded by manual:False is useful. We have a number of optional dependencies (the packaged plugins) some of which are not even in Hackage, so we want Cabal to figure out an install plan that leaves out all those optional dependencies that cannot be provided.

In case it's not clear, a flag with manual:False can be toggled on/off by the Cabal solver when it's searching for an install plan.

Copy link
Collaborator

@ndmitchell ndmitchell left a comment

Choose a reason for hiding this comment

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

OK - that makes sense.

@pepeiborra pepeiborra added the merge me Label to trigger pull request merge label Jan 9, 2021
@mergify mergify bot merged commit 9eb92e0 into haskell:master Jan 9, 2021
@jneira
Copy link
Member

jneira commented Jan 9, 2021

I agree with @ndmitchell that manual: false will bring problems sooner or later with the solver. We can use it as a temporary workaround to upload to hackage but imho we have to think in another solution (upload all plugins i guess) and switch them to manual as soon as possible.

The motivation of the previous flag layout was keep the build without flags equivalent to the previous one and make easy add plugins incrementally. Now generate a raw executable with no plugins and formatters needs lot of cabal flags. Even remove all formatters but the desired one needs four flags. all-plugins and all-formatters flags dont make sense anymore, so i would delete them and replace with no-default-plugins and no-default-formatters or something alike.

@pepeiborra
Copy link
Collaborator Author

I don't think that this will bring any problems with the solver.

@jneira
Copy link
Member

jneira commented Jan 9, 2021

Ok, maybe i am overlooking it but i've got bad build plans in the past due to cabal automatic resolution, tbh maybe it is not applicable to our case.
Otoh, let cabal include or remove a plugin automatically by pure technical "internal" reasons like not having a library version available (maybe simply for not doing a cabal update or having an older index-state in the cabal project) does not seem a good idea to me. Users should choose which plugins want to use and the tool should throw an error if they cant be installed.

So for me it should be temporary workaround for not having the plugins published in hackage and no something to keep forever.

@alanz
Copy link
Collaborator

alanz commented Jan 9, 2021

I think having the plugins default to false also fits in with the larger plan, of then being able to use it as a basis for building your own variant with a custom set of plugins.

Perhaps one day haskell-language-server s just a library, and we have a separate hls-exe package.

@pepeiborra
Copy link
Collaborator Author

pepeiborra commented Jan 9, 2021

Alan, that library is ghcide 0.7.0, which can already load HLS plugins - it currently only loads the ghcide plugin. HLS is the batteries included Version, giving you all plugins by default, or those which are buildable at least.

Javier, feel free to change the plugins to Manual:False when they are all in Hackage. I don't have any strong opinions about this.

@ndmitchell
Copy link
Collaborator

I'd like the "default" experience to be great - which I think means we have to default on at least one formatter, and most features.

@alanz
Copy link
Collaborator

alanz commented Jan 9, 2021

The thing is, the "default" experience is to install via the current mechanisms, which brings in the pre-built executables for various compiler versions, and has a full plugin set.

I do not feel particularly strongly about this though. The important thing is to avoid confusing people about the standard way to install hls for use, which should not be via hackage.

@ndmitchell
Copy link
Collaborator

I imagine if we start getting shipped with distributions, they will take our code from Hackage and compile it themselves, so it's likely something that will happen whether we want it or not.

@alanz
Copy link
Collaborator

alanz commented Jan 9, 2021

I imagine if we start getting shipped with distributions, they will take our code from Hackage and compile it themselves, so it's likely something that will happen whether we want it or not.

True, and I considered that as I sent my prior message. But that is a good thing, as it should be installed in a coherent way then, so should just work for users.

The problem we will have is when someone new to haskell sees this, tries to install, and wonders why it does not work as expected. And I guess the solution is to report clearly when we are not able to match compiler versions, and point the user to alternate install mechanisms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload to Hackage
4 participants