{"action":"created","issue":{"url":"https://api.github.com/repos/hashdist/hashdist/issues/360","labels_url":"https://api.github.com/repos/hashdist/hashdist/issues/360/labels{/name}","comments_url":"https://api.github.com/repos/hashdist/hashdist/issues/360/comments","events_url":"https://api.github.com/repos/hashdist/hashdist/issues/360/events","html_url":"https://github.com/hashdist/hashdist/issues/360","id":125192375,"number":360,"title":"Not the same environment for a debug and a non-debug build","user":{"login":"johannesring","id":3841655,"avatar_url":"https://avatars.githubusercontent.com/u/3841655?v=3","gravatar_id":"","url":"https://api.github.com/users/johannesring","html_url":"https://github.com/johannesring","followers_url":"https://api.github.com/users/johannesring/followers","following_url":"https://api.github.com/users/johannesring/following{/other_user}","gists_url":"https://api.github.com/users/johannesring/gists{/gist_id}","starred_url":"https://api.github.com/users/johannesring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johannesring/subscriptions","organizations_url":"https://api.github.com/users/johannesring/orgs","repos_url":"https://api.github.com/users/johannesring/repos","events_url":"https://api.github.com/users/johannesring/events{/privacy}","received_events_url":"https://api.github.com/users/johannesring/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-06T15:02:39Z","updated_at":"2016-01-07T08:13:19Z","closed_at":"2016-01-07T08:13:18Z","body":"I just noticed that the environment is different when running a standard `hit build` and when running `hit build --debug`. This is because HashDist run the following command to start the debug shell:\r\n\r\n``` console\r\n/bin/bash --noprofile --rcfile <rcfile>\r\n```\r\n\r\nThe problem with this is that it will inherit the environment from the parent process. One fix I have found is to run the same command with `env -i`, like this:\r\n\r\n``` console\r\nenv -i /bin/bash --noprofile --rcfile <rcfile>\r\n```\r\n\r\nThe `-i` option will make sure that the command is started with an empty environment. Below is the patch. I can make a pull request if this sounds okay.\r\n\r\n``` patch\r\ndiff --git a/hashdist/core/run_job.py b/hashdist/core/run_job.py\r\nindex 2361da3..20e2276 100644\r\n--- a/hashdist/core/run_job.py\r\n+++ b/hashdist/core/run_job.py\r\n@@ -679,7 +679,7 @@ class CommandTreeExecution(object):\r\n                 sys.stderr.write('  %s\\n' % args)\r\n                 sys.stderr.write('\\n')\r\n                 sys.stderr.write('When you are done, \"exit 1\" to abort build, or \"exit 0\" to continue.\\n\\n')\r\n-                proc = subprocess.Popen([self.debug_shell, '--noprofile', '--rcfile', rcfile])\r\n+                proc = subprocess.Popen(['env', '-i', self.debug_shell, '--noprofile', '--rcfile', rcfile])\r\n                 retcode = proc.wait()\r\n                 if retcode != 0:\r\n                     self.logger.error(\"Debug build manually aborted\")\r\n```"},"comment":{"url":"https://api.github.com/repos/hashdist/hashdist/issues/comments/169591766","html_url":"https://github.com/hashdist/hashdist/issues/360#issuecomment-169591766","issue_url":"https://api.github.com/repos/hashdist/hashdist/issues/360","id":169591766,"user":{"login":"johannesring","id":3841655,"avatar_url":"https://avatars.githubusercontent.com/u/3841655?v=3","gravatar_id":"","url":"https://api.github.com/users/johannesring","html_url":"https://github.com/johannesring","followers_url":"https://api.github.com/users/johannesring/followers","following_url":"https://api.github.com/users/johannesring/following{/other_user}","gists_url":"https://api.github.com/users/johannesring/gists{/gist_id}","starred_url":"https://api.github.com/users/johannesring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johannesring/subscriptions","organizations_url":"https://api.github.com/users/johannesring/orgs","repos_url":"https://api.github.com/users/johannesring/repos","events_url":"https://api.github.com/users/johannesring/events{/privacy}","received_events_url":"https://api.github.com/users/johannesring/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T08:13:18Z","updated_at":"2016-01-07T08:13:18Z","body":"Fixed in e1be790."}}