From ca61b443c5210495c3e9fbf5ea687229874ef7a4 Mon Sep 17 00:00:00 2001 From: Khai Do Date: Fri, 30 Aug 2019 11:30:08 -0700 Subject: [PATCH 1/2] Add doc about debugger setup From discussion on packer mailing list about setting up a debugger for packer: https://groups.google.com/d/msg/packer-tool/sfmZootjHBU/OhtEh3YTBwAJ --- .github/CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 97ff978d6..366e5dbf9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -292,3 +292,12 @@ make testacc TEST=./builder/amazon/ebs TESTARGS="-run TestBuilderAcc_forceDelete Acceptance tests typically require other environment variables to be set for things such as API tokens and keys. Each test should error and tell you which credentials are missing, so those are not documented here. + +#### Debugging + +Each packer plugin runs in a separate process and communicates with RCP over a +socket therefore using a debugger will not work (be complicated at least). + +But most of the Packer code is really simple and easy to follow with PACKER_LOG +turned on. If that doesn't work adding some extra debug print outs when you have +homed in on the problem is usually enough. From b442c0ad45955ffbe8f7c6ff910a4ba3bdc30bae Mon Sep 17 00:00:00 2001 From: Khai Do Date: Tue, 3 Sep 2019 09:01:00 -0700 Subject: [PATCH 2/2] add debugging info to debugging page as well --- .github/CONTRIBUTING.md | 2 +- website/source/docs/other/debugging.html.md | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 366e5dbf9..3df8f5a6b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -293,7 +293,7 @@ Acceptance tests typically require other environment variables to be set for things such as API tokens and keys. Each test should error and tell you which credentials are missing, so those are not documented here. -#### Debugging +#### Debugging Plugins Each packer plugin runs in a separate process and communicates with RCP over a socket therefore using a debugger will not work (be complicated at least). diff --git a/website/source/docs/other/debugging.html.md b/website/source/docs/other/debugging.html.md index 367e81061..c10e65da6 100644 --- a/website/source/docs/other/debugging.html.md +++ b/website/source/docs/other/debugging.html.md @@ -71,6 +71,15 @@ to force the log to always go to a specific file when logging is enabled. Note that even when `PACKER_LOG_PATH` is set, `PACKER_LOG` must be set in order for any logging to be enabled. +### Debugging Plugins + +Each packer plugin runs in a separate process and communicates with RCP over a +socket therefore using a debugger will not work (be complicated at least). + +But most of the Packer code is really simple and easy to follow with PACKER_LOG +turned on. If that doesn't work adding some extra debug print outs when you have +homed in on the problem is usually enough. + ### Debugging Packer in Powershell/Windows In Windows you can set the detailed logs environmental variable `PACKER_LOG` or