Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't start #3

Open
Oreolek opened this issue Nov 19, 2018 · 7 comments
Open

can't start #3

Oreolek opened this issue Nov 19, 2018 · 7 comments

Comments

@Oreolek
Copy link

Oreolek commented Nov 19, 2018

After building the executable on Linux:

RUST_BACKTRACE=1 ./target/release/syzygy
thread 'main' panicked at 'screen_fade: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:477
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:391
   6: rust_begin_unwind
             at libstd/panicking.rs:326
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
   9: syzygy::gui::resources::ResourceCache::get_sprites
  10: syzygy::modes::title::control::run_title_screen
  11: syzygy::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:103
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  16: main
  17: __libc_start_main
  18: _start
@popey
Copy link

popey commented Nov 19, 2018

I'm seeing the same issue on my Ubuntu system here.

@mdsteele
Copy link
Owner

Sorry for the trouble. The resource-loader code expects the game to be run in one of two ways: either locally via cargo run, or from the installed release package. If you instead run the local binary directly via ./target/release/syzygy, the game gets confused and can't find the resource files.

If you want to compile and run the game without having to build and install a release package, you can just run cargo run --release from the repository root. (Note that release mode is recommended, because there's one puzzle in particular that runs quite slowly in debug mode.)

I should add instructions to the README to clarify all this.

@mdsteele
Copy link
Owner

README has been updated. Thanks for the reports! I'm going to close this issue for now, but please reopen if you still have any trouble getting the game to start up.

@popey
Copy link

popey commented Nov 20, 2018

Actually I was trying to package to syzygy as a snap. Is there some way we can coerce the game to look in a specific place? Modern packaging systems (snap, flatpak, appimage) are pretty reliant on applications being relocatable. Being able to point to where the data is, would be very useful here.

@mdsteele mdsteele reopened this Nov 24, 2018
@mdsteele
Copy link
Owner

Gotcha. I'm not familiar with snap, so I'm not sure what would be the best way to point to the data. Would an environment variable work? (e.g. SYZYGY_DATA_DIR=path/to/data). That would be very easy to support in src/gui/loader/path.rs.

@popey
Copy link

popey commented Nov 25, 2018

Yup. If the binary can live in a read-only directory, along with all the data, and can be coerced to look there for the data, that'd be great. We can launch syzygy after setting the environment appropriately to point to the right place.

@mdsteele
Copy link
Owner

I've added support for a SYZYGY_DATA_DIR environment variable, and updated the instructions at https://github.com/mdsteele/syzygy#building-and-running-locally. Please let me know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants