Skip to content

interpreter: Don't make cached packages available that are not specified with --package #1208

Closed
@soenkehahn

Description

@soenkehahn

Consider the following script:

#!/usr/bin/env stack
-- stack --resolver lts-3.10 --install-ghc runghc

import Safe

main :: IO ()
main = do
  print $ headMay "foo"

This script depends on the package safe. It currently works without problems on my machine, but only because I already have the package safe cached for the specified snapshot. On machines where the package is not installed it fails with

Test.hs:4:8:
    Could not find module ‘Safe’
    Use -v to see a list of the files searched for.

It would be great if stack scripts would either fail or succeed independent of cache state. Then I could create stack scripts on my machine, copy them to different machines and be fairly sure that they will run.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions