4

When developing, I want to build everything with -O0 to save time.

But when building the same package on a CI system, I want to use -O.

One option I see would be to have two different stack.yaml files differing in their ghc-options, but then I'd have to make all changes to stack.yaml in two places.

Having an alias for stack --ghc-options=-O0 doesn't work, because I want -O0 to apply only to local packages, not the snapshot, and there's no way to specify that on the command line, from what I know.

Are there any better options?

1 Answer 1

2

Actually, stack build --ghc-options=-O0 will apply -O0 to only the local packages, not to the snapshot packages. For more information, see:

https://github.com/commercialhaskell/stack/blob/master/GUIDE.md#ghc-options

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, good to know. So would this be the recommended solution for unoptimized builds?
Yes, it's exactly what I do during development.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.