Skip to content

Commit

Permalink
TEMP: add debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
doudou committed Dec 29, 2022
1 parent ae1d312 commit 72e9136
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/autoproj/ops/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ def create_or_update_gems(keep_going: true, compile_force: false, compile: [])
# Note: this might directly copy into the cache directoy, and
# we support it later
cache_dir = File.join(@ws.prefix_dir, "gems", "vendor", "cache")
PackageManagers::BundlerManager.run_bundler(
@ws, "cache"
)
PackageManagers::BundlerManager.run_bundler(@ws, "cache")

FileUtils.mkdir_p(gems_cache_dir) unless File.exist?(gems_cache_dir)

Expand All @@ -166,14 +164,23 @@ def create_or_update_gems(keep_going: true, compile_force: false, compile: [])
failed = []
compile.each do |gem_name, artifacts: []|
Dir.glob(File.join(cache_dir, "#{gem_name}*.gem")) do |gem|
next unless /^#{gem_name}-\d/.match?(gem)
next if gem.end_with?(platform_suffix)
unless /^#{gem_name}-\d/.match?(File.basename(gem))
puts "#{gem} does not match regex #{/^#{gem_name}-\d/}"
next
end
if gem.end_with?(platform_suffix)
puts "#{gem} ends with platform_suffix"
next
end

gem_basename = File.basename(gem, ".gem")
expected_platform_gem = File.join(
real_target_dir, "#{gem_basename}#{platform_suffix}"
)
next if !compile_force && File.file?(expected_platform_gem)
if !compile_force && File.file?(expected_platform_gem)
puts "#{gem} already has a precompiled version (#{expected_platform_gem})"
next
end

begin
compile_gem(
Expand Down

0 comments on commit 72e9136

Please sign in to comment.