dependency reduction:

- authc no longer uses reqwest
 - image only supports PNG
 - replace routille with tiny_http
 - several other dependencies
 - cargo upgrade
 - following improvement was measured on R7 1700X:
   before:
    - cargo build: 3076.73s user / 4:45 total / 589 dependencies
    - cargo test: 6118.38s user / 7:30 total / 959 dependencies
   after:
    - cargo build: 2680.54s user / 4:05 total / 480 dependencies
    - cargo test: 5351.81s user / 7:04 total / 791 dependencies
 - added xMAC94x to CODEOWNERS for Cargo.toml, he will protect them from now on and hit people with evil looks ;)
This commit is contained in:
Marcel Märtens 2020-06-01 02:13:35 +02:00
parent d612e875a6
commit 0e59ee901e
12 changed files with 409 additions and 1052 deletions

3
.gitlab/CODEOWNERS Normal file
View File

@ -0,0 +1,3 @@
*/Cargo.toml @xMAC94x
Cargo.toml @xMAC94x
rust-toolchain @xMAC94x

1305
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -9,10 +9,10 @@ common = { package = "veloren-common", path = "../common", features = ["no-asset
byteorder = "1.3.2" byteorder = "1.3.2"
uvth = "3.1.1" uvth = "3.1.1"
image = "0.22.3" image = { version = "0.22.3", default-features = false, features = ["png"] }
num_cpus = "1.10.1" num_cpus = "1.10.1"
log = "0.4.8" log = "0.4.8"
specs = "0.15.1" specs = "0.15.1"
vek = { version = "0.10.0", features = ["serde"] } vek = { version = "0.11.0", features = ["serde"] }
hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } hashbrown = { version = "0.6", features = ["rayon", "serde", "nightly"] }
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } authc = { git = "https://gitlab.com/veloren/auth.git", rev = "223a4097f7ebc8d451936dccb5e6517194bbf086" }

View File

@ -11,30 +11,28 @@ no-assets = []
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" } specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
specs = { version = "0.15.1", features = ["serde", "nightly", "storage-event-control"] } specs = { version = "0.15.1", features = ["serde", "nightly", "storage-event-control"] }
vek = { version = "0.10.0", features = ["serde"] } vek = { version = "0.11.0", features = ["serde"] }
dot_vox = "4.0.0" dot_vox = "4.0"
fxhash = "0.2.1" image = { version = "0.22.3", default-features = false, features = ["png"] }
image = "0.22.3" mio = "0.6"
mio = "0.6.19" serde = "1.0"
mio-extras = "2.0.5" serde_derive = "1.0"
serde = "1.0.102"
serde_derive = "1.0.102"
serde_json = "1.0.41" serde_json = "1.0.41"
ron = "0.5.1" ron = { version = "0.6", default-features = false }
bincode = "1.2.0" bincode = "1.2.0"
log = "0.4.8" log = "0.4.8"
rand = "0.7.2" rand = "0.7"
rayon = "^1.3.0" rayon = "^1.3.0"
lazy_static = "1.4.0" lazy_static = "1.4.0"
lz4-compress = "0.1.1" lz4-compress = "0.1.1"
hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } hashbrown = { version = "0.6", features = ["rayon", "serde", "nightly"] }
find_folder = "0.3.0" find_folder = "0.3.0"
parking_lot = "0.9.0" parking_lot = "0.9.0"
crossbeam = "=0.7.2" crossbeam = "0.7"
notify = "5.0.0-pre.2" notify = "5.0.0-pre.2"
indexmap = "1.3.0" indexmap = "1.3.0"
sum_type = "0.2.0" sum_type = "0.2.0"
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } authc = { git = "https://gitlab.com/veloren/auth.git", rev = "223a4097f7ebc8d451936dccb5e6517194bbf086" }
[dev-dependencies] [dev-dependencies]
criterion = "0.3" criterion = "0.3"

View File

