Skip to content

Commit

Permalink
auto clean cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tigercosmos committed Jan 18, 2018
1 parent 1f6a864 commit ebf8348
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
3 changes: 3 additions & 0 deletions appveyor.yml
Expand Up @@ -59,6 +59,9 @@ install:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

build_script:
- set CARGO_HOME=C:\Users\appveyor\.cargo
- mach clean-nightlies --keep 2 --force
- mach clean-cargo-cache --keep 2 --force
- mach build -d -v
- mach test-unit

Expand Down
21 changes: 21 additions & 0 deletions etc/ci/buildbot_steps.yml
Expand Up @@ -4,6 +4,7 @@ env:

mac-rel-wpt1:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach run -r -o output.png
- ./mach test-wpt-failure
Expand All @@ -15,19 +16,22 @@ mac-rel-wpt1:

mac-rel-wpt2:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 2 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build-geckolib --release

mac-rel-wpt3:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 3 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default

mac-rel-wpt4:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 4 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default
Expand All @@ -36,6 +40,7 @@ mac-rel-wpt4:

mac-dev-unit:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --dev
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach test-unit
- ./mach package --dev
Expand All @@ -46,6 +51,7 @@ mac-dev-unit:

mac-rel-css1:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 5 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default
Expand All @@ -54,34 +60,40 @@ mac-rel-css1:

mac-rel-css2:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 6 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default

mac-nightly:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./mach package --release
- ./mach upload-nightly mac

linux-rel-intermittent:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env CC=gcc-5 CXX=g++-5 ./mach build --release
- ./etc/ci/check_intermittents.sh --log-raw intermittents.log

linux-rel-nogate:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env CC=gcc-5 CXX=g++-5 ./mach build --release
- python ./etc/ci/chaos_monkey_test.py
- env CC=gcc-5 CXX=g++-5 RUSTFLAGS= bash ./etc/ci/mutation_test.sh

mac-rel-intermittent:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig ./mach build --release
- ./etc/ci/check_intermittents.sh --log-raw intermittents.log

linux-dev:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- ./mach test-tidy --no-progress --all
- ./mach test-tidy --no-progress --self-test
- env CC=gcc-5 CXX=g++-5 ./mach build --dev
Expand All @@ -97,6 +109,7 @@ linux-dev:

linux-rel-wpt:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env CC=gcc-5 CXX=g++-5 ./mach build --release --with-debug-assertions
- ./mach test-wpt-failure
- ./mach test-wpt --release --processes 24 --total-chunks 2 --this-chunk 1 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
Expand All @@ -105,6 +118,7 @@ linux-rel-wpt:

linux-rel-css:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env CC=gcc-5 CXX=g++-5 ./mach build --release --with-debug-assertions
- ./mach test-wpt --release --processes 24 --total-chunks 2 --this-chunk 2 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default
Expand All @@ -115,6 +129,7 @@ linux-rel-css:

linux-nightly:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env CC=gcc-5 CXX=g++-5 ./mach build --release
- ./mach package --release
- ./mach upload-nightly linux
Expand All @@ -124,6 +139,7 @@ linux-nightly:

android:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach build --android --dev
- env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach package --android --dev
- bash ./etc/ci/lockfile_changed.sh
Expand All @@ -132,23 +148,27 @@ android:

android-nightly:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach build --android --release
- env ANDROID_SDK=/home/servo/android/sdk/r25.2.3 ./mach package --android --release
- ./mach upload-nightly android

arm32:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- ./mach build --rel --target=arm-unknown-linux-gnueabihf
- bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh

arm64:
- ./mach clean-nightlies --keep 3 --force
- ./mach clean-cargo-cache --keep 3 --force
- ./mach build --rel --target=aarch64-unknown-linux-gnu
- bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh

windows-msvc-dev:
- mach.bat clean-cargo-cache --keep 3 --force
- mach.bat clean-nightlies --keep 3 --force
- mach.bat build --dev
- mach.bat test-unit
Expand All @@ -157,6 +177,7 @@ windows-msvc-dev:
- mach.bat test-stylo

windows-msvc-nightly:
- mach.bat clean-cargo-cache --keep 3 --force
- mach.bat clean-nightlies --keep 3 --force
- mach.bat build --release
- mach.bat package --release
Expand Down
12 changes: 6 additions & 6 deletions python/servo/bootstrap_commands.py
Expand Up @@ -169,10 +169,7 @@ def clean_nightlies(self, force=False, keep=None):
@CommandArgument('--keep',
default='1',
help='Keep up to this many most recent dependencies')
@CommandArgument('--custom-path', '-c',
action='store_true',
help='Get Cargo path from CARGO_HOME environment variable')
def clean_cargo_cache(self, force=False, show_size=False, keep=None, custom_path=False):
def clean_cargo_cache(self, force=False, show_size=False, keep=None):
def get_size(path):
if os.path.isfile(path):
return os.path.getsize(path) / (1024 * 1024.0)
Expand All @@ -189,7 +186,7 @@ def get_size(path):
'git': {},
}
import toml
if os.environ.get("CARGO_HOME", "") and custom_path:
if os.environ.get("CARGO_HOME", ""):
cargo_dir = os.environ.get("CARGO_HOME")
else:
cargo_dir = path.join(self.context.topdir, ".cargo")
Expand Down Expand Up @@ -317,7 +314,10 @@ def get_size(path):
print("Removing `{}`{} package from {}".format(*print_msg))
for crate_path in crate_paths:
if os.path.exists(crate_path):
delete(crate_path)
try:
delete(crate_path)
except:
print("Delete %s failed!" % crate_path)
else:
print("Would remove `{}`{} package from {}".format(*print_msg))

Expand Down

0 comments on commit ebf8348

Please sign in to comment.