Reputation: 9103
I need to compile some code starting from the GHC version 7.0.4 until the most recent 8.0.2.
I know that using stack
I can do something like:
stack init --resolver lts ...
on the local project but the lts
versions don't go further than GHC 7.8.3.
How can I switch back to older version of GHC without using stack
?
Upvotes: 1
Views: 118
Reputation: 2411
Do you really need stack to build the project, i.e. stack.yaml
and stack build
?
If it is not the case and you just want multiple ghc versions, you might want to try
But keep in mind that older than 8.0.2 is not officially support but it might still working.
docker, use it to setup any version you want
travis, as previous answer suggested.
Upvotes: 0
Reputation: 48766
No, you cannot have stack use ghc 7.0.4 because it's not in their snapshot. The oldest compiler stack supports is 7.8.3.
Theoretically, stack can provide support for older compilers, but the Stackage server was announced at August, 2014 and GHC 7.0.4 was released on June, 2011. That's my educated guess of why 7.0.4 is not present.
If you want your code to have support for older compilers, I would recommend you to use a CI system like Travis. Another alternative if you are using a Ubuntu machine is to use Herber's PPA for installing the older compilers.
Upvotes: 1