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

Note on dependency arch for Fedora #1815

Closed
frantisekhanzlikbl opened this issue Apr 4, 2021 · 0 comments
Closed

Note on dependency arch for Fedora #1815

frantisekhanzlikbl opened this issue Apr 4, 2021 · 0 comments
Labels
C-Dependencies A change to the crates that Bevy depends on C-Docs An addition or correction to our documentation O-Linux Specific to the Linux desktop operating system

Comments

@frantisekhanzlikbl
Copy link

Bevy version

0.4.0

Operating system & version

Fedora 33

What you did

  1. follow the Linux dependency setup for Fedora 33
  2. cargo init --bin
  3. add the Bevy dependency
  4. add some code from any of the "getting started" tutorial sections
  5. try to build the project

What you expected to happen

The project should build successfully

What actually happened

The build failed with confusing linker errors.

the relevant part of build log
  = note: /usr/bin/ld: skipping incompatible /usr/lib/libasound.so when searching for -lasound
          /usr/bin/ld: skipping incompatible /usr/lib/libasound.so when searching for -lasound
          /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/10/../../../libasound.so when searching for -lasound
          /usr/bin/ld: skipping incompatible /lib/libasound.so when searching for -lasound
          /usr/bin/ld: skipping incompatible /usr/lib/libasound.so when searching for -lasound
          /usr/bin/ld: cannot find -lasound

Additional information

This was caused by alsa-lib-devel.i686 being installed on my system from the past, probably for building some other project.
Unfortunately, DNF does not issue any warning if I attempt to install alsa-lib-devel without explicitly specifying the arch, while already having the package installed for a non-default arch and instead just exits with a message about the package already being installed.

This is not directly a Bevy bug, but it was very confusing for someone not familiar with the linking process and not used to building a lot of software from source. It would be very helpful to add this somewhere in the (Fedora?) (not sure if this only affects DNF or other package managers as well) deps section, as it was very unclear why did ld not see the so in /usr/lib64/alsa.so and I have spent a lot of time tweaking the linker args instead of focusing on the real issue.

Also note that the solution was as simple as doing # dnf install alsa-lib-devel.x86_64

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation O-Linux Specific to the Linux desktop operating system C-Dependencies A change to the crates that Bevy depends on labels Apr 4, 2021
jleflang added a commit to jleflang/bevy that referenced this issue Apr 25, 2021
Some Fedora users may encounter linker errors during build time due to prior installations of packages
for the wrong arch. Added a note on how to install build dependencies if errors occur.

Closes bevyengine#1815.
jleflang added a commit to jleflang/bevy that referenced this issue Apr 25, 2021
Some Fedora users may encounter linker errors during build time due to prior installations of packages
for the wrong arch. Added a note on how to install build dependencies if errors occur.

Closes bevyengine#1815.
@bors bors bot closed this as completed in cc0ee53 Apr 27, 2021
jleflang added a commit to jleflang/bevy that referenced this issue Apr 27, 2021
Some Fedora users may encounter linker errors during build time due to prior installations of packages
for the wrong arch. Added a note on how to install build dependencies if errors occur.

Closes bevyengine#1815.
jleflang added a commit to jleflang/bevy that referenced this issue Apr 27, 2021
Some Fedora users may encounter linker errors during build time due to prior installations of packages
for the wrong arch. Added a note on how to install build dependencies if errors occur.

Closes bevyengine#1815.
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
This PR adds a note to the Fedora section of Linux Dependencies on solving linker errors.

Fixes bevyengine#1815.

Co-authored-by: James Leflang <59455417+jleflang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Dependencies A change to the crates that Bevy depends on C-Docs An addition or correction to our documentation O-Linux Specific to the Linux desktop operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants