mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Alacritty now compiles on stable Rust 🎉
This commit is contained in:
parent
875167a510
commit
f2f750f9f3
11 changed files with 34 additions and 85 deletions
|
@ -8,7 +8,7 @@ os:
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
rust:
|
rust:
|
||||||
- nightly
|
- stable
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cargo test --no-default-features
|
- cargo test --no-default-features
|
||||||
|
|
30
Cargo.lock
generated
30
Cargo.lock
generated
|
@ -18,7 +18,6 @@ dependencies = [
|
||||||
"mio 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mio 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"notify 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"notify 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-test 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"serde 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -355,11 +354,6 @@ dependencies = [
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "getopts"
|
|
||||||
version = "0.2.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gl_generator"
|
name = "gl_generator"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
|
@ -823,18 +817,6 @@ name = "rustc-serialize"
|
||||||
version = "0.3.22"
|
version = "0.3.22"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustc-test"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
dependencies = [
|
|
||||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
version = "0.1.7"
|
version = "0.1.7"
|
||||||
|
@ -1014,15 +996,6 @@ dependencies = [
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "term"
|
|
||||||
version = "0.4.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
dependencies = [
|
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "term_size"
|
name = "term_size"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
@ -1254,7 +1227,6 @@ dependencies = [
|
||||||
"checksum fsevent-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "72e33a926306442d961595c3a325864326ca4287795e106dae8993afe484ede6"
|
"checksum fsevent-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "72e33a926306442d961595c3a325864326ca4287795e106dae8993afe484ede6"
|
||||||
"checksum gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)" = "3689e1982a563af74960ae3a4758aa632bb8fd984cfc3cc3b60ee6109477ab6e"
|
"checksum gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)" = "3689e1982a563af74960ae3a4758aa632bb8fd984cfc3cc3b60ee6109477ab6e"
|
||||||
"checksum gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "65256ec4dc2592e6f05bfc1ca3b956a4e0698aa90b1dff1f5687d55a5a3fd59a"
|
"checksum gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "65256ec4dc2592e6f05bfc1ca3b956a4e0698aa90b1dff1f5687d55a5a3fd59a"
|
||||||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
|
|
||||||
"checksum gl_generator 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1d8edc81c5ae84605a62f5dac661a2313003b26d59839f81d47d46cf0f16a55"
|
"checksum gl_generator 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1d8edc81c5ae84605a62f5dac661a2313003b26d59839f81d47d46cf0f16a55"
|
||||||
"checksum gleam 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3023edde169b7767a71d2e5dd8e8903ac3b1436ff659225310928db87d6a8a"
|
"checksum gleam 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3023edde169b7767a71d2e5dd8e8903ac3b1436ff659225310928db87d6a8a"
|
||||||
"checksum glutin 0.6.1 (git+https://github.com/jwilm/glutin?rev=af7fe340bd4a2af53ea521defcb4f377cdc588cf)" = "<none>"
|
"checksum glutin 0.6.1 (git+https://github.com/jwilm/glutin?rev=af7fe340bd4a2af53ea521defcb4f377cdc588cf)" = "<none>"
|
||||||
|
@ -1308,7 +1280,6 @@ dependencies = [
|
||||||
"checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753"
|
"checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753"
|
||||||
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
||||||
"checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b"
|
"checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b"
|
||||||
"checksum rustc-test 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5a8a7c2bc3cd2df4e0da9e548cd1b50c4c7b68d72410d34eba98a2d5393a2875"
|
|
||||||
"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
|
"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
|
||||||
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
|
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
|
||||||
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
|
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
|
||||||
|
@ -1332,7 +1303,6 @@ dependencies = [
|
||||||
"checksum syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f94368aae82bb29656c98443a7026ca931a659e8d19dcdc41d6e273054e820"
|
"checksum syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f94368aae82bb29656c98443a7026ca931a659e8d19dcdc41d6e273054e820"
|
||||||
"checksum target_build_utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "54c550e226618cd35334b75e92bfa5437c61474bdb75c38bf330ab5a8037b77c"
|
"checksum target_build_utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "54c550e226618cd35334b75e92bfa5437c61474bdb75c38bf330ab5a8037b77c"
|
||||||
"checksum tempfile 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3213fd2b7ed87e39306737ccfac04b1233b57a33ca64cfbf52f2ffaa2b765e2f"
|
"checksum tempfile 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3213fd2b7ed87e39306737ccfac04b1233b57a33ca64cfbf52f2ffaa2b765e2f"
|
||||||
"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a"
|
|
||||||
"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0"
|
"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0"
|
||||||
"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade"
|
"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade"
|
||||||
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
|
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
|
||||||
|
|
|
@ -11,10 +11,6 @@ doc = false
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
name = "alacritty"
|
name = "alacritty"
|
||||||
|
|
||||||
[[test]]
|
|
||||||
name = "ref"
|
|
||||||
harness = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "*"
|
libc = "*"
|
||||||
cgmath = "0.7"
|
cgmath = "0.7"
|
||||||
|
@ -23,7 +19,7 @@ bitflags = "*"
|
||||||
font = { path = "./font" }
|
font = { path = "./font" }
|
||||||
errno = "0.1.6"
|
errno = "0.1.6"
|
||||||
lazy_static = "0.2.2"
|
lazy_static = "0.2.2"
|
||||||
parking_lot = { version = "0.3.1", features = ["nightly"] }
|
parking_lot = "0.3.1"
|
||||||
serde = "0.9"
|
serde = "0.9"
|
||||||
serde_yaml = "0.6"
|
serde_yaml = "0.6"
|
||||||
serde_derive = "0.9"
|
serde_derive = "0.9"
|
||||||
|
@ -52,9 +48,6 @@ gl_generator = "0.5"
|
||||||
git = "https://github.com/jwilm/glutin"
|
git = "https://github.com/jwilm/glutin"
|
||||||
rev = "af7fe340bd4a2af53ea521defcb4f377cdc588cf"
|
rev = "af7fe340bd4a2af53ea521defcb4f377cdc588cf"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
rustc-test = { version = "0.1", features = ["capture"] }
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
debug = true
|
debug = true
|
||||||
|
|
11
README.md
11
README.md
|
@ -55,16 +55,11 @@ makepkg -isr
|
||||||
cd alacritty
|
cd alacritty
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Make sure you have the right Rust compiler installed. Alacritty requires nightly Rust. Run
|
3. Make sure you have the right Rust compiler installed. Alacritty requires at least 1.15. Run
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
rustup override set nightly
|
rustup override set stable
|
||||||
```
|
rustup update stable
|
||||||
|
|
||||||
If you run into problems, you can try a known-good version of the compiler by running
|
|
||||||
|
|
||||||
```sh
|
|
||||||
rustup override set $(<rustc-version)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Ubuntu
|
#### Ubuntu
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
//! CoreText is used on Mac OS.
|
//! CoreText is used on Mac OS.
|
||||||
//! FreeType is used on everything that's not Mac OS.
|
//! FreeType is used on everything that's not Mac OS.
|
||||||
//! Eventually, ClearType support will be available for windows
|
//! Eventually, ClearType support will be available for windows
|
||||||
#![feature(integer_atomics)]
|
|
||||||
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
extern crate fontconfig;
|
extern crate fontconfig;
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
@ -44,7 +42,7 @@ extern crate log;
|
||||||
|
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::sync::atomic::{AtomicU16, ATOMIC_U16_INIT, Ordering};
|
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
|
||||||
|
|
||||||
// If target isn't macos, reexport everything from ft
|
// If target isn't macos, reexport everything from ft
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
@ -123,10 +121,10 @@ impl FontKey {
|
||||||
///
|
///
|
||||||
/// The generated key will be globally unique
|
/// The generated key will be globally unique
|
||||||
pub fn next() -> FontKey {
|
pub fn next() -> FontKey {
|
||||||
static TOKEN: AtomicU16 = ATOMIC_U16_INIT;
|
static TOKEN: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||||
|
|
||||||
FontKey {
|
FontKey {
|
||||||
token: TOKEN.fetch_add(1, Ordering::SeqCst),
|
token: TOKEN.fetch_add(1, Ordering::SeqCst) as _,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
nightly-2017-01-15
|
|
|
@ -1314,8 +1314,6 @@ mod tests {
|
||||||
|
|
||||||
// Sanity check that key bindings are being parsed
|
// Sanity check that key bindings are being parsed
|
||||||
assert!(config.key_bindings.len() >= 1);
|
assert!(config.key_bindings.len() >= 1);
|
||||||
|
|
||||||
println!("config: {:#?}", config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -124,7 +124,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, feature = "bench"))]
|
||||||
mod benches {
|
mod benches {
|
||||||
extern crate test;
|
extern crate test;
|
||||||
use super::Cell;
|
use super::Cell;
|
||||||
|
|
|
@ -1264,7 +1264,6 @@ impl ansi::Handler for Term {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
use super::{Term, limit, SizeInfo};
|
use super::{Term, limit, SizeInfo};
|
||||||
|
|
||||||
|
@ -1314,7 +1313,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(all(test, feature = "bench"))]
|
||||||
mod benches {
|
mod benches {
|
||||||
extern crate test;
|
extern crate test;
|
||||||
extern crate serde_json as json;
|
extern crate serde_json as json;
|
||||||
|
|
|
@ -329,6 +329,5 @@ unsafe fn set_nonblocking(fd: c_int) {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_get_pw_entry() {
|
fn test_get_pw_entry() {
|
||||||
let mut buf: [i8; 1024] = [0; 1024];
|
let mut buf: [i8; 1024] = [0; 1024];
|
||||||
let pw = get_pw_entry(&mut buf);
|
let _pw = get_pw_entry(&mut buf);
|
||||||
println!("{:?}", pw);
|
|
||||||
}
|
}
|
||||||
|
|
48
tests/ref.rs
48
tests/ref.rs
|
@ -1,12 +1,9 @@
|
||||||
extern crate alacritty;
|
extern crate alacritty;
|
||||||
extern crate serde_json as json;
|
extern crate serde_json as json;
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
use std::env;
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{self, Read};
|
use std::io::{self, Read};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::Path;
|
||||||
use test::{TestDescAndFn, TestDesc, TestFn, ShouldPanic, TestName, test_main};
|
|
||||||
|
|
||||||
use alacritty::Grid;
|
use alacritty::Grid;
|
||||||
use alacritty::Term;
|
use alacritty::Term;
|
||||||
|
@ -14,29 +11,30 @@ use alacritty::term::Cell;
|
||||||
use alacritty::term::SizeInfo;
|
use alacritty::term::SizeInfo;
|
||||||
use alacritty::ansi;
|
use alacritty::ansi;
|
||||||
|
|
||||||
fn main() {
|
macro_rules! ref_tests {
|
||||||
let test_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/ref"));
|
($($name:ident,)*) => {
|
||||||
|
ref_tests!($($name),*);
|
||||||
let args = env::args().collect::<Vec<_>>();
|
};
|
||||||
|
($($name:ident),*) => {
|
||||||
let tests = test_dir
|
$(
|
||||||
.read_dir()
|
#[test]
|
||||||
.unwrap()
|
fn $name() {
|
||||||
.map(|e| desc(e.unwrap().path()))
|
let test_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/ref"));
|
||||||
.collect();
|
let test_path = test_dir.join(stringify!($name));
|
||||||
|
ref_test(&test_path);
|
||||||
test_main(&args, tests);
|
}
|
||||||
|
)*
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn desc(dir: PathBuf) -> TestDescAndFn {
|
ref_tests! {
|
||||||
TestDescAndFn {
|
fish_cc,
|
||||||
desc: TestDesc {
|
indexed_256_colors,
|
||||||
name: TestName::DynTestName(dir.file_name().unwrap().to_string_lossy().into_owned()),
|
ll,
|
||||||
ignore: false,
|
tmux_git_log,
|
||||||
should_panic: ShouldPanic::No,
|
tmux_htop,
|
||||||
},
|
vim_large_window_scroll,
|
||||||
testfn: TestFn::dyn_test_fn(move || ref_test(&dir)),
|
vim_simple_edit,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_u8<P>(path: P) -> Vec<u8>
|
fn read_u8<P>(path: P) -> Vec<u8>
|
||||||
|
|
Loading…
Reference in a new issue