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
Closed

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

ndmitchell opened this issue Jan 23, 2019 · 9 comments

Comments

@ndmitchell
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor Author

  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
Copy link
Contributor

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
Copy link
Contributor Author

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

@borsboom
Copy link
Contributor

borsboom commented Feb 6, 2019

#4555 merged.

@borsboom borsboom closed this as completed Feb 6, 2019
@ndmitchell
Copy link
Contributor Author

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
Copy link
Contributor

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
Projects
None yet
Development

No branches or pull requests

3 participants