Skip to content
Snippets Groups Projects
Unverified Commit 88bf60d5 authored by commitay's avatar commitay Committed by GitHub
Browse files

Merge pull request #4815 from commitay/cargo-cache

rust/cargo: enable caching
parents 67152b86 11a6413f
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ module CleanupRefinement
end
def nested_cache?
directory? && %w[go_cache glide_home java_cache npm_cache gclient_cache].include?(basename.to_s)
directory? && %w[cargo_cache go_cache glide_home java_cache npm_cache gclient_cache].include?(basename.to_s)
end
def go_cache_directory?
......
......@@ -1680,6 +1680,7 @@ class Formula
HOMEBREW_PATH: nil,
_JAVA_OPTIONS: "#{ENV["_JAVA_OPTIONS"]} -Duser.home=#{HOMEBREW_CACHE}/java_cache",
GOCACHE: "#{HOMEBREW_CACHE}/go_cache",
CARGO_HOME: "#{HOMEBREW_CACHE}/cargo_cache",
}
ENV.clear_sensitive_environment!
......@@ -2034,6 +2035,7 @@ class Formula
stage_env[:_JAVA_OPTIONS] =
"#{ENV["_JAVA_OPTIONS"]} -Duser.home=#{HOMEBREW_CACHE}/java_cache"
stage_env[:GOCACHE] = "#{HOMEBREW_CACHE}/go_cache"
stage_env[:CARGO_HOME] = "#{HOMEBREW_CACHE}/cargo_cache"
stage_env[:CURL_HOME] = ENV["CURL_HOME"] || ENV["HOME"]
end
......
......@@ -225,6 +225,15 @@ describe Homebrew::Cleanup do
expect(incomplete).not_to exist
end
it "cleans up 'cargo_cache'" do
cargo_cache = (HOMEBREW_CACHE/"cargo_cache")
cargo_cache.mkpath
subject.cleanup_cache
expect(cargo_cache).not_to exist
end
it "cleans up 'go_cache'" do
go_cache = (HOMEBREW_CACHE/"go_cache")
go_cache.mkpath
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment