{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/4304","repository_url":"https://api.github.com/repos/haskell/cabal","labels_url":"https://api.github.com/repos/haskell/cabal/issues/4304/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/4304/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/4304/events","html_url":"https://github.com/haskell/cabal/pull/4304","id":206074435,"number":4304,"title":"implement a new-exec command","user":{"login":"dmwit","id":203613,"avatar_url":"https://avatars2.githubusercontent.com/u/203613?v=4","gravatar_id":"","url":"https://api.github.com/users/dmwit","html_url":"https://github.com/dmwit","followers_url":"https://api.github.com/users/dmwit/followers","following_url":"https://api.github.com/users/dmwit/following{/other_user}","gists_url":"https://api.github.com/users/dmwit/gists{/gist_id}","starred_url":"https://api.github.com/users/dmwit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmwit/subscriptions","organizations_url":"https://api.github.com/users/dmwit/orgs","repos_url":"https://api.github.com/users/dmwit/repos","events_url":"https://api.github.com/users/dmwit/events{/privacy}","received_events_url":"https://api.github.com/users/dmwit/received_events","type":"User","site_admin":false},"labels":[{"id":26369932,"url":"https://api.github.com/repos/haskell/cabal/labels/blocked:%20action-required","name":"blocked: action-required","color":"c5def5","default":false},{"id":300616617,"url":"https://api.github.com/repos/haskell/cabal/labels/cabal-install:%20nix-local-build","name":"cabal-install: nix-local-build","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":{"login":"fgaz","id":8182846,"avatar_url":"https://avatars0.githubusercontent.com/u/8182846?v=4","gravatar_id":"","url":"https://api.github.com/users/fgaz","html_url":"https://github.com/fgaz","followers_url":"https://api.github.com/users/fgaz/followers","following_url":"https://api.github.com/users/fgaz/following{/other_user}","gists_url":"https://api.github.com/users/fgaz/gists{/gist_id}","starred_url":"https://api.github.com/users/fgaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgaz/subscriptions","organizations_url":"https://api.github.com/users/fgaz/orgs","repos_url":"https://api.github.com/users/fgaz/repos","events_url":"https://api.github.com/users/fgaz/events{/privacy}","received_events_url":"https://api.github.com/users/fgaz/received_events","type":"User","site_admin":false},"assignees":[{"login":"fgaz","id":8182846,"avatar_url":"https://avatars0.githubusercontent.com/u/8182846?v=4","gravatar_id":"","url":"https://api.github.com/users/fgaz","html_url":"https://github.com/fgaz","followers_url":"https://api.github.com/users/fgaz/followers","following_url":"https://api.github.com/users/fgaz/following{/other_user}","gists_url":"https://api.github.com/users/fgaz/gists{/gist_id}","starred_url":"https://api.github.com/users/fgaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgaz/subscriptions","organizations_url":"https://api.github.com/users/fgaz/orgs","repos_url":"https://api.github.com/users/fgaz/repos","events_url":"https://api.github.com/users/fgaz/events{/privacy}","received_events_url":"https://api.github.com/users/fgaz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2017-02-08T02:04:25Z","updated_at":"2017-08-18T03:35:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/4304","html_url":"https://github.com/haskell/cabal/pull/4304","diff_url":"https://github.com/haskell/cabal/pull/4304.diff","patch_url":"https://github.com/haskell/cabal/pull/4304.patch"},"body":"This patch set implements a new-exec command for running compiler tools and dependency executables in an environment set up to match the set of packages cabal-install would choose for its builds. This is useful for debugging broken builds and during development for running one-off tests and build tasks by hand.\r\n\r\nThe implementation here has some oddities worth calling out:\r\n\r\n* It relies on the `GHC_ENVIRONMENT` variable to choose an appropriate subset of packages from the store. This only works with GHC 8.0.2 and later. It also doesn't interact very cleanly with ghc-pkg, but I'm having a hard time succinctly describing the exact failure mode. To be sure `cabal new-exec ghc-pkg list` does not show all and only the packages in the current dependency tree. Perhaps this could be considered a GHC bug, though, and not an issue to solve within cabal-install itself.\r\n* It uses the same strategy that `cabal exec` does for rewriting commands, namely, going via a `ProgramDb`. While testing I discovered that this leads to some strange behavior. For example, `cabal new-configure -w ghc-8.0.2` followed by `cabal new-exec ghc -- --version` will correctly report version 8.0.2 even if another `ghc` is on the `PATH`; but `cabal new-exec ghci -- --version` will not. (A similar caveat applies to `cabal configure` followed by `cabal exec ghci`.) Additionally, scripts which execute `ghc` will see whatever is on the `PATH` and not the correct compiler.\r\n\r\nI am open to suggestions for mitigating these issues."},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/323250762","html_url":"https://github.com/haskell/cabal/pull/4304#issuecomment-323250762","issue_url":"https://api.github.com/repos/haskell/cabal/issues/4304","id":323250762,"user":{"login":"dmwit","id":203613,"avatar_url":"https://avatars2.githubusercontent.com/u/203613?v=4","gravatar_id":"","url":"https://api.github.com/users/dmwit","html_url":"https://github.com/dmwit","followers_url":"https://api.github.com/users/dmwit/followers","following_url":"https://api.github.com/users/dmwit/following{/other_user}","gists_url":"https://api.github.com/users/dmwit/gists{/gist_id}","starred_url":"https://api.github.com/users/dmwit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmwit/subscriptions","organizations_url":"https://api.github.com/users/dmwit/orgs","repos_url":"https://api.github.com/users/dmwit/repos","events_url":"https://api.github.com/users/dmwit/events{/privacy}","received_events_url":"https://api.github.com/users/dmwit/received_events","type":"User","site_admin":false},"created_at":"2017-08-18T03:35:24Z","updated_at":"2017-08-18T03:35:24Z","body":"My two cents: there's a difference in intention and a difference in behavior (and these are related).\r\n\r\nnew-exec is about debugging the build process, so it is about running build-tools manually but in the \"same way\" that cabal itself would try to run them. So new-exec is about setting up the right package database for GHC, invoking alex and happy with the same extra command line options, and so forth.\r\n\r\nnew-run is about debugging the program you're building, so it is about running cabal-built programs without having to install them first. So new-run is about making sure that the program is up-to-date and that we're running the executable produced from the code we're editing.\r\n\r\nThat difference in intention motivates what I think of as the defining difference in behavior between the two: new-exec *never* builds anything, and may modify your command to be \"more like what cabal would do\" by adding command line arguments or modifying the environment it runs in, while new-run *always* makes sure the run target is up-to-date but passes through arguments and environment variables unmodified.\r\n\r\nI think those two modes of operation are sufficiently different -- and both sufficiently useful -- that it would be a shame to have either one and not the other in the new-* regime."}}
{"actor":{"display_login":"dmwit"}}