@ -12,7 +12,7 @@ edition = "2018"
bincode = "1.2" bincode = "1.2"
serde = { version = "1.0" } serde = { version = "1.0" }
#sending #sending
async-std = { version = "~1.5", features = ["std"] } async-std = { version = "~1.5", default-features = false, features = ["std", "async-task", "default"] }
#tracing and metrics #tracing and metrics
tracing = { version = "0.1", default-features = false } tracing = { version = "0.1", default-features = false }
tracing-futures = "0.2" tracing-futures = "0.2"
@ -25,4 +25,4 @@ rand = { version = "0.7" }
[dev-dependencies] [dev-dependencies]
tracing-subscriber = { version = "0.2.3", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec"] } tracing-subscriber = { version = "0.2.3", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec"] }
uvth = { version = "3.1", default-features = false } uvth = { version = ">= 3.0, <= 4.0", default-features = false }

View File

@ -16,23 +16,23 @@ specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
log = "0.4.8" log = "0.4.8"
specs = { version = "0.15.1", features = ["shred-derive"] } specs = { version = "0.15.1", features = ["shred-derive"] }
vek = "0.10.0" vek = "0.11.0"
uvth = "3.1.1" uvth = "3.1.1"
lazy_static = "1.4.0" lazy_static = "1.4.0"
scan_fmt = "0.2.4" scan_fmt = "0.2.4"
ron = "0.5.1" ron = { version = "0.6", default-features = false }
serde = "1.0.102" serde = "1.0"
serde_derive = "1.0.102" serde_derive = "1.0"
serde_json = "1.0" serde_json = "1.0"
rand = { version = "0.7.2", features = ["small_rng"] } rand = { version = "0.7", features = ["small_rng"] }
chrono = "0.4.9" chrono = "0.4.9"
hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } hashbrown = { version = "0.6", features = ["rayon", "serde", "nightly"] }
crossbeam = "=0.7.2" crossbeam = "=0.7.2"
prometheus = "0.7" prometheus = { version = "0.7", default-features = false}
prometheus-static-metric = "0.2" prometheus-static-metric = "0.2"
rouille = "3.0.0" tiny_http = "0.7.0"
portpicker = { git = "https://github.com/wusyong/portpicker-rs", branch = "fix_ipv6" } portpicker = { git = "https://github.com/xMAC94x/portpicker-rs" }
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } authc = { git = "https://gitlab.com/veloren/auth.git", rev = "223a4097f7ebc8d451936dccb5e6517194bbf086" }
libsqlite3-sys = { version = "0.9.1", features = ["bundled"] } libsqlite3-sys = { version = "0.9.1", features = ["bundled"] }
diesel = { version = "1.4.3", features = ["sqlite"] } diesel = { version = "1.4.3", features = ["sqlite"] }
diesel_migrations = "1.4.0" diesel_migrations = "1.4.0"

View File

