Skip to content

First cargo run in the book should be *after* dependencies #2773

@l0b0

Description

@l0b0

How can Bevy's documentation be improved?

https://bevyengine.org/learn/book/getting-started/ suggests trying to run an example game before having mentioned the dependencies. As someone new to Bevy I ran into a relatively cryptic error message when trying to follow the Getting Started section:

$ cargo run --example breakout
   Compiling syn v1.0.65
   Compiling libm v0.2.1
   Compiling lock_api v0.4.5
   Compiling hexasphere v3.4.0
   Compiling khronos-egl v3.0.2
   Compiling num-traits v0.2.14
   Compiling ash v0.31.0
   Compiling alsa-sys v0.3.1
   Compiling libudev-sys v0.1.4
   Compiling wgpu-core v0.7.1
   Compiling mio v0.7.13
   Compiling net2 v0.2.37
   Compiling iovec v0.1.4
   Compiling gpu-alloc-types v0.2.0
error: failed to run custom build command for `alsa-sys v0.3.1`

Caused by:
  process didn't exit successfully: `/home/username/dev/bevy/target/debug/build/alsa-sys-ec09432a62eb389c/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=ALSA_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=ALSA_STATIC
  cargo:rerun-if-env-changed=ALSA_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'Failed to run `"pkg-config" "--libs" "--cflags" "alsa"`: No such file or directory (os error 2)', /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/alsa-sys-0.3.1/build.rs:13:18
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

A quick search found #330, which was fixed with some very nice documentation (even for NixOS, thanks!). However, this documentation should be referenced before asking the user to compile an example, to avoid friction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-DocsAn addition or correction to our documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions