FyroxEngine/Fyrox

Using sccache to avoid compiling each time

realroot2185 opened this issue · 6 comments

I enabled sccache in ~/.cargo/config.toml :
rustc-wrapper = "sccache"

After compiling again I made a new project fyrox-template init --name=test --style=3d and it still shows 331 compile:

RUSTC_WRAPPER=/usr/bin/sccache cargo run --package editor
Building [                          ] 10/331

I wonder if I can avoid to build 331 crates each time.

I know nothing about sscache, but I think usual cargo run --package editor should perform incremental compilation. Maybe there's a guide of how to configure sscache to prevent it from rebuilding the project from scratch everytime?

I mean every time that I make a new project.

That's normal then.

I copied fyrox-book.github.io/src/code/tutorials/rpg and it is crashing at start again as when I initially made this issue.

Maybe related to using sccache? I remember this problem when enabling it and it is not saving any time when compiling.

thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-resource-0.11.0/src/lib.rs:429:17:
Attempt to get reference to resource data which failed to load! Path is External ()
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <fyrox_resource::ResourceDataRef<T> as core::ops::deref::Deref>::deref
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-resource-0.11.0/src/lib.rs:429:17
   3: fyrox::scene::terrain::make_quad_tree
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/terrain/mod.rs:95:22
   4: <fyrox::scene::terrain::Chunk as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/terrain/mod.rs:231:26
   5: <alloc::vec::Vec<T> as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-core-0.27.0/src/visitor.rs:1391:17
   6: <fyrox_core::variable::InheritableVariable<T> as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-core-0.27.0/src/variable.rs:255:29
   7: <fyrox::scene::terrain::Terrain as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/terrain/mod.rs:773:17
   8: <fyrox::scene::node::Node as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/node/mod.rs:500:9
   9: fyrox::scene::node::container::read_node
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/node/container.rs:105:13
  10: <fyrox::scene::node::container::NodeContainer as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/node/container.rs:134:44
  11: <fyrox_core::pool::PoolRecord<T,P> as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-core-0.27.0/src/pool.rs:517:9
  12: <alloc::vec::Vec<T> as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-core-0.27.0/src/visitor.rs:1391:17
  13: <fyrox_core::pool::Pool<T,P> as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-core-0.27.0/src/pool.rs:549:9
  14: <fyrox::scene::graph::Graph as fyrox_core::visitor::Visit>::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/graph/mod.rs:2162:9
  15: fyrox::scene::Scene::visit
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/mod.rs:446:9
  16: fyrox::scene::SceneLoader::load
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/mod.rs:308:9
  17: fyrox::scene::SceneLoader::from_file::{{closure}}
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyrox-0.33.0/src/scene/mod.rs:280:22
  18: futures_executor::local_pool::block_on::{{closure}}
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-executor-0.3.30/src/local_pool.rs:317:23
  19: futures_executor::local_pool::run_executor::{{closure}}
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-executor-0.3.30/src/local_pool.rs:90:37
  20: std::thread::local::LocalKey<T>::try_with
             at /build/rust/src/rustc-1.79.0-src/library/std/src/thread/local.rs:286:12
  21: std::thread::local::LocalKey<T>::with
             at /build/rust/src/rustc-1.79.0-src/library/std/src/thread/local.rs:262:9
  22: futures_executor::local_pool::run_executor
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-executor-0.3.30/src/local_pool.rs:86:27
  23: futures_executor::local_pool::block_on
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-executor-0.3.30/src/local_pool.rs:317:5
  24: fyroxed_base::Editor::load_scene
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyroxed_base-0.20.0/src/lib.rs:1820:21
  25: fyroxed_base::Editor::update
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyroxed_base-0.20.0/src/lib.rs:2235:25
  26: fyroxed_base::update
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyroxed_base-0.20.0/src/lib.rs:2620:9
  27: fyroxed_base::Editor::run::{{closure}}
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyroxed_base-0.20.0/src/lib.rs:2439:25
  28: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /build/rust/src/rustc-1.79.0-src/library/core/src/ops/function.rs:294:13
  29: winit::platform_impl::platform::x11::EventLoop<T>::single_iteration
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/x11/mod.rs:620:13
  30: winit::platform_impl::platform::x11::EventLoop<T>::pump_events
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/x11/mod.rs:447:13
  31: winit::platform_impl::platform::x11::EventLoop<T>::run_on_demand
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/x11/mod.rs:414:19
  32: winit::platform_impl::platform::EventLoop<T>::run_on_demand
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/mod.rs:821:56
  33: winit::platform_impl::platform::EventLoop<T>::run
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/platform_impl/linux/mod.rs:814:9
  34: winit::event_loop::EventLoop<T>::run
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.8/src/event_loop.rs:249:9
  35: fyroxed_base::Editor::run
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fyroxed_base-0.20.0/src/lib.rs:2436:14
  36: editor::main
             at ./editor/src/main.rs:16:5
  37: core::ops::function::FnOnce::call_once
             at /build/rust/src/rustc-1.79.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This is unrelated, RPG tutorial's scene is outdated and must be re-created manually.

Ah but I think that sccache is supposed to avoid recompiling all crates for new projects.
Not sure.