{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/2344","repository_url":"https://api.github.com/repos/commercialhaskell/stack","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2344/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2344/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2344/events","html_url":"https://github.com/commercialhaskell/stack/issues/2344","id":164102344,"number":2344,"title":"Avoid determining the location of the global package db multiple times","user":{"login":"sjakobi","id":3664523,"avatar_url":"https://avatars.githubusercontent.com/u/3664523?v=3","gravatar_id":"","url":"https://api.github.com/users/sjakobi","html_url":"https://github.com/sjakobi","followers_url":"https://api.github.com/users/sjakobi/followers","following_url":"https://api.github.com/users/sjakobi/following{/other_user}","gists_url":"https://api.github.com/users/sjakobi/gists{/gist_id}","starred_url":"https://api.github.com/users/sjakobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjakobi/subscriptions","organizations_url":"https://api.github.com/users/sjakobi/orgs","repos_url":"https://api.github.com/users/sjakobi/repos","events_url":"https://api.github.com/users/sjakobi/events{/privacy}","received_events_url":"https://api.github.com/users/sjakobi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/type:%20performance","name":"type: performance","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-06T15:21:23Z","updated_at":"2016-07-08T03:12:39Z","closed_at":null,"body":"While executing the following script, `stack` reports twice that it's `Getting global package database location`. \r\n\r\n```\r\n#!/usr/bin/env stack\r\n-- stack --resolver lts-6.6 --install-ghc runghc -v --package turtle\r\n\r\n{-# LANGUAGE OverloadedStrings #-}\r\n\r\nimport Turtle\r\n\r\nmain = echo \"Hello World!\"\r\n```\r\n\r\n```\r\n2016-07-06 17:14:18.899948: [debug] Getting global package database location @(stack-1.1.3-IC0DPHtEqkpJskQxlgUot4:Stack.GhcPkg src/Stack/GhcPkg.hs:48:5)\r\n2016-07-06 17:14:18.900084: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack-1.1.3-IC0DPHtEqkpJskQxlgUot4:System.Process.Read src/System/Process/Read.hs:292:3)\r\n....\r\n2016-07-06 17:14:19.531831: [debug] Getting global package database location @(stack-1.1.3-IC0DPHtEqkpJskQxlgUot4:Stack.GhcPkg src/Stack/GhcPkg.hs:48:5)\r\n2016-07-06 17:14:19.531999: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack-1.1.3-IC0DPHtEqkpJskQxlgUot4:System.Process.Read src/System/Process/Read.hs:292:3)\r\n```\r\n\r\nIs that location constant for a single stack run?\r\n\r\nIf yes, the result should be cached, possibly in the `EnvConfig`. On my machine, such a call to `ghc-pkg` costs about 10 - 20 ms."},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/231265364","html_url":"https://github.com/commercialhaskell/stack/issues/2344#issuecomment-231265364","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2344","id":231265364,"user":{"login":"sjakobi","id":3664523,"avatar_url":"https://avatars.githubusercontent.com/u/3664523?v=3","gravatar_id":"","url":"https://api.github.com/users/sjakobi","html_url":"https://github.com/sjakobi","followers_url":"https://api.github.com/users/sjakobi/followers","following_url":"https://api.github.com/users/sjakobi/following{/other_user}","gists_url":"https://api.github.com/users/sjakobi/gists{/gist_id}","starred_url":"https://api.github.com/users/sjakobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjakobi/subscriptions","organizations_url":"https://api.github.com/users/sjakobi/orgs","repos_url":"https://api.github.com/users/sjakobi/repos","events_url":"https://api.github.com/users/sjakobi/events{/privacy}","received_events_url":"https://api.github.com/users/sjakobi/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T03:12:39Z","updated_at":"2016-07-08T03:12:39Z","body":"Oh, in any case this heuristic should certainly be tested with ghcjs before putting it out into the wild."}}
{"actor":{"display_login":"sjakobi"}}