mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6404b79c00 | |||
| 143fc458b4 |
+26
-68
@@ -1,84 +1,42 @@
|
|||||||
# Based on the "trust" template v0.1.2
|
|
||||||
# https://github.com/japaric/trust/tree/v0.1.2
|
|
||||||
|
|
||||||
dist: trusty
|
|
||||||
language: rust
|
|
||||||
services: docker
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
# TODO Rust builds on stable by default, this can be
|
|
||||||
# overridden on a case by case basis down below.
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# TODO Update this to match the name of your project.
|
- PROJECT_NAME=dust
|
||||||
- CRATE_NAME=dust
|
- CHANNEL=stable
|
||||||
|
|
||||||
|
language: rust
|
||||||
|
rust:
|
||||||
|
- stable
|
||||||
matrix:
|
matrix:
|
||||||
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
|
fast_finish: true
|
||||||
# don't need
|
- os: osx
|
||||||
include:
|
env: TARGET=i686-apple-darwin
|
||||||
# Linux
|
- os: linux
|
||||||
- env: TARGET=aarch64-unknown-linux-gnu
|
env: TARGET=i686-unknown-linux-gnu
|
||||||
- env: TARGET=arm-unknown-linux-gnueabi
|
- os: osx
|
||||||
- env: TARGET=armv7-unknown-linux-gnueabihf
|
env: TARGET=x86_64-apple-darwin
|
||||||
- env: TARGET=i686-unknown-linux-gnu
|
- os: linux
|
||||||
- env: TARGET=i686-unknown-linux-musl
|
env: TARGET=x86_64-unknown-linux-gnu
|
||||||
- env: TARGET=x86_64-unknown-linux-gnu
|
cache: cargo
|
||||||
- env: TARGET=x86_64-unknown-linux-musl
|
|
||||||
|
|
||||||
# OSX
|
|
||||||
- env: TARGET=i686-apple-darwin
|
|
||||||
os: osx
|
|
||||||
- env: TARGET=x86_64-apple-darwin
|
|
||||||
os: osx
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- set -e
|
- export PATH="$PATH:$HOME/.cargo/bin"
|
||||||
- rustup self update
|
|
||||||
|
|
||||||
install:
|
|
||||||
- sh ci/install.sh
|
|
||||||
- source ~/.cargo/env || true
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- bash ci/script.sh
|
- cargo build --release --target $TARGET
|
||||||
|
- cargo test --target $TARGET
|
||||||
after_script: set +e
|
|
||||||
|
|
||||||
before_deploy:
|
|
||||||
- sh ci/before_deploy.sh
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
# TODO update `api_key.secure`
|
|
||||||
# - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
|
|
||||||
# - Encrypt it: `travis encrypt 0123456789012345678901234567890123456789
|
|
||||||
# - Paste the output down here
|
|
||||||
api_key:
|
|
||||||
secure: UlU73Td7Bkb2N88ws4YGLWR+4U0IMgiou9QQtMnmpouJFjeUNxtLSPMPODVXP7zq4sKt5HR5B3fX9MW4mKm351fvnQEoihETn06pKiXGnY//SlTPTt67MX9ZOYmd9ohJReMDOZDgqhnGLxfymycGtsLAmdjDZnAl+IMqgg0FMyVFj9Cl9aKxnn12lxQyX4zabHKk8TUKD3By8ZoEUnJMHt3gEtOmbDgS4brcTPeHCzqnYFw73LEnkqvz+JP0XwauJY7Cf8lminKm/klmjCkQji8T9SHI52v1g0Fxpx0ucp2o3vulQrLHXaHvZ6Fr7J0cSXXzaFF3rrGLt4t4jU/+9TZm1+n5k5XuPW4x4NTCC9NmIj/z0/z41t82E9qZhzhtm2Jdsg6H2tNk+C774TYqcmR6GCvfRadfjRp3cA5dh0UwDVjH2MJFxlHDVkl6la0mVVRsCGF3oBKZVk0BDl1womfnmI46o/uU+gLknHN6Ed6PHHPPYDViWd3VKdmHKT7XrkMMUF6HjZUtla689DWIOWZSiV++1dVPcl/1TV+6tTmN4bBtPcLuX7SHRuLp2PI2kATvRMECsa7gZRypW4jKpVn7b2yetX9TVI3i1zR5zkQJ3dPg8sATvYPL53aKH/WsqUg4rzoAlbk9so+++R4bQY69LhV3B511B7EAynoZFdM
|
|
||||||
file_glob: true
|
|
||||||
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.*
|
|
||||||
on:
|
|
||||||
# TODO Here you can pick which targets will generate binary releases
|
|
||||||
# In this example, there are some targets that are tested using the stable
|
|
||||||
# and nightly channels. This condition makes sure there is only one release
|
|
||||||
# for such targets and that's generated using the stable channel
|
|
||||||
condition: $TRAVIS_RUST_VERSION = stable
|
|
||||||
tags: true
|
|
||||||
provider: releases
|
provider: releases
|
||||||
|
api_key:
|
||||||
|
secure: "osa6xr6VGDSKUFGPVSElFl2ItJQ0vzTuc+xcBYtEO663sFf5bsCXnBmzdNB4dSfiV1KdVXZQaN7S2rIO9GoWVY02hz8OLYWh5wDXkdQQ8hSEl9FXnSB8I1zWTB4dYsnAZPkjbkH4p+HmmlH6COH1FRKWcEtJMWbZBr0kVc3hxWQue2U5Lo0FhWgNo9oOfs8b6lvF9N/bSQaaeE0OEBVyc3iOBG+03UrcPwhuO3vUNYPkiqxdwGctYyjBEbc4OTKLPazvgFaDmiACtIM1iPIly5WXR+A/3hMxgDKlpqi9F8bO/I8C+kXpP7ZBlqkejo8MwjZ8UHXzX7uXsq/5Upp8tPDTr0ko4dDvDrQMu+mnGwsEU3T8HPGE2c1DZl858tMt/NhUjtEXJDY5Fadia3I7Th5dUGR8O3ylnXf8rkSxFcqDAJ6u9KFH2SUAR5nEU4hRSSx8KjSTadQsQGQS6Iyvf8HV0GwPPkJStEZq/ZHE1hEQHXZBREBHnjgCkjj/LItyFFMs0qZbfTUBurKokQnQElkOddpzLsfb6G6+8rV6+WNmsuqUVx04YKTfjb5X/tV0Bjgx1YOMMBhWXrRi+XO04l9fsoU8zYfb29bqEzC7Rx38/A4Bncp/eI1JqUxv7EIbpEadIVq1LrVJg54O7Kx0LA6AsCRwTdmFGdSFbz3oujI="
|
||||||
|
file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.tar.gz
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
cache: cargo
|
repo: bootandy/dust
|
||||||
before_cache:
|
tags: true
|
||||||
# Travis can't cache files that are not readable by "others"
|
|
||||||
- chmod -R a+r $HOME/.cargo
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
# release tags
|
|
||||||
- /^v\d+\.\d+\.\d+.*$/
|
|
||||||
- master
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
on_success: never
|
on_success: never
|
||||||
|
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
# Based on the "trust" template v0.1.2
|
|
||||||
# https://github.com/japaric/trust/tree/v0.1.2
|
|
||||||
|
|
||||||
environment:
|
|
||||||
global:
|
|
||||||
# TODO This is the Rust channel that build jobs will use by default but can be
|
|
||||||
# overridden on a case by case basis down below
|
|
||||||
RUST_VERSION: stable
|
|
||||||
|
|
||||||
# TODO Update this to match the name of your project.
|
|
||||||
CRATE_NAME: dust
|
|
||||||
|
|
||||||
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
|
|
||||||
# don't need
|
|
||||||
matrix:
|
|
||||||
# MinGW
|
|
||||||
- TARGET: i686-pc-windows-gnu
|
|
||||||
- TARGET: x86_64-pc-windows-gnu
|
|
||||||
|
|
||||||
# MSVC
|
|
||||||
- TARGET: i686-pc-windows-msvc
|
|
||||||
- TARGET: x86_64-pc-windows-msvc
|
|
||||||
|
|
||||||
# Testing other channels
|
|
||||||
- TARGET: x86_64-pc-windows-gnu
|
|
||||||
RUST_VERSION: nightly
|
|
||||||
- TARGET: x86_64-pc-windows-msvc
|
|
||||||
RUST_VERSION: nightly
|
|
||||||
|
|
||||||
install:
|
|
||||||
- ps: >-
|
|
||||||
If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') {
|
|
||||||
$Env:PATH += ';C:\msys64\mingw64\bin'
|
|
||||||
} ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') {
|
|
||||||
$Env:PATH += ';C:\msys64\mingw32\bin'
|
|
||||||
}
|
|
||||||
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
|
|
||||||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
|
|
||||||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
|
|
||||||
- rustc -Vv
|
|
||||||
- cargo -V
|
|
||||||
|
|
||||||
# TODO This is the "test phase", tweak it as you see fit
|
|
||||||
test_script:
|
|
||||||
# we don't run the "test phase" when doing deploys
|
|
||||||
- if [%APPVEYOR_REPO_TAG%]==[false] (
|
|
||||||
cargo build --target %TARGET% &&
|
|
||||||
cargo build --target %TARGET% --release &&
|
|
||||||
cargo test --target %TARGET% &&
|
|
||||||
cargo test --target %TARGET% --release &&
|
|
||||||
cargo run --target %TARGET% &&
|
|
||||||
cargo run --target %TARGET% --release
|
|
||||||
)
|
|
||||||
|
|
||||||
before_deploy:
|
|
||||||
# TODO Update this to build the artifacts that matter to you
|
|
||||||
- cargo rustc --target %TARGET% --release --bin hello -- -C lto
|
|
||||||
- ps: ci\before_deploy.ps1
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
artifact: /.*\.zip/
|
|
||||||
# TODO update `auth_token.secure`
|
|
||||||
# - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
|
|
||||||
# - Encrypt it. Go to https://ci.appveyor.com/tools/encrypt
|
|
||||||
# - Paste the output down here
|
|
||||||
auth_token:
|
|
||||||
secure: UlU73Td7Bkb2N88ws4YGLWR+4U0IMgiou9QQtMnmpouJFjeUNxtLSPMPODVXP7zq4sKt5HR5B3fX9MW4mKm351fvnQEoihETn06pKiXGnY//SlTPTt67MX9ZOYmd9ohJReMDOZDgqhnGLxfymycGtsLAmdjDZnAl+IMqgg0FMyVFj9Cl9aKxnn12lxQyX4zabHKk8TUKD3By8ZoEUnJMHt3gEtOmbDgS4brcTPeHCzqnYFw73LEnkqvz+JP0XwauJY7Cf8lminKm/klmjCkQji8T9SHI52v1g0Fxpx0ucp2o3vulQrLHXaHvZ6Fr7J0cSXXzaFF3rrGLt4t4jU/+9TZm1+n5k5XuPW4x4NTCC9NmIj/z0/z41t82E9qZhzhtm2Jdsg6H2tNk+C774TYqcmR6GCvfRadfjRp3cA5dh0UwDVjH2MJFxlHDVkl6la0mVVRsCGF3oBKZVk0BDl1womfnmI46o/uU+gLknHN6Ed6PHHPPYDViWd3VKdmHKT7XrkMMUF6HjZUtla689DWIOWZSiV++1dVPcl/1TV+6tTmN4bBtPcLuX7SHRuLp2PI2kATvRMECsa7gZRypW4jKpVn7b2yetX9TVI3i1zR5zkQJ3dPg8sATvYPL53aKH/WsqUg4rzoAlbk9so+++R4bQY69LhV3B511B7EAynoZFdM
|
|
||||||
description: ''
|
|
||||||
on:
|
|
||||||
# TODO Here you can pick which targets will generate binary releases
|
|
||||||
# In this example, there are some targets that are tested using the stable
|
|
||||||
# and nightly channels. This condition makes sure there is only one release
|
|
||||||
# for such targets and that's generated using the stable channel
|
|
||||||
RUST_VERSION: stable
|
|
||||||
appveyor_repo_tag: true
|
|
||||||
provider: GitHub
|
|
||||||
|
|
||||||
cache:
|
|
||||||
- C:\Users\appveyor\.cargo\registry
|
|
||||||
- target
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
# Release tags
|
|
||||||
- /^v\d+\.\d+\.\d+.*$/
|
|
||||||
- master
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
- provider: Email
|
|
||||||
on_build_success: false
|
|
||||||
|
|
||||||
# Building is done in the test phase, so we disable Appveyor's build phase.
|
|
||||||
build: false
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# This script takes care of packaging the build artifacts that will go in the
|
|
||||||
# release zipfile
|
|
||||||
|
|
||||||
$SRC_DIR = $PWD.Path
|
|
||||||
$STAGE = [System.Guid]::NewGuid().ToString()
|
|
||||||
|
|
||||||
Set-Location $ENV:Temp
|
|
||||||
New-Item -Type Directory -Name $STAGE
|
|
||||||
Set-Location $STAGE
|
|
||||||
|
|
||||||
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
|
|
||||||
|
|
||||||
# TODO Update this to package the right artifacts
|
|
||||||
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\dust" '.\'
|
|
||||||
|
|
||||||
7z a "$ZIP" *
|
|
||||||
|
|
||||||
Push-AppveyorArtifact "$ZIP"
|
|
||||||
|
|
||||||
Remove-Item *.* -Force
|
|
||||||
Set-Location ..
|
|
||||||
Remove-Item $STAGE
|
|
||||||
Set-Location $SRC_DIR
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
# This script takes care of building your crate and packaging it for release
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
main() {
|
|
||||||
local src=$(pwd) \
|
|
||||||
stage=
|
|
||||||
|
|
||||||
case $TRAVIS_OS_NAME in
|
|
||||||
linux)
|
|
||||||
stage=$(mktemp -d)
|
|
||||||
;;
|
|
||||||
osx)
|
|
||||||
stage=$(mktemp -d -t tmp)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
test -f Cargo.lock || cargo generate-lockfile
|
|
||||||
|
|
||||||
# TODO Update this to build the artifacts that matter to you
|
|
||||||
cross rustc --bin dust --target $TARGET --release -- -C lto
|
|
||||||
|
|
||||||
# TODO Update this to package the right artifacts
|
|
||||||
cp target/$TARGET/release/dust $stage/
|
|
||||||
|
|
||||||
cd $stage
|
|
||||||
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
|
|
||||||
cd $src
|
|
||||||
|
|
||||||
rm -rf $stage
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
set -ex
|
|
||||||
|
|
||||||
main() {
|
|
||||||
local target=
|
|
||||||
if [ $TRAVIS_OS_NAME = linux ]; then
|
|
||||||
target=x86_64-unknown-linux-musl
|
|
||||||
sort=sort
|
|
||||||
else
|
|
||||||
target=x86_64-apple-darwin
|
|
||||||
sort=gsort # for `sort --sort-version`, from brew's coreutils.
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This fetches latest stable release
|
|
||||||
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
|
|
||||||
| cut -d/ -f3 \
|
|
||||||
| grep -E '^v[0.1.0-9.]+$' \
|
|
||||||
| $sort --version-sort \
|
|
||||||
| tail -n1)
|
|
||||||
curl -LSfs https://japaric.github.io/trust/install.sh | \
|
|
||||||
sh -s -- \
|
|
||||||
--force \
|
|
||||||
--git japaric/cross \
|
|
||||||
--tag $tag \
|
|
||||||
--target $target
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
# This script takes care of testing your crate
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
# TODO This is the "test phase", tweak it as you see fit
|
|
||||||
main() {
|
|
||||||
cross build --target $TARGET
|
|
||||||
cross build --target $TARGET --release
|
|
||||||
|
|
||||||
if [ ! -z $DISABLE_TESTS ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
cross test --target $TARGET
|
|
||||||
cross test --target $TARGET --release
|
|
||||||
|
|
||||||
cross run --target $TARGET
|
|
||||||
cross run --target $TARGET --release
|
|
||||||
}
|
|
||||||
|
|
||||||
# we don't run the "test phase" when doing deploys
|
|
||||||
if [ -z $TRAVIS_TAG ]; then
|
|
||||||
main
|
|
||||||
fi
|
|
||||||
+1
-1
@@ -158,7 +158,7 @@ fn get_metadata_blocks_and_inode(d: &std::fs::DirEntry) -> Option<(u64, u64)> {
|
|||||||
|
|
||||||
#[cfg(not(any(target_os = "linux", target_os = "unix", target_os = "macos")))]
|
#[cfg(not(any(target_os = "linux", target_os = "unix", target_os = "macos")))]
|
||||||
fn get_metadata_blocks_and_inode(_d: &std::fs::DirEntry) -> Option<(u64, u64)> {
|
fn get_metadata_blocks_and_inode(_d: &std::fs::DirEntry) -> Option<(u64, u64)> {
|
||||||
match _d.metadata().ok() {
|
match d.metadata().ok() {
|
||||||
Some(md) => Some((md.len(), 0)), //move to option not 0
|
Some(md) => Some((md.len(), 0)), //move to option not 0
|
||||||
None => None,
|
None => None,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user