@ -1,6 +1,5 @@
use log::info; use log::{debug, error};
use prometheus::{Encoder, Gauge, IntGauge, IntGaugeVec, Opts, Registry, TextEncoder}; use prometheus::{Encoder, Gauge, IntGauge, IntGaugeVec, Opts, Registry, TextEncoder};
use rouille::{router, Server};
use std::{ use std::{
convert::TryInto, convert::TryInto,
error::Error, error::Error,
@ -135,25 +134,35 @@ impl ServerMetrics {
//TODO: make this a job //TODO: make this a job
self.handle = Some(thread::spawn(move || { self.handle = Some(thread::spawn(move || {
let server = Server::new(addr, move |request| { let server = tiny_http::Server::http(addr).unwrap();
router!(request, const TIMEOUT: Duration = Duration::from_secs(1);
(GET) (/metrics) => { debug!("starting tiny_http server to serve metrics");
while running2.load(Ordering::Relaxed) {
let request = match server.recv_timeout(TIMEOUT) {
Ok(Some(rq)) => rq,
Ok(None) => continue,
Err(e) => {
println!("error: {}", e);
break;
},
};
let mf = registry.gather();
let encoder = TextEncoder::new(); let encoder = TextEncoder::new();
let mut buffer = vec![]; let mut buffer = vec![];
let mf = registry.gather(); encoder
encoder.encode(&mf, &mut buffer).expect("Failed to encoder metrics text."); .encode(&mf, &mut buffer)
rouille::Response::text(String::from_utf8(buffer).expect("Failed to parse bytes as a string.")) .expect("Failed to encoder metrics text.");
}, let response = tiny_http::Response::from_string(
_ => rouille::Response::empty_404() String::from_utf8(buffer).expect("Failed to parse bytes as a string."),
) );
}) if let Err(e) = request.respond(response) {
.expect("Failed to start server"); error!(
info!("Started server metrics: {}", addr); "The metrics HTTP server had encountered and error with answering, {}",
while running2.load(Ordering::Relaxed) { e
server.poll(); );
// Poll at 10Hz
thread::sleep(Duration::from_millis(100));
} }
}
debug!("stopping tiny_http server to serve metrics");
})); }));
Ok(()) Ok(())
} }

View File

@ -27,14 +27,14 @@ glutin = "0.21.1"
winit = { version = "0.19.4", features = ["serde"] } winit = { version = "0.19.4", features = ["serde"] }
conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "pre-winit-20" } conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "pre-winit-20" }
conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "pre-winit-20" } conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "pre-winit-20" }
euc = "0.3.0" euc = { git = "https://github.com/zesterer/euc.git" }
# ECS # ECS
specs = "0.15.1" specs = "0.15.1"
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" } specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
# Mathematics # Mathematics
vek = { version = "0.10.0", features = ["serde"] } vek = { version = "0.11.0", features = ["serde"] }
# Controller # Controller
gilrs = { version = "0.7", features = ["serde"] } gilrs = { version = "0.7", features = ["serde"] }
@ -46,28 +46,28 @@ server = { package = "veloren-server", path = "../server", optional = true }
glsl-include = "0.3.1" glsl-include = "0.3.1"
failure = "0.1.6" failure = "0.1.6"
log = "0.4.8" log = "0.4.8"
dot_vox = "4.0.0" dot_vox = "4.0"
image = "0.22.3" image = { version = "0.22.5", default-features = false, features = ["ico", "png"] }
serde = "1.0.102" serde = "1.0"
serde_derive = "1.0.102" serde_derive = "1.0"
ron = "0.5.1" ron = { version = "0.6", default-features = false }
guillotiere = { git = "https://github.com/Imberflur/guillotiere" } guillotiere = { git = "https://github.com/Imberflur/guillotiere" }
fern = { version = "0.5.8", features = ["colored"] } fern = { version = "0.5.8", features = ["colored"] }
msgbox = { git = "https://github.com/bekker/msgbox-rs.git", rev = "68fe39a", optional = true } msgbox = { git = "https://github.com/bekker/msgbox-rs.git", default-features = false, rev = "68fe39a", optional = true }
directories = "2.0.2" directories = "2.0.2"
num = "0.2.0" num = "0.2.0"
backtrace = "0.3.40" backtrace = "0.3.40"
rand = "0.7.2" rand = "0.7"
treeculler = { git = "https://gitlab.com/yusdacra/treeculler.git" } treeculler = { git = "https://gitlab.com/yusdacra/treeculler.git" }
rodio = { version = "0.10", default-features = false, features = ["wav", "vorbis"] } rodio = { version = "0.10", default-features = false, features = ["wav", "vorbis"] }
cpal = "0.10" cpal = "0.10"
crossbeam = "=0.7.2" crossbeam = "=0.7.2"
hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } hashbrown = { version = "0.6", features = ["rayon", "serde", "nightly"] }
chrono = "0.4.9" chrono = "0.4.9"
bincode = "1.2" bincode = "1.2"
deunicode = "1.0" deunicode = "1.0"
uvth = "3.1.1" uvth = "3.1.1"
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" } authc = { git = "https://gitlab.com/veloren/auth.git", rev = "223a4097f7ebc8d451936dccb5e6517194bbf086" }
const-tweaker = { version = "0.2.5", optional = true } const-tweaker = { version = "0.2.5", optional = true }
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]

View File

