-
Notifications
You must be signed in to change notification settings - Fork 348
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
could not find X11 #1180
Comments
following packages are installed in the custom image |
Image is built with cross aa59bf2 using cargo build-docker-image |
How exactly are you installing these dependencies in the custom image built with |
get the base image with cargo build-docker-image, then build the custom image with following Dockerfile FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:local ENV DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture arm64 && |
Alright, this might be an issue with how Any reason you're using Does setting It should be |
No, same error log. |
comment out following code in toolchain.cmake will make it work |
The CMAKE_PREFIX_PATH is empty by default, and is only filled if a path is given using I can confirm fltk-rs used to build using cross-rs, but currently it doesn't with: FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes --no-install-recommends \
libx11-dev:arm64 libxext-dev:arm64 libxft-dev:arm64 \
libxinerama-dev:arm64 libxcursor-dev:arm64 \
libxrender-dev:arm64 libxfixes-dev:arm64 libgl1-mesa-dev:arm64 \
libglu1-mesa-dev:arm64 libasound2-dev:arm64 libpango1.0-dev:arm64 and Cross.toml: [target.aarch64-unknown-linux-gnu]
dockerfile = "./arm64-dockerfile"
I think cross-rs shouldn't be passing a CMAKE_TOOLCHAIN_FILE to every build since that breaks any repo which uses its own toolchain file or using a toolchain file provided by a vendor, like the android cmake toolchain file for example. A minimal repro using the cmake crate (only requiring X11, no fltk):
// build.rs
fn main() {
let out_dir = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
let _dst = cmake::Config::new("csrc").build();
println!(
"cargo:rustc-link-search=native={}",
out_dir.join("lib").display()
);
println!("cargo:rustc-link-lib=static=cx11");
} # Cargo.toml
[package]
name = "cros2"
version = "0.1.0"
edition = "2021"
[build-dependencies]
cmake = "*" # Cross.toml
[target.aarch64-unknown-linux-gnu]
dockerfile = "./arm64-dockerfile" # arm64-dockerfile
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install --assume-yes --no-install-recommends \
libx11-dev:arm64 // csrc/lib.c
int cmain() {
return 0;
} # csrc/CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(cx11)
find_package(X11 REQUIRED) # this will fail
add_library(cx11 lib.c)
# cmake-rs requires an install target
install(TARGETS cx11
EXPORT cx11Config
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
) // src/main.rs
fn main() {
println!("Hello, world!");
} build with |
Checklist
Describe your issue
build fltk-rs (https://github.com/fltk-rs/fltk-rs) with https://github.com/fltk-rs/fltk-rs
run into
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Pango requires Xft but Xft library or headers could not be found.
-- Please install Xft development files and try again or disable OPTION_USE_PANGO.
-- Configuring incomplete, errors occurred!
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.4
Example
No response
Additional information / notes
No response
The text was updated successfully, but these errors were encountered: