rabite0 / hunter

The fastest file manager in the galaxy!
Do What The F*ck You Want To Public License
1.31k stars 64 forks source link

Added Travis CI configuration. #33

Closed straussdd closed 5 years ago

straussdd commented 5 years ago

Partially fixes issue #2 by providing prebuilt binaries for all major platforms.

straussdd commented 5 years ago

Here's what needs to be done for setup:

  1. You can sign up for the open source plan at github.com/marketplace/travis-ci.
  2. In .travis.yml, the value at deploy.api_key.secure needs to be replaced with an encrypted GitHub access token. 2a) The token can be generated from github.com/settings/tokens/new and needs to include the public_repo scope. 2b) Install the Travis CLI: gem install travis 2c) Use travis login --pro to authenticate the CLI against GitHub. Note: The --pro flag will log you into travis-ci.com instead of travis-ci.org, which probably is what you want considering that the .org domain is being merged into .com as of May 2nd, 2018. 2d) Use travis encrypt --com put-your-github-token-here to finally get the encrypted token. It works by encrypting it against the public RSA key fetched from https://api.travis-ci.com/repos/rabite0/hunter/key, so basically only the Travis CI worker will be able to decrypt it. Read docs.travis-ci.com/user/encryption-keys/ if you'd like to know the details.
  3. After .travis.yml has been committed, every change inside a branch matching branches.only will cause the CI to: 3a) Spawn an Ubuntu Xenial VM worker, install the current nightly Rust, and then cross-compile for every platform in matrix.include using the cross-crate. 3b) As specified with deploy.on.tags, whenever a new tag is created, the compiled builds will also be published in the github.com/rabite0/hunter/releases by using your API token. Note: deploy.draft is currently enabled, so it'll just create GitHub release drafts, which you can still edit as you'd like.
straussdd commented 5 years ago

After setup, the result should look somewhat like this: travis-ci.com/straussdd/hunter/

As you can see, hunter compiles cleanly for all important platforms, however apple-32, freebsd-32 and freebsd-64 are failing. For your convenience, I've listed the compilation errors for each one:

For i686-apple-darwin:

error[E0308]: mismatched types
  --> /Users/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/systemstat-0.1.4/src/platform/macos.rs:65:68
   |
65 |         Ok(DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(data.tv_sec, data.tv_usec as u32), Utc))
   |                                                                    ^^^^^^^^^^^ expected i64, found i32
help: you can cast an `i32` to `i64`, which will sign-extend the source value
   |
65 |         Ok(DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(data.tv_sec.into(), data.tv_usec as u32), Utc))
   |                                                                    ^^^^^^^^^^^^^^^^^^

For i686-unknown-freebsd:

error[E0308]: mismatched types
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/systemstat-0.1.4/src/platform/freebsd.rs:109:68
    |
109 |         Ok(DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(data.tv_sec, data.tv_usec as u32), Utc))
    |                                                                    ^^^^^^^^^^^ expected i64, found i32
help: you can cast an `i32` to `i64`, which will sign-extend the source value
    |
109 |         Ok(DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(data.tv_sec.into(), data.tv_usec as u32), Utc))
    |                                                                    ^^^^^^^^^^^^^^^^^^

For x86_64-unknown-freebsd, 16 instances of E0277, for example:

error[E0277]: `std::sync::mpsc::Sender<notify::RawEvent>` cannot be shared between threads safely
   --> src/file_browser.rs:255:51
    |
255 |           let main_widget = AsyncWidget::new(&core, Box::new(move |_| {
    |  ___________________________________________________^
256 | |             let name = if main_path.parent().is_none() {
257 | |                 "root".to_string()
258 | |             } else {
...   |
279 | |             Ok(list)
280 | |         }));
    | |__________^ `std::sync::mpsc::Sender<notify::RawEvent>` cannot be shared between threads safely
    |
    = help: within `notify::PollWatcher`, the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<notify::RawEvent>`
    = note: required because it appears within the type `notify::debounce::EventTx`
    = note: required because it appears within the type `notify::PollWatcher`
    = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::RwLock<notify::PollWatcher>`
    = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<std::sync::RwLock<notify::PollWatcher>>`
    = note: required because it appears within the type `fscache::FsCache`
    = note: required because it appears within the type `[closure@src/file_browser.rs:255:60: 280:10 main_path:std::path::PathBuf, cache:fscache::FsCache, core_m:widget::WidgetCore]`
    = note: required for the cast to the object type `dyn std::boxed::FnBox<(preview::Stale,), Output=std::result::Result<listview::ListView<files::Files>, fail::HError>> + std::marker::Send + std::marker::Sync`

You should decide whether it's reasonable to fix these build failures eventually, or to maybe disable the CI builds for these platforms in .travis.yml.

rabite0 commented 5 years ago

Cool thanks. People have been asking for binaries, so this is perfect.

Nice that it also shows build failures for all the systems. Now I know for sure on which platform it compiles.