@ -121,10 +121,9 @@ impl PlayState for MainMenuState {
localized_strings.get("common.fatal_error"), localized_strings.get("common.fatal_error"),
e e
), ),
client::AuthClientError::RequestError(_) => format!( client::AuthClientError::RequestError() => format!(
"{}: {}", "{}",
localized_strings.get("main.login.failed_sending_request"), localized_strings.get("main.login.failed_sending_request")
e
), ),
client::AuthClientError::ServerError(_, e) => format!("{}", e), client::AuthClientError::ServerError(_, e) => format!("{}", e),
}, },

View File

@ -2023,6 +2023,7 @@ impl<V: RectRasterableVol> Terrain<V> {
}) })
.min_by_key(|todo| todo.active_worker.unwrap_or(todo.started_tick)) .min_by_key(|todo| todo.active_worker.unwrap_or(todo.started_tick))
{ {
// TODO: find a alternative!
if scene_data.thread_pool.queued_jobs() > 0 { if scene_data.thread_pool.queued_jobs() > 0 {
break; break;
} }

View File

@ -92,10 +92,10 @@ impl<'a> Pipeline for Voxel {
//norm: _, //norm: _,
ao_level, ao_level,
}: &Self::Vertex, }: &Self::Vertex,
) -> ([f32; 3], Self::VsOut) { ) -> ([f32; 4], Self::VsOut) {
let light = Rgba::from_opaque(Rgb::from(*ao_level as f32 / 4.0 + 0.25)); let light = Rgba::from_opaque(Rgb::from(*ao_level as f32 / 4.0 + 0.25));
let color = light * srgba_to_linear(Rgba::from_opaque(*col)); let color = light * srgba_to_linear(Rgba::from_opaque(*col));
let position = (self.mvp * Vec4::from_point(*pos)).xyz().into_array(); let position = (self.mvp * Vec4::from_point(*pos)).into_array();
(position, VsOut(color)) (position, VsOut(color))
} }
@ -175,7 +175,7 @@ pub fn draw_vox(
Voxel { mvp }.draw::<rasterizer::Triangles<_>, _>( Voxel { mvp }.draw::<rasterizer::Triangles<_>, _>(
&generate_mesh(segment, Vec3::from(0.0)), &generate_mesh(segment, Vec3::from(0.0)),
&mut color, &mut color,
&mut depth, Some(&mut depth),
); );
let rgba_img = RgbaImage::from_vec( let rgba_img = RgbaImage::from_vec(

View File

@ -9,24 +9,24 @@ bincode = "1.2.0"
common = { package = "veloren-common", path = "../common" } common = { package = "veloren-common", path = "../common" }
bitvec = "0.17.4" bitvec = "0.17.4"
fxhash = "0.2.1" fxhash = "0.2.1"
image = "0.22.3" image = { version = "0.22.3", default-features = false, features = ["png"] }
itertools = "0.8.2" itertools = "0.8.2"
vek = "0.10.0" vek = "0.11.0"
noise = { version = "0.6.0", default-features = false } noise = { version = "0.6.0", default-features = false }
num = "0.2.0" num = "0.2.0"
ordered-float = "1.0" ordered-float = "1.0"
hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] } hashbrown = { version = "0.6", features = ["rayon", "serde", "nightly"] }
lazy_static = "1.4.0" lazy_static = "1.4.0"
log = "0.4.8" log = "0.4.8"
rand = "0.7.2" rand = "0.7"
rand_chacha = "0.2.1" rand_chacha = "0.2.1"
arr_macro = "0.1.2" arr_macro = "0.1.2"
packed_simd = "0.3.3" packed_simd = "0.3.3"
rayon = "^1.3.0" rayon = "^1.3.0"
roots = "0.0.5" roots = "0.0.5"
serde = "1.0.102" serde = "1.0"
serde_derive = "1.0.102" serde_derive = "1.0"
ron = "0.5.1" ron = { version = "0.6", default-features = false }
[dev-dependencies] [dev-dependencies]
pretty_env_logger = "0.3.0" pretty_env_logger = "0.3.0"