From dec8ad744205cdcec552ce5d2dce5e6d79012440 Mon Sep 17 00:00:00 2001 From: Daniel Parks Date: Wed, 21 Feb 2024 08:56:10 -0800 Subject: [PATCH] DEBUG: trace, tempfile in home, report working dir. --- lib/puppet/provider/rustup_exec.rb | 9 +++++---- lib/puppet_x/rustup/util.rb | 2 +- spec/acceptance/global_spec.rb | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/puppet/provider/rustup_exec.rb b/lib/puppet/provider/rustup_exec.rb index c55ee67..d3103c1 100644 --- a/lib/puppet/provider/rustup_exec.rb +++ b/lib/puppet/provider/rustup_exec.rb @@ -132,11 +132,12 @@ def execute(command, stdin_file: nil, raise_on_failure: true) 'RUSTUP_DIST_SERVER' => resource[:dist_server], }.compact - debug do + #debug do stdin_message = stdin_file ? " and stdin_file #{stdin_file.inspect}" : '' - "Running #{command.inspect} for user #{resource[:user].inspect} with " \ - "environment #{environment.inspect}#{stdin_message}" - end + warn "!!! Running #{command.inspect} for user " \ + "#{resource[:user].inspect} in #{Dir.pwd} with environment " \ + "#{environment.inspect}#{stdin_message}" + #end if ENV['RUSTUP_TRACE'] info("as #{resource[:user]}: #{command.join(' ')}") diff --git a/lib/puppet_x/rustup/util.rb b/lib/puppet_x/rustup/util.rb index 55a7d15..2c46591 100644 --- a/lib/puppet_x/rustup/util.rb +++ b/lib/puppet_x/rustup/util.rb @@ -28,7 +28,7 @@ def self.download_into(url, output) # puts "#{file.path} will be deleted after the block ends." # end def self.download(url, basename = '') - file = Tempfile.new(basename) + file = Tempfile.new(basename, Dir.home) begin Puppet.debug { "Downloading #{url.inspect} into #{file.path.inspect}" } PuppetX::Rustup::Util.download_into(url, file) diff --git a/spec/acceptance/global_spec.rb b/spec/acceptance/global_spec.rb index 5fdb8e1..183c541 100644 --- a/spec/acceptance/global_spec.rb +++ b/spec/acceptance/global_spec.rb @@ -5,6 +5,8 @@ describe 'Global rustup management' do context 'supports out-of-order targets and toolchains with a false shell' do it do + puts "WORKING DIR: #{Dir.pwd}" + idempotent_apply(<<~'END') class { 'rustup::global': shell => '/bin/false',