{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/2805","repository_url":"https://api.github.com/repos/commercialhaskell/stack","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2805/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2805/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2805/events","html_url":"https://github.com/commercialhaskell/stack/issues/2805","id":191446796,"number":2805,"title":"RFC: A new script command","user":{"login":"snoyberg","id":49415,"avatar_url":"https://avatars.githubusercontent.com/u/49415?v=3","gravatar_id":"","url":"https://api.github.com/users/snoyberg","html_url":"https://github.com/snoyberg","followers_url":"https://api.github.com/users/snoyberg/followers","following_url":"https://api.github.com/users/snoyberg/following{/other_user}","gists_url":"https://api.github.com/users/snoyberg/gists{/gist_id}","starred_url":"https://api.github.com/users/snoyberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoyberg/subscriptions","organizations_url":"https://api.github.com/users/snoyberg/orgs","repos_url":"https://api.github.com/users/snoyberg/repos","events_url":"https://api.github.com/users/snoyberg/events{/privacy}","received_events_url":"https://api.github.com/users/snoyberg/received_events","type":"User","site_admin":false},"labels":[{"id":290124828,"url":"https://api.github.com/repos/commercialhaskell/stack/labels/component:%20script%20interpreter","name":"component: script interpreter","color":"bfdadc","default":false},{"id":222272034,"url":"https://api.github.com/repos/commercialhaskell/stack/labels/type:%20discuss","name":"type: discuss","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/commercialhaskell/stack/milestones/1","html_url":"https://github.com/commercialhaskell/stack/milestone/1","labels_url":"https://api.github.com/repos/commercialhaskell/stack/milestones/1/labels","id":1111900,"number":1,"title":"P3: Optional","description":"Arbitrary date chosen, just to get the milestones to order nicely","creator":{"login":"snoyberg","id":49415,"avatar_url":"https://avatars.githubusercontent.com/u/49415?v=3","gravatar_id":"","url":"https://api.github.com/users/snoyberg","html_url":"https://github.com/snoyberg","followers_url":"https://api.github.com/users/snoyberg/followers","following_url":"https://api.github.com/users/snoyberg/following{/other_user}","gists_url":"https://api.github.com/users/snoyberg/gists{/gist_id}","starred_url":"https://api.github.com/users/snoyberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoyberg/subscriptions","organizations_url":"https://api.github.com/users/snoyberg/orgs","repos_url":"https://api.github.com/users/snoyberg/repos","events_url":"https://api.github.com/users/snoyberg/events{/privacy}","received_events_url":"https://api.github.com/users/snoyberg/received_events","type":"User","site_admin":false},"open_issues":199,"closed_issues":136,"state":"open","created_at":"2015-05-15T10:03:10Z","updated_at":"2017-02-01T15:50:01Z","due_on":"2017-01-31T08:00:00Z","closed_at":null},"comments":34,"created_at":"2016-11-24T07:02:08Z","updated_at":"2017-02-01T22:15:03Z","closed_at":null,"body":"I've discussed this in some part with various people, so I thought I'd get the thoughts down in writing. Currently, script interpreter usage of Stack has (IMO) three limitations:\r\n\r\n* It's slower than just using `runghc` directly. Some of that is inherent: it needs to check for the presence of GHC and libraries, for example, which `runghc` does not. Nonetheless, there is more overhead than necessary. From my understanding, settings file checking is a significant component of this (and also likely something we don't want to impact the behavior of script usage).\r\n* Scripts violate some reproducibility rules, because:\r\n  * They don't require that a `resolver` be set\r\n  * They don't require that all packages be listed\r\n  * They can be impacted by other packages installed\r\n\r\n  These trade-offs all make sense when considering the `runghc` feature in general, but are less appetizing when applied to reproducible scripts.\r\n* There are multiple options that should almost always be set but aren't enforced: `--install-ghc`, a `--resolver` as implied above.\r\n\r\nProposal: let's add a new Stack command: `stack script`. It would have the following semantics:\r\n\r\n* Require that a `--resolver` be set\r\n* Hide all packages from the package database except those specified with `--package`. (Perhaps make an exception for wired in packages, or at the very least `base`.)\r\n* Automatically imply `--install-ghc`\r\n* Ignore all settings files\r\n\r\nAs an alternative (or addition) to the above, we could consider:\r\n\r\n* Making these behaviors options available to `runghc` (e.g., `--no-parse-settings-file`)\r\n* Don't actually add a `script` command, but add support to the script interpreter bits of Stack to recognize a `script` command and do the right thing."},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/276800413","html_url":"https://github.com/commercialhaskell/stack/issues/2805#issuecomment-276800413","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2805","id":276800413,"user":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"created_at":"2017-02-01T22:15:03Z","updated_at":"2017-02-01T22:15:03Z","body":"Explicit version yes.  The `--package` flag used by exec / runghc does not yet support github commits."}}
{"actor":{"display_login":"mgsloan"}}