Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Update shake file to be able to install via cabal new-build #1047

Closed
alanz opened this issue Jan 12, 2019 · 15 comments · Fixed by #1092
Closed

Update shake file to be able to install via cabal new-build #1047

alanz opened this issue Jan 12, 2019 · 15 comments · Fixed by #1092
Assignees
Milestone

Comments

@alanz
Copy link
Collaborator

alanz commented Jan 12, 2019

This will require passing in a flag requesting this, I presume, and also managing the symlink process, to end up with the exe names we currently have.

My reading of the options says that cabal new-install --program-suffix='-8.4.3' should do it, but this does not seem to be the case.

@alanz alanz added this to the 2019-01 milestone Jan 12, 2019
@samuelpilz
Copy link
Contributor

Is it documented somewhere how cabal-helper needs to be installed for hie to work?

@alanz
Copy link
Collaborator Author

alanz commented Jan 13, 2019

@power-fungus The install process does make sure that it is installed, if you install via the makefile / shakefile etc.

But pehaps it should be added to the documentation.

@fendor
Copy link
Collaborator

fendor commented Jan 29, 2019

Do new targets make sense?

cabal-hie-*        -- install HIE executable
cabal-build        -- install all HIE executables
cabal-build-doc    -- build docs with 'cabal new-build'
cabal-build-all    -- build all HIE executables and the docs
cabal-test         -- Execute the tests with `cabal new-test`

The new commands are consistent to the existing targets and I prefer cabal-* prefix over new-* because new-* will become the default in cabal, thus, rendering it legacy to know why it is called new-build.

@alanz
Copy link
Collaborator Author

alanz commented Jan 29, 2019

Those could work

I wonder if we could do something like

./install.hs --cabal build

i.e. just have it as a mode flag, but keep the other targets the same.

@fendor
Copy link
Collaborator

fendor commented Jan 29, 2019

Following questions:
How would that influence commands that are not affected by cabal? Eg. Submodules
Also, would the cabal target be affected?

@alanz
Copy link
Collaborator Author

alanz commented Jan 29, 2019

Never mind, go with the explicit prefix per target.

I think it is better to get the build in so they can be used, we can tweak the UI on them later, if it is a problem.

@fendor
Copy link
Collaborator

fendor commented Jan 29, 2019

Understood, then I will take a look at it in the next days.

@fendor fendor self-assigned this Jan 29, 2019
@fendor fendor added build Continuous integration and building and removed build Continuous integration and building labels Jan 29, 2019
@samuelpilz
Copy link
Contributor

samuelpilz commented Jan 30, 2019

Several issues are present:

  • How would one go about install hie for every different ghc version?
  • How are the ghcs installed?

possibilities are:

  • call cabal new-configure -w $stack-ghc before cabal new-install? This would depend on the stack-installed ghcs
  • call cabal new-configure -w $ghc if $ghc is in the path

I am in favor of re-using the ghcs that stack installed

@fendor
Copy link
Collaborator

fendor commented Jan 31, 2019

For now I decided to use the first approach, we let stack install the ghc and get the path to it.

However, should the executables installed in the same way stack executables are being installed? E.g. to $HOME/.local/bin (stack path --local-install-root) or is it fine to leave the executables in $HOME/.cabal/bin?

@alanz
Copy link
Collaborator Author

alanz commented Jan 31, 2019

Strictly speaking, there is not much point installing a hie version for a GHC version that is not currently on a user's machine.

So if I only have GHC 8.4.4 installed, the hie installer should perhaps only install hie-8.4.4.

And I was wondering if we should not do some kind of simple terminal client / CLI setup to ask what versions you want, and then persist this choice into say $HOME/.hierc to be consulted for future updates.

@alanz alanz modified the milestones: 2019-01, 2019-02 Feb 2, 2019
@fendor
Copy link
Collaborator

fendor commented Feb 11, 2019

That might be sensible, but reintroduces the problem of platform independence...

Any intermediate solution that might be desirable? I implemented a proof of concept where different ghc versions have been installed by stack.
To implement it without stack, I think we have to rely on some convention, e.g. a ghc of version 8.2.2 is named ghc-8.2.2. Would that be sensible?

@alanz
Copy link
Collaborator Author

alanz commented Feb 11, 2019

Yes, that is how it works in general, if you look in the bin directory for an installed ghc you will see it has ghc and a symlink to ghc-8.4.4 or whatever.

@fendor
Copy link
Collaborator

fendor commented Feb 11, 2019

Where do we have to look, only into $PATH or do we need to look in more places?

@alanz
Copy link
Collaborator Author

alanz commented Feb 11, 2019 via email

@fendor
Copy link
Collaborator

fendor commented Feb 13, 2019

I adapt the target cabal-build and cabal-build-docs to only install HIE for GHC versions that have been found in the path.
The target cabal-ghcs shows all found GHC installations alongside their respective path.
This already works, I am currently working on the linking. Is it alright that the different HIE versions live in ~/.cabal/bin or should they be installed in the same directory as the HIE binaries installed by stack?

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

Successfully merging a pull request may close this issue.

3 participants