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

Make https://get.haskellstack.org/ work on Travis/Windows #4535

Closed
ndmitchell opened this Issue Jan 23, 2019 · 9 comments

Comments

Projects
None yet
3 participants
@ndmitchell
Copy link
Contributor

ndmitchell commented Jan 23, 2019

Using Travis, you can write a .travis.yml which targets Windows. That has enough to run curl and sh. However, the script at get.ehaskellstack.org doesn't have branches for Windows. I think if they were added it should work.

@borsboom

This comment has been minimized.

Copy link
Contributor

borsboom commented Jan 23, 2019

Oh, interesting. We actually don't recommend using the get.haskellstack.org script to install Stack on CI systems, since we make no guarantees about its stability and you may end up with a newer version of stack that breaks your build when you're not expecting it.

But in principle, nothing against updating the script to support Windows when running in a bash environment.

@ndmitchell

This comment has been minimized.

Copy link
Contributor Author

ndmitchell commented Jan 24, 2019

I wrote a version that does work on Windows through Travis, https://github.com/ndmitchell/travis-check/blob/master/install-stack.sh, and a test at https://travis-ci.org/ndmitchell/travis-check/jobs/483804082#L48. Any chance of that being lifted into the main script? It's probably not going to work anywhere but on Travis - but the old one didn't work there - so it's strictly improving.

I know you don't recommend using it on CI, and I know you recommend testing a pinned version, and recommend LTS. I disagree with all of those recommendations 😄

@borsboom

This comment has been minimized.

Copy link
Contributor

borsboom commented Jan 25, 2019

I had a look at the script, and overall looks OK, but couple of questions:

  1. Does it fail somewhat gracefully (with a useful error) if you're trying it in a Windows environment that isn't supported? E.g. what does it do if it can't find 7z.

  2. It appears to install to /bin; is that the right place in this environment? No support for e.g. /usr/local/bin? It also doesn't appear to use the -d DESTDIR argument.

Can you make a PR with your changes?

@ndmitchell

This comment has been minimized.

Copy link
Contributor Author

ndmitchell commented Jan 26, 2019

  1. I don't have any idea. I'll try and get it slightly working or erroring well in those situations.
  2. On Travis, only /bin and /usr/bin are on $PATH. As a result, I'd have to have a different default -d depending on which OS you were using. Or is there a nicer way around?

Will PR against etc/scripts/get-stack.sh one we figure out what it should do around 2.

@borsboom

This comment has been minimized.

Copy link
Contributor

borsboom commented Jan 28, 2019

I do think supporting -d would be good, and it seems reasonable to have a different default -d depending on the OS. I have no idea what the best practice is for installing binaries on the PATH on Windows sh environments, so I'll leave the default to your discretion (/bin is fine with me).

@ndmitchell

This comment has been minimized.

Copy link
Contributor Author

ndmitchell commented Feb 3, 2019

Thanks, raised a PR #4555. As a bonus, I made it work on Travis, Appveyor and Azure Pipelines.

@borsboom

This comment has been minimized.

Copy link
Contributor

borsboom commented Feb 6, 2019

#4555 merged.

@borsboom borsboom closed this Feb 6, 2019

@ndmitchell

This comment has been minimized.

Copy link
Contributor Author

ndmitchell commented Feb 13, 2019

Thanks! Any chance of deploying the updated script to the https://get.haskellstack.org now? It means I could simplify my CI scripts. @borsboom

@borsboom

This comment has been minimized.

Copy link
Contributor

borsboom commented Feb 14, 2019

I've cherry-picked the changes into the stable branch. It should automatically propagate to https://get.haskellstack.org soon (let me know if it doesn't).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.