Skip to content

Use Haskell instead of bash in the installer #253

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

Closed
wants to merge 9 commits into from

Conversation

jship
Copy link
Collaborator

@jship jship commented Jun 16, 2017

PR for Haskell-ifying the installer.

@jship
Copy link
Collaborator Author

jship commented Jun 16, 2017

Having trouble with Travis where the vim plugin install is taking way too long: https://travis-ci.org/jship/haskell-vim-now/builds/243505406?utm_source=github_status&utm_medium=notification

This doesn't happen on my local Windows box. Shooting to reproduce this on my Mac tomorrow. Potentially a problem with Turtle.shell usage (https://github.com/begriffs/haskell-vim-now/pull/253/files#diff-29ed8a7e59b022f088bb09fc93c6df99R466) on Linux. On Windows, the nullShell helper is temporarily being used due to some weird behavior where the console write position is getting changed resulting in overwritten output.

@jship
Copy link
Collaborator Author

jship commented Jun 16, 2017

Looks like https://travis-ci.org/jship/haskell-vim-now/jobs/243507578 got passed the plugin install via use of nullShell and is now chugging along in the helper binary installs.

@jship
Copy link
Collaborator Author

jship commented Jun 16, 2017

Build 9 from my fork is green when helper binary install is skipped: https://travis-ci.org/jship/haskell-vim-now/builds/243786289?utm_source=github_status&utm_medium=notification

Build 8 timed out.

The CI build for this pull request (https://travis-ci.org/begriffs/haskell-vim-now/builds/243786312?utm_source=github_status&utm_medium=notification) failed because of the existing HVN install.

HaskellVimNow.hs Outdated
deriving (Show)

defaultRepo :: Text
defaultRepo = "https://github.com/jship/haskell-vim-now.git"
Copy link
Owner

Choose a reason for hiding this comment

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

I tried rebuilding on CI without cache, but the build still fails. I think the problem is this default repo path. It has already cloned the repo from my account, and then the new path conflicts:

The source repository path [https://github.com/jship/haskell-vim-now.git] does not match the
origin repository of the existing installation [https://github.com/begriffs/haskell-vim-now.git].
Please remove the existing installation [/home/travis/.config/haskell-vim-now] and try again.

@jship
Copy link
Collaborator Author

jship commented Jun 18, 2017

Thanks - updated it to the main repo.

@begriffs
Copy link
Owner

begriffs commented Jul 2, 2017

So I've been thinking about this PR. The changes are enormous (thanks for your hard work), is there a way to maybe start more gradually, like keep the bash scripting for the majority of the installer? We could delegate to a turtle Haskell script for one of the tasks you mentioned is tricky in bash.

A little time would verify that introducing the Haskell bit is stable for everybody. Then we could start increasing the amount of Haskell. I know it's nice to switch over entirely for Windows support, but I anticipate one big rewrite as introducing a lot of moving parts that could be difficult to debug.

@jship
Copy link
Collaborator Author

jship commented Jul 7, 2017

The gradual introduction sounds very reasonable to me. A couple good candidate areas:

  1. neovim.sh
  2. The setup_haskell portion of the installer.

neovim.sh is nice because it is completely standalone. I don't have that script's code implemented in this PR but can put together an equivalent Haskell script if we choose this as the intro Haskell portion.

The setup_haskell piece would be good to reduce the time taken when installing helper binaries. The Haskell version in this PR stack installs just the helper binary packages and nothing else. The bash version stack installs just about everything returned by the stack list-dependencies which is a big time-sink. The helper binaries are stored in a plain Haskell list and that list is fed as input to a mustache template to build the dependencies cabal file. This is a lot easier to work with/filter than doing the equivalent text munging in bash. The mustache template is embedded directly in the source so that makes for one less file in the repo too.

Let me know what you think. Should we close this PR? I can open a new one with just whatever we decide on.

@begriffs
Copy link
Owner

begriffs commented Jul 8, 2017

Let's try setup_haskell since it'll be sure to be hit whenever someone runs the installer and we'll get to work out any problems that way.

I'll close this PR and you can open another just for that part.

@begriffs begriffs closed this Jul 8, 2017
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.

2 participants