-
Notifications
You must be signed in to change notification settings - Fork 389
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
Define PKG_CONFIG_PATH in Docker images #404
Comments
I just ran into this and agree that changing the docker images for this would be helpful. The fact that In the end, my solution was to set FROM rustembedded/cross:armv7-unknown-linux-gnueabihf-0.2.1
RUN dpkg --add-architecture armhf
RUN apt-get update && \
apt-get install --assume-yes libasound2-dev:armhf libssl-dev:armhf
ENV PKG_CONFIG_LIBDIR=/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig The advantage of |
This seems to be causing issues with rust-openssl as well. I don't know the guts of Cross well enough to say what may be going on or how to fix it, but I can confirm the problem still exists. |
@Crell in case it's helpful to you (and others!), I kept digging into this after I left that comment, and have written a couple of in-depth blog posts about getting cross-compile working with system packages, they're here:
|
Is there a workaround? |
I don't have the directory |
Ok, I'm able to buidl using the Dockerfile from @capnfabs |
Was able to get this to work in the docker file. Here's my file for aarch64 in case it helps anyone: FROM rustembedded/cross:aarch64-unknown-linux-gnu-0.2.1
WORKDIR /home/src
RUN dpkg --add-architecture arm64
RUN apt-get update && \
apt-get install --assume-yes libssl-dev:arm64
ENV PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain stable -y
ENV PATH=/root/.cargo/bin:$PATH
RUN apt-get install libssl-dev pkg-config -y
COPY . .
CMD cargo build --release |
As stated on #149 (comment) one has to manually define
PKG_CONFIG_PATH
in their custom docker image in order to build Rust code relying on external libs.Automatically defining it in the
cross
images would make things easier as users would just have to derive from the official images and install their extra packages.Would you consider such change in the docker files?
The text was updated successfully, but these errors were encountered: