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

Update demo and manual to use Stack GHC #460

Merged
merged 1 commit into from
Jun 11, 2016

Conversation

bhipple
Copy link
Contributor

@bhipple bhipple commented May 30, 2016

Since the docs recommend installing Shake with stack, a raw command to
ghc will likely fail due to missing libraries if a user tries to re-run
the Shake demo after the initial stack exec -- shake --demo cmd.

@bhipple bhipple closed this May 30, 2016
@bhipple bhipple reopened this May 30, 2016
@@ -1,3 +1,8 @@
#!/bin/sh
mkdir -p _shake
ghc --make Build.hs -rtsopts -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake/build "$@"
command -v stack >/dev/null 2>&1
if [ $? -eq 0 ]; then
Copy link
Owner

Choose a reason for hiding this comment

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

I tend to use if type stack > /dev/null 2>&1; then as the guard here. Any reason to prefer your formulation or mine? (I'm not a big shell scripter, so defer to your knowledge here!)

@ndmitchell
Copy link
Owner

Thanks! Although I slightly wonder if the guidance should be run to stack exec -- build and keep the stack bit outside of Shake? I would rather Shake didn't have to pick a side in the Cabal vs Stack thing, but maybe it's just something I can't avoid?

Since the docs recommend installing Shake with stack, a raw command to
build.sh will likely fail due to missing libraries if a user tries to re-run
the Shake demo after the initial `stack exec -- shake --demo` cmd.
@bhipple
Copy link
Contributor Author

bhipple commented May 30, 2016

That's a good point; keeping the build.sh script as simple as possible seems preferable. In my first commit I just had used Stack, since that's what the documentation suggests. Once I realized Travis was using Cabal it got uglier.

Regarding type, it'll most likely work everywhere, but Shellcheck points out that it's not POSIX standard. It is much cleaner though.

@ndmitchell
Copy link
Owner

Ah, interesting about ShellCheck - I haven't run it on that particular script for a while.

Looks good, but on Windows it doesn't work - commercialhaskell/stack#2225 - I think this is a Stack bug so we'll see what they say before going forward. If it looks like it will be difficult to solve on their side we can have different Windows/Linux instructions, but I'd rather avoid that if we can.

@ndmitchell ndmitchell merged commit 277cbc9 into ndmitchell:master Jun 11, 2016
@ndmitchell
Copy link
Owner

Stack have now fixed so stack exec build works on Windows. All merged and switched to build.bat on Windows (mostly for better symmetry with build.sh). Since the code to run build.bat is only in the dev version of Stack I'll hold of regenerating the website right now and leave it a little bit. Thanks for the patch!

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