Skip to content

Commit

Permalink
DEBUG: trace, tempfile in home, report working dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielparks committed Sep 4, 2024
1 parent fc71c20 commit dec8ad7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/puppet/provider/rustup_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ')}")
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet_x/rustup/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/global_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit dec8ad7

Please sign in to comment.