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

Fix build for raspberry pi with cross #5272

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

task-jp
Copy link
Contributor

@task-jp task-jp commented May 19, 2024

slint needs openssl to build it.

The system library openssl required by crate openssl-sys was not found. The file openssl.pc needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory. PKG_CONFIG_PATH contains the following:
- /usr/lib/arm-linux-gnueabihf/pkgconfig

HINT: you may need to install a package such as openssl, openssl-dev or openssl-devel.

@task-jp
Copy link
Contributor Author

task-jp commented May 19, 2024

warning: excluded package(s) pyslint not found in workspace /project
Compiling toml_datetime v0.6.6
Compiling serde_spanned v0.6.6
Compiling enumflags2 v0.7.9
Compiling resvg v0.41.0
Compiling wayland-protocols-wlr v0.2.0
Compiling x11rb v0.13.1
Compiling wayland-protocols-plasma v0.2.0
Compiling femtovg v0.9.1
warning: i-slint-backend-qt@1.6.0: Could not find a Qt installation. The Qt backend will not be functional. See https://github.com/slint-ui/slint/blob/master/docs/install_qt.md for more info
warning: i-slint-backend-qt@1.6.0: Failed to execute qmake. Make sure 'qmake' is in your path!\nentity not found
Compiling url v2.5.0
Compiling serde_json v1.0.117
Compiling foreign-types-shared v0.1.1
Compiling generativity v1.1.0
Compiling openssl-sys v0.9.102
Compiling walkdir v2.5.0
Compiling tempfile v3.10.1
Compiling num-rational v0.4.2
Compiling cbindgen v0.26.0
Compiling http v0.2.12
Compiling clap v4.5.4
Compiling prettyplease v0.2.20
Compiling ring v0.17.8
Compiling bindgen v0.64.0
Compiling bindgen v0.69.4
Compiling which v4.4.2
Compiling indexmap v1.9.3
Compiling anyhow v1.0.86
Compiling xattr v1.3.1
Compiling pathfinder_simd v0.5.3
error: failed to run custom build command for openssl-sys v0.9.102

Caused by:
process didn't exit successfully: /target/release/build/openssl-sys-6028d534bc62b4a5/build-script-main (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_LIB_DIR
ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_INCLUDE_DIR
ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR
ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_armv7-unknown-linux-gnueabihf
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_armv7_unknown_linux_gnueabihf
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_armv7-unknown-linux-gnueabihf
cargo:rerun-if-env-changed=PKG_CONFIG_armv7_unknown_linux_gnueabihf
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_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_armv7-unknown-linux-gnueabihf
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_armv7_unknown_linux_gnueabihf
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_armv7-unknown-linux-gnueabihf
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_armv7_unknown_linux_gnueabihf
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7-unknown-linux-gnueabihf
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7_unknown_linux_gnueabihf
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
run pkg_config fail:
pkg-config exited with status code 1

PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags openssl

The system library openssl required by crate openssl-sys was not found.
The file openssl.pc needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
- /usr/lib/arm-linux-gnueabihf/pkgconfig

HINT: you may need to install a package such as openssl, openssl-dev or openssl-devel.

--- stderr
thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.102/build/find_normal.rs:190:5:

Could not find directory of OpenSSL installation, and this -sys crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the OPENSSL_DIR environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu
$TARGET = armv7-unknown-linux-gnueabihf
openssl-sys = 0.9.102

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Copy link
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding this to the container is fine (no harm), but I don't think it's a general requirement on the target. Or am I missing something here?

@@ -7,7 +7,7 @@ FROM ghcr.io/slint-ui/cross-aarch64-base:1.0

RUN dpkg --add-architecture arm64 && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes libfontconfig1-dev:arm64 libxcb1-dev:arm64 libxcb-render0-dev:arm64 libxcb-shape0-dev:arm64 libxcb-xfixes0-dev:arm64 libxkbcommon-dev:arm64 libinput-dev:arm64 libgbm-dev:arm64 python3 \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes libfontconfig1-dev:arm64 libxcb1-dev:arm64 libxcb-render0-dev:arm64 libxcb-shape0-dev:arm64 libxcb-xfixes0-dev:arm64 libxkbcommon-dev:arm64 libinput-dev:arm64 libgbm-dev:arm64 libssl-dev:armhf python3 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

armhf looks wrong here, shouldn't it be arm64?

@@ -42,6 +42,7 @@ For Linux a few additional packages beyond the usual build essentials are needed
- fontconfig library (`libfontconfig-dev` on debian based distributions)
- (optional) Qt will be used when `qmake` is found in `PATH`
- FFMPEG library `clang` `libavcodec-dev` `libavformat-dev` `libavutil-dev` `libavfilter-dev` `libavdevice-dev` `libasound2-dev` `pkg-config`
- openssl (`libssl-dev` on debian based distributions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm no. Slint itself doesn't require OpenSSL on the target. I think maybe one of the examples (the energy monitor). But it's not a general build requirement of Slint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there are other example specific items there, so no harm then:)

@task-jp
Copy link
Contributor Author

task-jp commented May 19, 2024

I think adding this to the container is fine (no harm), but I don't think it's a general requirement on the target. Or am I missing something here?

cargo tree says the dependency comes from reqwest that figma_import uses.

├── reqwest v0.11.27
│   ├── base64 v0.21.7
│   ├── bytes v1.6.0
│   ├── encoding_rs v0.8.34 (*)
│   ├── futures-core v0.3.30
│   ├── futures-util v0.3.30 (*)
│   ├── h2 v0.3.26
│   │   ├── bytes v1.6.0
│   │   ├── fnv v1.0.7
│   │   ├── futures-core v0.3.30
│   │   ├── futures-sink v0.3.30
│   │   ├── futures-util v0.3.30 (*)
│   │   ├── http v0.2.12
│   │   │   ├── bytes v1.6.0
│   │   │   ├── fnv v1.0.7
│   │   │   └── itoa v1.0.11
│   │   ├── indexmap v2.2.6 (*)
│   │   ├── slab v0.4.9 (*)
│   │   ├── tokio v1.37.0 (*)
│   │   ├── tokio-util v0.7.11
│   │   │   ├── bytes v1.6.0
│   │   │   ├── futures-core v0.3.30
│   │   │   ├── futures-sink v0.3.30
│   │   │   ├── pin-project-lite v0.2.14
│   │   │   └── tokio v1.37.0 (*)
│   │   └── tracing v0.1.40 (*)
│   ├── http v0.2.12 (*)
│   ├── http-body v0.4.6
│   │   ├── bytes v1.6.0
│   │   ├── http v0.2.12 (*)
│   │   └── pin-project-lite v0.2.14
│   ├── hyper v0.14.28
│   │   ├── bytes v1.6.0
│   │   ├── futures-channel v0.3.30 (*)
│   │   ├── futures-core v0.3.30
│   │   ├── futures-util v0.3.30 (*)
│   │   ├── h2 v0.3.26 (*)
│   │   ├── http v0.2.12 (*)
│   │   ├── http-body v0.4.6 (*)
│   │   ├── httparse v1.8.0
│   │   ├── httpdate v1.0.3
│   │   ├── itoa v1.0.11
│   │   ├── pin-project-lite v0.2.14
│   │   ├── socket2 v0.5.7 (*)
│   │   ├── tokio v1.37.0 (*)
│   │   ├── tower-service v0.3.2
│   │   ├── tracing v0.1.40 (*)
│   │   └── want v0.3.1
│   │       └── try-lock v0.2.5
│   ├── hyper-tls v0.5.0
│   │   ├── bytes v1.6.0
│   │   ├── hyper v0.14.28 (*)
│   │   ├── native-tls v0.2.11
│   │   │   ├── log v0.4.21
│   │   │   ├── openssl v0.10.64
│   │   │   │   ├── bitflags v2.5.0
│   │   │   │   ├── cfg-if v1.0.0
│   │   │   │   ├── foreign-types v0.3.2
│   │   │   │   │   └── foreign-types-shared v0.1.1
│   │   │   │   ├── libc v0.2.155
│   │   │   │   ├── once_cell v1.19.0 (*)
│   │   │   │   ├── openssl-macros v0.1.1 (proc-macro)
│   │   │   │   │   ├── proc-macro2 v1.0.82 (*)
│   │   │   │   │   ├── quote v1.0.36 (*)
│   │   │   │   │   └── syn v2.0.64 (*)
│   │   │   │   └── openssl-sys v0.9.102
│   │   │   │       └── libc v0.2.155
│   │   │   │       [build-dependencies]
│   │   │   │       ├── cc v1.0.97
│   │   │   │       ├── pkg-config v0.3.30
│   │   │   │       └── vcpkg v0.2.15
│   │   │   ├── openssl-probe v0.1.5
│   │   │   └── openssl-sys v0.9.102 (*)
│   │   ├── tokio v1.37.0 (*)
│   │   └── tokio-native-tls v0.3.1
│   │       ├── native-tls v0.2.11 (*)
│   │       └── tokio v1.37.0 (*)
│   ├── ipnet v2.9.0
│   ├── log v0.4.21
│   ├── mime v0.3.17
│   ├── native-tls v0.2.11 (*)
│   ├── once_cell v1.19.0 (*)
│   ├── percent-encoding v2.3.1
│   ├── pin-project-lite v0.2.14
│   ├── rustls-pemfile v1.0.4
│   │   └── base64 v0.21.7
│   ├── serde v1.0.202 (*)
│   ├── serde_json v1.0.117 (*)
│   ├── serde_urlencoded v0.7.1
│   │   ├── form_urlencoded v1.2.1 (*)
│   │   ├── itoa v1.0.11
│   │   ├── ryu v1.0.18
│   │   └── serde v1.0.202 (*)
│   ├── sync_wrapper v0.1.2
│   ├── tokio v1.37.0 (*)
│   ├── tokio-native-tls v0.3.1 (*)
│   ├── tokio-util v0.7.11 (*)
│   ├── tower-service v0.3.2
│   └── url v2.5.0 (*)

slint needs openssl to build it.

The system library `openssl` required by crate `openssl-sys` was not found.
The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
    - /usr/lib/arm-linux-gnueabihf/pkgconfig

HINT: you may need to install a package such as openssl, openssl-dev or openssl-devel.
@tronical tronical merged commit 9ca5c63 into slint-ui:master May 20, 2024
36 checks passed
@tronical
Copy link
Member

Update containers are published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants