rust-build/rust-build.action

Native pkgconfig not included

Closed this issue · 6 comments

VirxEC commented

/usr/lib/x86_64-linux-gnu/pkgconfig isn't included when building. This causes an error when trying to look for wayland stuff when I'm building my application.

My code errors out with:

Package wayland-client was not found in the pkg-config search path.
Perhaps you should add the directory containing `wayland-client.pc'
to the PKG_CONFIG_PATH environment variable

On my system at least, this file is in /usr/lib/x86_64-linux-gnu/pkgconfig/wayland-client.pc

So maybe PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/lib/${RUSTTARGET}/pkgconfig" would solve this issue?

Douile commented

Could you provide a link to the repo you have the issue with so we can test if this would fix it.

Douile commented

After testing I've found that the issue is not the PKG_CONFIG path the issue is that the wayland headers are not installed in the build container.
You need to add a pre-build script that installs the dependencies required by your sys crates:

  • wayland-sys = wayland-dev
  • smithay-client-toolkit = libxkbcommon-dev
    ...
#!/bin/bash

apk add wayland-dev libxkbcommon-dev
VirxEC commented

I don't get it. GitHub actions uses Ubuntu, and I run sudo apt install g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev libwayland-client0 which should handle all dependencies.

When I try your solution, all I get is /entrypoint.sh: line 47: ./prebuild.sh: Permission denied
Why would apk work on Ubuntu?

Douile commented

The imagine this action uses is alpine. You need to make the prebuild script executable using chmod +x.

VirxEC commented

Yea, I've slowly been figuring that out. Can you please update your README to mention these facts? If it was mentioned there I don't think I would've been confused.