From 7f99f14dfa145948679711195cb20ef46556ada6 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 13:58:41 +0200 Subject: [PATCH 1/8] Comment out the bundle install command in the local-build action --- src/puppetlabs/ezbake/core.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/puppetlabs/ezbake/core.clj b/src/puppetlabs/ezbake/core.clj index 7a91507b..5f9ed467 100644 --- a/src/puppetlabs/ezbake/core.clj +++ b/src/puppetlabs/ezbake/core.clj @@ -994,7 +994,7 @@ Additional uberjar dependencies: (defmethod action "local-build" [_ lein-project build-target] (action "stage" lein-project build-target) - (exec/exec "bundle" "install" "--path" ".bundle/gems" "--binstubs" ".bundle/bin" :dir staging-dir) + ;; (exec/exec "bundle" "install" "--path" ".bundle/gems" "--binstubs" ".bundle/bin" :dir staging-dir) (let [downstream-job nil rake-call ["bundle" "exec" "rake" "pl:local_build"]] (exec/lazy-sh rake-call {:dir staging-dir}))) From 1a899582426cb03c565f793b50c603e0015d4289 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 14:39:03 +0200 Subject: [PATCH 2/8] fix: debug fpm --- .../puppetlabs/lein-ezbake/template/global/controller.sh.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb b/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb index dc8c62fe..3c98baca 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb +++ b/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb @@ -154,4 +154,4 @@ else fi -ruby $PWD/ext/fpm.rb "${params[@]}" +ruby $PWD/ext/fpm.rb "${params[@]}" --debug From 529b0ce6f9a3a181cdb45b3bfc390985490bc7b6 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 14:58:23 +0200 Subject: [PATCH 3/8] feat: on debug, set debug also for fpm --- resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb index 1ee15479..a6b3255f 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb +++ b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb @@ -431,6 +431,10 @@ def patch_files(options) fpm_opts << "#{options.sources.join(' ')}" termini_opts << "#{options.termini_sources.join(' ')}" +if options.debug + fpm_opts << '--debug' +end + # FPM prepends %dir to the %files list entries if the file is a directory # https://github.com/jordansissel/fpm/blob/a996a8a404f012a4cdc95bce4b1e32b1982839e6/templates/rpm.erb#L249-L250 # This prevents us from recursively setting ownership/group on files within a directory From 97db1a336d9d6df57164f8fb13d296f9a9d64127 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 15:10:36 +0200 Subject: [PATCH 4/8] feat: add --trace option for debug mode in fpm --- resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb index a6b3255f..58b17aac 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb +++ b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb @@ -433,6 +433,7 @@ def patch_files(options) if options.debug fpm_opts << '--debug' + fpm_opts << '--trace' end # FPM prepends %dir to the %files list entries if the file is a directory From b7f6c2526cb3758881b4a185f86cde897ec24f80 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 15:28:50 +0200 Subject: [PATCH 5/8] fix: improve error handling in FPM output capture --- resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb index 58b17aac..176ca681 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb +++ b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb @@ -473,8 +473,8 @@ def patch_files(options) patch_files(options) do # fpm sends all output to stdout - out, _, stat = Open3.capture3("#{fpm_editor} fpm #{fpm_opts.join(' ')}") - fail "Error trying to run FPM for #{options.dist}!\n#{out}" unless stat.success? + out, err, stat = Open3.capture3("#{fpm_editor} fpm #{fpm_opts.join(' ')}") + fail "Error trying to run FPM for #{options.dist}!\n stderr: #{err}\n stdout: #{out}\n" unless stat.success? puts "#{out}" From 29b85d72ecc497d6d7e3abc65d766b3200b7bc28 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 15:45:08 +0200 Subject: [PATCH 6/8] fix: remove debug flags from FPM execution and improve error output --- .../lein-ezbake/template/global/controller.sh.erb | 2 +- .../puppetlabs/lein-ezbake/template/global/ext/fpm.rb | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb b/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb index 3c98baca..dc8c62fe 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb +++ b/resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb @@ -154,4 +154,4 @@ else fi -ruby $PWD/ext/fpm.rb "${params[@]}" --debug +ruby $PWD/ext/fpm.rb "${params[@]}" diff --git a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb index 176ca681..ebf9c812 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb +++ b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb @@ -431,11 +431,6 @@ def patch_files(options) fpm_opts << "#{options.sources.join(' ')}" termini_opts << "#{options.termini_sources.join(' ')}" -if options.debug - fpm_opts << '--debug' - fpm_opts << '--trace' -end - # FPM prepends %dir to the %files list entries if the file is a directory # https://github.com/jordansissel/fpm/blob/a996a8a404f012a4cdc95bce4b1e32b1982839e6/templates/rpm.erb#L249-L250 # This prevents us from recursively setting ownership/group on files within a directory @@ -487,8 +482,8 @@ def patch_files(options) end # fpm sends all output to stdout - out, _, stat = Open3.capture3("fpm #{termini_opts.join(' ')}") - fail "Error trying to run FPM for the termini for #{options.dist}!\n#{out}" unless stat.success? + out, err, stat = Open3.capture3("fpm #{termini_opts.join(' ')}") + fail "Error trying to run FPM for the termini for #{options.dist}!\n stderr: #{err}\n stdout: #{out}\n" unless stat.success? puts "#{out}" end end From abd20a3dcbba3e1ab4d53b7c03a697ad528380c1 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 15:55:25 +0200 Subject: [PATCH 7/8] fix: add debug logging to FPM execution for better output visibility --- resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb index ebf9c812..fe72140a 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb +++ b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb @@ -468,7 +468,7 @@ def patch_files(options) patch_files(options) do # fpm sends all output to stdout - out, err, stat = Open3.capture3("#{fpm_editor} fpm #{fpm_opts.join(' ')}") + out, err, stat = Open3.capture3("#{fpm_editor} fpm --debug --log debug #{fpm_opts.join(' ')}") fail "Error trying to run FPM for #{options.dist}!\n stderr: #{err}\n stdout: #{out}\n" unless stat.success? puts "#{out}" From e1393001eda75711a31221d0b024901d7965be93 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Mon, 18 Aug 2025 16:23:06 +0200 Subject: [PATCH 8/8] fix: remove debug flag from FPM execution to streamline output --- resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb index fe72140a..ebf9c812 100755 --- a/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb +++ b/resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb @@ -468,7 +468,7 @@ def patch_files(options) patch_files(options) do # fpm sends all output to stdout - out, err, stat = Open3.capture3("#{fpm_editor} fpm --debug --log debug #{fpm_opts.join(' ')}") + out, err, stat = Open3.capture3("#{fpm_editor} fpm #{fpm_opts.join(' ')}") fail "Error trying to run FPM for #{options.dist}!\n stderr: #{err}\n stdout: #{out}\n" unless stat.success? puts "#{out}"