diff --git a/lib/autoproj/ops/cache.rb b/lib/autoproj/ops/cache.rb index e2e1f3c5..e2ef259c 100644 --- a/lib/autoproj/ops/cache.rb +++ b/lib/autoproj/ops/cache.rb @@ -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) @@ -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(